/** * @license * Copyright 2025 Vybestack LLC * SPDX-License-Identifier: Apache-2.0 */ import { z } from 'zod'; /** * Schema for Kimi/Moonshot balance response * Based on https://api.moonshot.ai/v1/users/me/balance endpoint */ export declare const KimiBalanceSchema: z.ZodObject<{ available_balance: z.ZodNumber; voucher_balance: z.ZodOptional; cash_balance: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ available_balance: z.ZodNumber; voucher_balance: z.ZodOptional; cash_balance: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ available_balance: z.ZodNumber; voucher_balance: z.ZodOptional; cash_balance: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>; /** * Kimi balance information */ export type KimiBalanceInfo = z.infer; export declare const KimiCodeUsageResponseSchema: z.ZodObject<{ user: z.ZodOptional; membership: z.ZodOptional>; }, "strip", z.ZodTypeAny, { userId: string; region?: string | undefined; membership?: { level: string; } | undefined; }, { userId: string; region?: string | undefined; membership?: { level: string; } | undefined; }>>; usage: z.ZodOptional; }, "strip", z.ZodTypeAny, { limit: string; remaining: string; resetTime?: string | undefined; }, { limit: string; remaining: string; resetTime?: string | undefined; }>>; limits: z.ZodOptional>; detail: z.ZodObject<{ limit: z.ZodString; remaining: z.ZodString; resetTime: z.ZodOptional; }, "strip", z.ZodTypeAny, { limit: string; remaining: string; resetTime?: string | undefined; }, { limit: string; remaining: string; resetTime?: string | undefined; }>; }, "strip", z.ZodTypeAny, { detail: { limit: string; remaining: string; resetTime?: string | undefined; }; window?: { duration: number; timeUnit: string; } | undefined; }, { detail: { limit: string; remaining: string; resetTime?: string | undefined; }; window?: { duration: number; timeUnit: string; } | undefined; }>, "many">>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ user: z.ZodOptional; membership: z.ZodOptional>; }, "strip", z.ZodTypeAny, { userId: string; region?: string | undefined; membership?: { level: string; } | undefined; }, { userId: string; region?: string | undefined; membership?: { level: string; } | undefined; }>>; usage: z.ZodOptional; }, "strip", z.ZodTypeAny, { limit: string; remaining: string; resetTime?: string | undefined; }, { limit: string; remaining: string; resetTime?: string | undefined; }>>; limits: z.ZodOptional>; detail: z.ZodObject<{ limit: z.ZodString; remaining: z.ZodString; resetTime: z.ZodOptional; }, "strip", z.ZodTypeAny, { limit: string; remaining: string; resetTime?: string | undefined; }, { limit: string; remaining: string; resetTime?: string | undefined; }>; }, "strip", z.ZodTypeAny, { detail: { limit: string; remaining: string; resetTime?: string | undefined; }; window?: { duration: number; timeUnit: string; } | undefined; }, { detail: { limit: string; remaining: string; resetTime?: string | undefined; }; window?: { duration: number; timeUnit: string; } | undefined; }>, "many">>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ user: z.ZodOptional; membership: z.ZodOptional>; }, "strip", z.ZodTypeAny, { userId: string; region?: string | undefined; membership?: { level: string; } | undefined; }, { userId: string; region?: string | undefined; membership?: { level: string; } | undefined; }>>; usage: z.ZodOptional; }, "strip", z.ZodTypeAny, { limit: string; remaining: string; resetTime?: string | undefined; }, { limit: string; remaining: string; resetTime?: string | undefined; }>>; limits: z.ZodOptional>; detail: z.ZodObject<{ limit: z.ZodString; remaining: z.ZodString; resetTime: z.ZodOptional; }, "strip", z.ZodTypeAny, { limit: string; remaining: string; resetTime?: string | undefined; }, { limit: string; remaining: string; resetTime?: string | undefined; }>; }, "strip", z.ZodTypeAny, { detail: { limit: string; remaining: string; resetTime?: string | undefined; }; window?: { duration: number; timeUnit: string; } | undefined; }, { detail: { limit: string; remaining: string; resetTime?: string | undefined; }; window?: { duration: number; timeUnit: string; } | undefined; }>, "many">>; }, z.ZodTypeAny, "passthrough">>; /** * Kimi Code usage information */ export type KimiCodeUsageInfo = z.infer; /** * Fetch balance information from Kimi/Moonshot API * Only works with standard Moonshot API keys (not Kimi Code subscription keys) * * @param apiKey - Moonshot API key * @param baseUrl - Optional base URL to derive endpoint from * @returns Balance info if available, null on error */ export declare function fetchKimiUsage(apiKey: string, baseUrl?: string): Promise; /** * Format all available Kimi balance information for display */ export declare function formatKimiUsage(usage: KimiBalanceInfo): string[]; /** * Fetch usage information from Kimi Code /usages endpoint * Works with Kimi Code subscription keys (sk-kimi- prefix) * * @param apiKey - Kimi Code API key * @param baseUrl - Optional base URL to derive endpoint from * @returns Usage info if available, null on error */ export declare function fetchKimiCodeUsage(apiKey: string, baseUrl?: string): Promise; /** * Format all available Kimi Code usage information for display */ export declare function formatKimiCodeUsage(usage: KimiCodeUsageInfo): string[];