/** * Account Service Resource * Provides access to account balance and model information */ import { type AIMLAPIClient } from '../client'; export interface BalanceResponse { /** The total credits associated with the provided API key */ balance: number; /** True if the balance is below the threshold */ lowBalance: boolean; /** Threshold for switching to low balance status */ lowBalanceThreshold: number; /** The date of the request — i.e., the current date */ lastUpdated: string; /** Indicates whether auto top-up is enabled for the plan */ autoDebitStatus: string; /** The status of the plan associated with the provided API key */ status: string; /** A more detailed explanation of the plan status */ statusExplanation: string; } export interface ModelInfo { /** Human-readable model name */ name: string; /** Organization or company that developed the model */ developer: string; /** Short description of the model and its primary capabilities */ description: string; /** Maximum supported context window size in tokens */ contextLength?: number; /** Maximum number of tokens that can be generated in a single response */ maxTokens?: number; /** Public model landing page on AIML API website */ url: string; /** Link to the official API documentation for this model */ docs_url: string; } export interface Model { /** Unique identifier of the model */ id: string; /** Model interaction type */ type: string; /** Metadata describing the model */ info: ModelInfo; /** List of supported features and API capabilities for the model */ features: string[]; /** API endpoints through which this model can be accessed */ endpoints: string[]; } export interface ModelsResponse { /** Array of available models */ models: Model[]; } export interface ModelsAPIResponse { /** Response type, always "list" */ object: string; /** Array of available models */ data: Model[]; } export declare class Account { private readonly _client; constructor(_client: AIMLAPIClient); /** * Get account balance and billing information * * @example * ```typescript * const balance = await client.account.getBalance(); * console.log(`Current balance: ${balance.balance} credits`); * console.log(`Low balance: ${balance.lowBalance}`); * ``` */ getBalance(): Promise; /** * Get complete list of available models * No API key is required for this request * * @example * ```typescript * const models = await client.account.getModels(); * console.log(`Available models: ${models.models.length}`); * * // Filter chat models * const chatModels = models.models.filter(model => model.type === 'chat-completion'); * console.log(`Chat models: ${chatModels.length}`); * * // Filter image models * const imageModels = models.models.filter(model => model.type === 'image'); * console.log(`Image models: ${imageModels.length}`); * ``` */ getModels(): Promise; /** * Get models filtered by type * * @param type The model type to filter by (e.g., 'chat-completion', 'image', 'video') * * @example * ```typescript * const chatModels = await client.account.getModelsByType('chat-completion'); * const imageModels = await client.account.getModelsByType('image'); * const videoModels = await client.account.getModelsByType('video'); * ``` */ getModelsByType(type: string): Promise; /** * Get model by ID * * @param id The unique identifier of the model * * @example * ```typescript * const gpt4 = await client.account.getModelById('gpt-4'); * if (gpt4.models.length > 0) { * console.log(`Model: ${gpt4.models[0].info.name}`); * console.log(`Developer: ${gpt4.models[0].info.developer}`); * } * ``` */ getModelById(id: string): Promise; /** * Search models by developer * * @param developer The developer name to search for * * @example * ```typescript * const openaiModels = await client.account.getModelsByDeveloper('Open AI'); * const googleModels = await client.account.getModelsByDeveloper('Google'); * const anthropicModels = await client.account.getModelsByDeveloper('Anthropic'); * ``` */ getModelsByDeveloper(developer: string): Promise; /** * Get models that support specific features * * @param features Array of features to filter by * * @example * ```typescript * // Get models that support streaming * const streamingModels = await client.account.getModelsByFeatures([ * 'openai/chat-completion.stream' * ]); * * // Get models that support function calling * const functionModels = await client.account.getModelsByFeatures([ * 'openai/chat-completion.function' * ]); * ``` */ getModelsByFeatures(features: string[]): Promise; } //# sourceMappingURL=account.d.ts.map