export type ModelModality = "completion" | "embedding" | "image" | "audio" | "video" | "transcription";
export type MessageContent = {
    type: "text";
    text: string;
} | {
    type: "image_url";
    image_url: {
        url: string;
    };
} | {
    type: "audio_url";
    audio_url: {
        url: string;
    };
} | {
    type: "video_url";
    video_url: {
        url: string;
    };
};
export interface Message {
    role: "system" | "user" | "assistant" | "tool";
    content?: string | MessageContent[] | null;
    name?: string;
    tool_call_id?: string;
    tool_calls?: ToolCall[];
}
export interface OutputMessage extends Message {
    content?: string | null;
}
export interface ToolProp {
    type?: string;
    description?: string;
    properties?: {
        [key: string]: ToolProp;
    };
    items?: ToolProp;
}
export interface Tool {
    type: "function";
    function: {
        name: string;
        description?: string;
        parameters: {
            type: string;
            positional?: boolean;
            properties: {
                [key: string]: ToolProp;
            };
            required?: string[];
        };
    };
}
export interface ToolCall {
    id: string;
    type: "function";
    function: {
        name: string;
        arguments: string;
    };
}
export interface RetryOptions {
    timeout?: number;
    maxRetries?: number;
    backoffMs?: number;
    signal?: AbortSignal;
}
export interface CompletionOptions extends RetryOptions {
    model: string;
    messages: Message[];
    tools?: Tool[];
    tool_choice?: "auto" | "none";
    max_tokens?: number;
    reasoning_effort?: "low" | "medium" | "high";
    long_ttl_cache?: boolean;
}
export interface TokenUsage {
    prompt_tokens: number;
    completion_tokens: number;
    input_tokens?: number;
    output_tokens?: number;
    total_tokens?: number;
    prompt_tokens_details?: {
        cached_tokens: number;
    };
    cache_creation_input_tokens?: number;
    cache_read_input_tokens?: number;
}
export interface CompletionResponse {
    choices: {
        message: OutputMessage;
    }[];
    model: string;
    usage: TokenUsage | undefined;
    usd_cost?: number;
}
export interface EmbeddingOptions extends RetryOptions {
    input: string;
    model?: string;
}
export interface EmbeddingResponse {
    data: {
        object: string;
        embedding: number[];
        index: number;
    }[];
    model: string;
    usage: {
        prompt_tokens: number;
        total_tokens: number;
    };
    usd_cost?: number;
}
export interface AudioTranscriptionOptions extends RetryOptions {
    file: Blob | File | any;
    model?: string;
    language?: string;
    prompt?: string;
    response_format?: "json" | "text" | "srt" | "verbose_json" | "vtt";
    temperature?: number;
    fileName?: string;
}
export interface AudioTranscriptionResponse {
    text: string;
    language?: string;
    duration?: number;
    segments?: {
        id: number;
        seek: number;
        start: number;
        end: number;
        text: string;
        tokens: number[];
        temperature: number;
        avg_logprob: number;
        compression_ratio: number;
        no_speech_prob: number;
    }[];
    usd_cost?: number;
}
export interface AudioGenerationOptions extends RetryOptions {
    model: string;
    input: string;
    voice: string;
    response_format?: "mp3" | "opus" | "aac" | "flac" | "wav" | "pcm";
    speed?: number;
}
export interface AudioGenerationResponse {
    audio: Buffer;
    format: string;
    usd_cost?: number;
}
export interface ImageGenerationOptions extends RetryOptions {
    model: string;
    prompt: string;
    n?: number;
    size?: "256x256" | "512x512" | "1024x1024" | "1792x1024" | "1024x1792";
    quality?: "standard" | "hd";
    style?: "vivid" | "natural";
    response_format?: "url" | "b64_json";
    user?: string;
}
export interface ImageGenerationResponse {
    created: number;
    data: {
        url?: string;
        b64_json?: string;
        revised_prompt?: string;
    }[];
    usd_cost?: number;
}
export interface VideoGenerationOptions extends RetryOptions {
    model: string;
    prompt: string;
    duration?: number;
    resolution?: string;
    aspect_ratio?: string;
    n?: number;
    image_url?: string;
    video_url?: string;
}
export interface VideoGenerationResponse {
    created: number;
    data: {
        url?: string;
        b64_json?: string;
        video?: Buffer;
    }[];
    jobId?: string;
    usd_cost?: number;
}
export interface VideoStatusOptions {
    jobId: string;
    model?: string;
}
export interface VideoStatusResponse {
    jobId: string;
    status: "queued" | "in_progress" | "completed" | "failed" | "expired";
    data?: {
        url?: string;
        b64_json?: string;
        fileUri?: string;
    }[];
    error?: string;
    progress?: number;
}
export interface FileUploadOptions {
    data: Buffer;
    mimeType: string;
    displayName?: string;
    fileName?: string;
}
export interface FileUploadResponse {
    fileId: string;
    url?: string;
    uri?: string;
    mimeType?: string;
    sizeBytes?: number;
}
export interface FileDownloadOptions {
    fileId: string;
    uri?: string;
    filePath?: string;
}
export interface FileDownloadResponse {
    data: Buffer;
    mimeType?: string;
}
export interface GenericClient {
    setKey(key: string): void;
    createChatCompletion(options: CompletionOptions): Promise<CompletionResponse>;
    createEmbedding(options: EmbeddingOptions): Promise<EmbeddingResponse>;
    createAudioTranscription?(options: AudioTranscriptionOptions): Promise<AudioTranscriptionResponse>;
    createAudioGeneration?(options: AudioGenerationOptions): Promise<AudioGenerationResponse>;
    createImageGeneration?(options: ImageGenerationOptions): Promise<ImageGenerationResponse>;
    createVideoGeneration?(options: VideoGenerationOptions): Promise<VideoGenerationResponse>;
    getVideoStatus?(options: VideoStatusOptions): Promise<VideoStatusResponse>;
    downloadVideo?(options: FileDownloadOptions): Promise<FileDownloadResponse>;
    uploadFile?(options: FileUploadOptions): Promise<FileUploadResponse>;
    downloadFile?(options: FileDownloadOptions): Promise<FileDownloadResponse>;
    getModels(modality?: ModelModality): Promise<{
        id: string;
        modality?: ModelModality[];
    }[]>;
    getContextLimit?(model: string): {
        contextLimit: number;
        threshold: number;
    } | undefined;
}
