/** * Suno API HTTP client with rate limiting and polling helpers. * * Rate limit: 20 requests per 10 seconds (sunoapi.org). * Proxy support via SUNO_HTTP_PROXY / HTTPS_PROXY / HTTP_PROXY env vars. */ export interface SunoApiResponse { code: number; msg: string; data: T; } export interface SunoTrack { id: string; audio_url?: string; audioUrl?: string; source_audio_url?: string; stream_audio_url?: string; streamAudioUrl?: string; source_stream_audio_url?: string; image_url?: string; imageUrl?: string; source_image_url?: string; prompt?: string; model_name?: string; modelName?: string; title?: string; tags?: string; createTime?: string; duration?: number; } export interface SunoTaskData { taskId: string; parentMusicId?: string; param?: string; response?: { taskId?: string; data?: SunoTrack[]; sunoData?: SunoTrack[]; }; status: string; type?: string; operationType?: 'generate' | 'extend' | 'upload_cover' | 'upload_extend'; errorCode?: number | null; errorMessage?: string | null; } export declare class SunoClient { private readonly baseUrl; private readonly apiKey; private readonly maxRequests; private readonly windowMs; private readonly proxyAgent?; private requestTimestamps; constructor(apiKey: string); /** * Enforce rate limit: max 20 requests per 10 seconds. */ private throttle; request(method: 'GET' | 'POST', path: string, body?: Record): Promise>; get(path: string): Promise>; post(path: string, body: Record): Promise>; /** * Poll task status until terminal state or timeout. */ pollTaskStatus(taskId: string, options?: { intervalMs?: number; maxAttempts?: number; statusPath?: string; }): Promise; } //# sourceMappingURL=client.d.ts.map