import { KyInstance } from "ky"; //#region src/types/client.d.ts interface ClientOptions { baseURL?: string; accessToken?: string | (() => string | undefined); timeout?: number; /** Max retries on 429 rate limit responses. Default: 2. Set 0 to disable. */ maxRetries?: number; } //#endregion //#region src/errors.d.ts declare class ListenHubError extends Error { readonly status: number; readonly code: string; readonly requestId?: string; constructor(params: { status: number; code: string; message: string; requestId?: string; }); } //#endregion //#region src/types/auth.d.ts interface ConnectInitResponse { sessionId: string; authUrl: string; } interface TokenResponse { accessToken: string; refreshToken: string; expiresIn: number; } interface StoredCredentials { accessToken: string; refreshToken: string; expiresAt: number; apiKey?: string; } //#endregion //#region src/types/checkin.d.ts interface CheckinResponse { checkinDate: string; rewardCredits: number; } interface CheckinStatusResponse { status: 'checked_in' | 'not_checked_in'; hasCheckedInToday: boolean; lastCheckinTime: number; monthlyCheckinCount: number; } //#endregion //#region src/types/settings.d.ts interface ApiKeyResponse { key: string; } interface StyleImage { id: string; name: string; uri: string; mimeType: string; } interface SettingsSpeaker { id: string; name: string; speakerInnerId: string; gender: string; } interface SettingsItem { type: string; language: string; speakers: SettingsSpeaker[]; duration: string; mode: string; updatedAt: number; imagesConfig: { story?: StyleImage[]; info?: StyleImage[]; slides?: StyleImage[]; }; } interface SettingsResponse { items: SettingsItem[]; } //#endregion //#region src/types/episodes.d.ts type Language = 'en' | 'zh' | 'ja'; type ProcessStatus = 'pending' | 'success' | 'fail'; interface UrlSourceMetadata { title?: string; ogTitle?: string; faviconUrl?: string; ogImageUrl?: string; ogSiteName?: string; } interface ContentSource { type: 'url' | 'text'; uri?: string; content?: string; metadata?: UrlSourceMetadata; } interface EpisodeSpeaker { name: string; speakerInnerId: string; gender: string; } interface EpisodeCreator { nickname: string; avatar: string; } interface CreateEpisodeResponse { episodeId: string; } interface CreatePodcastParams { type: 'podcast-solo' | 'podcast-duo'; query?: string; sources?: ContentSource[]; template: { type: 'podcast'; mode: 'quick' | 'deep' | 'debate'; speakers: string[]; language: Language; }; /** Generation speed multiplier 0.5–2.0 (at most two decimals). Defaults to 1 (original speed); this is the speaking rate of the generated audio, not a player playback rate. */ speed?: number; } interface CreateTTSParams { sources: ContentSource[]; template: { type: 'flowspeech'; mode: 'smart' | 'direct'; speakers: string[]; language: Language; }; /** Generation speed multiplier 0.5–2.0 (at most two decimals). Defaults to 1 (original speed); this is the speaking rate of the generated audio, not a player playback rate. */ speed?: number; } type ImageSize = '2K' | '4K'; type SlideAspectRatio = '16:9' | '9:16' | '1:1'; interface CreateExplainerVideoParams { query?: string; sources?: ContentSource[]; style?: string; styleOverride?: string; skipAudio?: boolean; imageConfig?: { size: ImageSize; aspectRatio: SlideAspectRatio; }; template: { type: 'storybook'; mode: 'info' | 'story'; speakers: string[]; language: Language; style?: string; size?: ImageSize; aspectRatio?: SlideAspectRatio; pageCount?: number; }; } interface CreateSlidesParams { query?: string; sources?: ContentSource[]; style?: string; styleOverride?: string; /** Skip audio generation (visual only). Defaults to true. */ skipAudio?: boolean; imageConfig?: { size: ImageSize; aspectRatio: SlideAspectRatio; }; template: { type: 'storybook'; mode: 'slides'; speakers: string[]; language: Language; style?: string; size?: ImageSize; aspectRatio?: SlideAspectRatio; pageCount?: number; }; } interface EpisodeImageConfig { size: string; aspectRatio: string; } interface EpisodeInput { query?: string; sources: ContentSource[]; } interface EpisodeItem { id: string; type: string; status: string; title: string; summary: string; cover: string; audioUrl: string; audioDuration: number; videoUrl: string; input: EpisodeInput; inputSources: ContentSource[]; processStatus: ProcessStatus; stepStatus: string; failCode: number; playedStatus: number; slidesStatus: string; creator: EpisodeCreator; playCount: number; generationType: string; enabledShare: boolean; mode: string; speakers: EpisodeSpeaker[]; language: string; imageConfig?: EpisodeImageConfig; createdAt: number; } type ProductId = 'aiPodcast' | 'textToSpeech' | 'explainerVideo' | 'slideDeck'; interface ListEpisodesParams { page?: number; pageSize?: number; } interface ListEpisodesResponse { items: EpisodeItem[]; pagination: { page: number; pageSize: number; total?: number; }; } interface EpisodeDetailTopicData { inputType: string; data: T; } interface EpisodeDetailAudio { audioUrl: string; audioDuration: number; audioHlsUrl: string; } interface EpisodeDetailVideo { videoUrl: string; videoStatus: string; } interface EpisodeDetailPage { text: string; pageNumber: number; imageUrl: string; audioTimestamp: number; } interface EpisodeDetailReference { type: string; url_citation: { title: string; exactQuote: string; url: string; dateTime: string; favicon: string; }; } interface EpisodeDetailPreprocess { deepsearchEnabled: boolean; content: string; references: EpisodeDetailReference[]; } interface EpisodeDetailScript { content: string; speakerInnerId: string; } interface EpisodeDetailSeoMeta { keywords: string; meta_description: string; } interface EpisodeDetail { id: string; generationType: string; generationMode: string; sseEvent: string[]; ownerMatch: boolean; sourceType: string; createdAt: number; completedAt: number; enabledShare: boolean; playedStatus: number; creator: EpisodeCreator; playCount: number; input: { query?: string; sources: Array<{ type: string; uri?: string; content: string; scrapeStatus?: boolean; metadata?: Record; }>; }; credits: number; failCode: number; processStatus: ProcessStatus; language: string; speakers: EpisodeSpeaker[]; topicDetail: { title: EpisodeDetailTopicData; outline: EpisodeDetailTopicData; cover: EpisodeDetailTopicData; audio: EpisodeDetailTopicData; video: EpisodeDetailTopicData; pages: EpisodeDetailTopicData; preprocessResult: EpisodeDetailTopicData; scripts?: EpisodeDetailTopicData; seoMeta?: EpisodeDetailTopicData; slides?: EpisodeDetailTopicData<{ slidesUrl: string; slidesStatus: string; }>; pptx?: EpisodeDetailTopicData<{ pptxUrl: string; pptxStatus: string; }>; resource?: EpisodeDetailTopicData<{ resourceUrl?: string; resourceStatus: string; }>; }; } interface DeleteEpisodesParams { ids: string[]; } //#endregion //#region src/types/users.d.ts interface UserProfile { id: string; username: string; nickname: string; avatar: string; email: string; createdAt: number; updatedAt: number; activeStatus: string; registerSource: string; provisionStatus: boolean; scopes: string[]; } interface SubscriptionPlan { id: string; name: string; duration: number; platform: string; application: string; region: string; } interface SubscriptionInfo { subscriptionProductId: string; subscriptionStatus: string; subscriptionStartedAt: number; subscriptionExpiresAt: number; usageAvailableMonthlyCredits: number; usageTotalMonthlyCredits: number; usageAvailablePermanentCredits: number; usageTotalPermanentCredits: number; usageAvailableLimitedTimeCredits: number; totalAvailableCredits: number; usageAudioGenerateAvailableAmount: number; usageAudioGenerateUsedAmount: number; resetAt: number; platform: string; renewStatus: boolean; trialStatus: boolean; paidStatus: boolean; subscriptionPlan: SubscriptionPlan | Record; } //#endregion //#region src/types/speakers.d.ts interface Speaker { id: string; name: string; speakerInnerId: string; personality: string; demoAudioUrl: string; gender: string; accessType: string; weight: number; } interface ListSpeakersParams { language?: string; status?: number; } interface ListSpeakersResponse { items: Speaker[]; } //#endregion //#region src/types/images.d.ts /** * 后端 `ACCEPTED_IMAGE_MODEL_INPUTS` 的镜像:7 个 GA ID + 2 个仍被放行的 legacy preview 别名。 * `/v1/images` 与 `/v1/banana/images` 校验的是同一份清单(后端默认值都是 `gpt-image-2`), * 所以两条路由共用这个联合类型;漂移会让 SDK 调不到后端已支持的模型(issue #728)。 */ type ImageModel = 'gemini-3-pro-image' | 'gemini-3.1-flash-image' | 'gpt-image-2' | 'gpt-image-2-official' | 'wan2.7-image-pro' | 'wan2.7-image' | 'seedream-5-0-pro' | 'gemini-3-pro-image-preview' | 'gemini-3.1-flash-image-preview'; /** GA 模型 ID(不含 legacy preview 别名)。 */ declare const IMAGE_MODELS: readonly ["gemini-3-pro-image", "gemini-3.1-flash-image", "gpt-image-2", "gpt-image-2-official", "wan2.7-image-pro", "wan2.7-image", "seedream-5-0-pro"]; /** 后端仍放行、会被 normalize 成 GA ID 的历史 preview 值。 */ declare const LEGACY_IMAGE_MODEL_ALIASES: readonly ["gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"]; /** 入参校验可接受的全部值,与后端 `ACCEPTED_IMAGE_MODEL_INPUTS` 逐项对齐。 */ declare const ACCEPTED_IMAGE_MODELS: readonly ["gemini-3-pro-image", "gemini-3.1-flash-image", "gpt-image-2", "gpt-image-2-official", "wan2.7-image-pro", "wan2.7-image", "seedream-5-0-pro", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"]; type ImagePromptLanguage = 'auto' | 'en' | 'ja' | 'ko' | 'hi' | 'zh' | 'pt' | 'es'; type AIImageAspectRatio = '1:1' | '1:4' | '1:8' | '2:3' | '3:2' | '3:4' | '4:1' | '4:3' | '9:16' | '16:9' | '21:9' | '8:1' | '1:8'; type AIImageSize = '1K' | '2K' | '4K'; interface CreateAIImageParams { prompt: string; referenceImageUrls?: string[]; language?: ImagePromptLanguage; aspectRatio?: AIImageAspectRatio; imageSize?: AIImageSize; model?: ImageModel; isLossless?: boolean; enableSearch?: boolean; } interface CreateAIImageResponse { imageId: string; } interface AIImageItem { id: string; prompt: string; referenceImageUrls: string[]; imageUrl: string; thumbnailUrl: string; aspectRatio: string; imageSize: string; language: string; isLossless: boolean; status: string; reviewStatus: string; tags: string[]; createdAt: number; updatedAt: number; creator: { nickname: string; avatar: string; }; } interface ListAIImagesParams { page?: number; pageSize?: number; } interface ListAIImagesResponse { items: AIImageItem[]; pagination: { page: number; pageSize: number; total: number; }; } /** * Parameters for batch-deleting AI images (`DELETE /v1/images`). * Up to 100 ids per call (the backend enforces `.min(1).max(100)`). */ interface DeleteAIImagesParams { ids: string[]; } //#endregion //#region src/types/music.d.ts type MusicTaskType = 'GENERATE' | 'INSTRUMENTAL' | 'SOUNDTRACK' | 'COVER' | 'MASHUP' | 'EXTEND' | 'REMIX' | 'RECOGNIZE' | 'DESCRIBE' | 'STEM' | 'TRACK'; type MusicTaskStatus = 'pending' | 'generating' | 'uploading' | 'success' | 'failed'; /** Mureka model tiers used by the default provider. */ type MusicModel = 'auto' | 'mureka-7.6' | 'mureka-8' | 'mureka-9' | 'mureka-o2'; /** Track types supported by the single-track generation endpoint. */ type MusicGenerateType = 'Vocals' | 'Instrumental' | 'Drums' | 'Bass' | 'Guitar' | 'Keyboard' | 'Percussion' | 'Strings' | 'Synth' | 'FX' | 'Brass' | 'Woodwinds'; /** * Binary audio/image/video input for a multipart music endpoint. * Pass a Blob/File (browser) or `new Blob([buffer])` (Node 18+). */ type MusicFileInput = Blob; interface CreateMusicGenerateParams { prompt?: string; lyrics?: string; model?: MusicModel; style?: string; title?: string; instrumental?: boolean; /** Reusable Vocal ID. */ vocalId?: string; } /** @deprecated Cover is pinned to the legacy Suno provider; new code should use `createMusicRemix`. */ interface CreateMusicCoverParams { uploadUrl: string; prompt?: string; style?: string; title?: string; instrumental?: boolean; } interface CreateMusicExtendParams { uploadUrl: string; model: 'V4' | 'V4_5' | 'V4_5PLUS' | 'V4_5ALL' | 'V5' | 'V5_5'; continueAt: number; prompt?: string; style?: string; title?: string; instrumental?: boolean; negativeTags?: string; vocalGender?: 'm' | 'f'; styleWeight?: number; weirdnessConstraint?: number; audioWeight?: number; } /** Mureka remix: re-create a song from an existing track + new lyrics. */ interface CreateMusicRemixParams { /** Audio source — exactly one of audio / audioUrl / providerSongId. */ audio?: MusicFileInput; audioFilename?: string; /** Internal ListenHub audio URL (owned by the user or public). */ audioUrl?: string; /** Mureka song id from a previous generation. */ providerSongId?: string; lyrics: string; prompt: string; } /** Standalone instrumental generation — prompt XOR referenceAudio. */ interface CreateMusicInstrumentalParams { prompt?: string; referenceAudio?: MusicFileInput; referenceAudioFilename?: string; model?: MusicModel; } /** Generate music from an image OR a video (mutually exclusive). */ interface CreateMusicSoundtrackParams { image?: MusicFileInput; imageFilename?: string; video?: MusicFileInput; videoFilename?: string; prompt?: string; model?: MusicModel; } /** Generate a single instrument/vocal track. */ interface CreateMusicTrackParams { /** Audio source — exactly one of audio / providerSongId. */ audio?: MusicFileInput; audioFilename?: string; providerSongId?: string; generateType: MusicGenerateType; prompt: string; /** Required when generateType is 'Vocals'. */ lyrics?: string; vocalGender?: 'male' | 'female'; /** Range constraint in seconds. */ generateStart?: number; generateEnd?: number; } interface RecognizeMusicParams { audio: MusicFileInput; audioFilename?: string; } interface DescribeMusicParams { audio: MusicFileInput; audioFilename?: string; } interface StemMusicParams { audio: MusicFileInput; audioFilename?: string; model?: 'audio-separation-1' | 'audio-separation-2'; } interface CreateMusicTaskResponse { taskId: string; taskType: MusicTaskType; status: MusicTaskStatus; } interface MusicTrack { title: string; tags: string; duration: number; audioUrl: string; flacUrl?: string; wavUrl?: string; providerSongId?: string; lyricsSections?: unknown[]; } interface MusicTaskDetail { id: string; provider: string; taskType: MusicTaskType; status: MusicTaskStatus; params: { model?: string; prompt?: string; style?: string; title?: string; customMode?: boolean; instrumental?: boolean; [key: string]: unknown; }; tracks: MusicTrack[]; /** Present for sync endpoints (recognize/describe/stem). */ result?: Record; creditCost: number; errorMessage?: string; createdAt: number; updatedAt: number; } /** Synchronous lyric-recognition result. */ interface RecognizeMusicResponse { id: string; status: 'success'; creditCost: number; result: { duration: number; lyricsSections: unknown[]; }; createdAt: number; } /** Synchronous audio-analysis result. */ interface DescribeMusicResponse { id: string; status: 'success'; creditCost: number; result: { description: string; tags: string[]; genres: string[]; instruments: string[]; }; createdAt: number; } /** Synchronous stem-separation result (download links, ~24h expiry). */ interface StemMusicResponse { id: string; status: 'success'; creditCost: number; result: { zipUrl: string; midiZipUrl: string | null; expiresAt: number; }; createdAt: number; } interface ListMusicTasksParams { page?: number; pageSize?: number; status?: MusicTaskStatus; } interface ListMusicTasksResponse { items: MusicTaskDetail[]; page: number; pageSize: number; total: number; } //#endregion //#region src/types/files.d.ts interface CreateFileUploadParams { fileKey: string; contentType: string; category?: string; } interface CreateFileUploadResponse { presignedUrl: string; fileUrl: string; } interface GetFileDownloadUrlResponse { downloadUrl: string; } type UploadFileData = Blob | ArrayBuffer | ArrayBufferView; interface UploadFileParams { file: UploadFileData; fileName?: string; contentType?: string; category?: string; } //#endregion //#region src/types/lyrics.d.ts type LyricsTaskStatus = 'pending' | 'generating' | 'success' | 'failed'; interface CreateLyricsParams { prompt: string; } interface CreateLyricsTaskResponse { taskId: string; status: LyricsTaskStatus; } interface LyricsVariant { text: string; title: string; status: 'complete' | 'failed'; errorMessage?: string; } interface LyricsTaskDetail { id: string; provider: string; status: LyricsTaskStatus; params: { prompt: string; }; variants: LyricsVariant[]; creditCost: number; errorMessage?: string; createdAt: number; updatedAt: number; } interface ListLyricsTasksParams { page?: number; pageSize?: number; status?: LyricsTaskStatus; } interface ListLyricsTasksResponse { items: LyricsTaskDetail[]; page: number; pageSize: number; total: number; } //#endregion //#region src/types/video-generation.d.ts type VideoGenerationModel = 'doubao-seedance-2-pro' | 'doubao-seedance-2-fast' | 'happyhorse'; type VideoGenerationResolution = '480p' | '720p' | '1080p'; type VideoGenerationRatio = '16:9' | '4:3' | '1:1' | '3:4' | '9:16' | '21:9' | '4:5' | '5:4'; type VideoGenerationTaskStatus = 'pending' | 'generating' | 'uploading' | 'success' | 'failed'; type VideoContentRole = 'first_frame' | 'last_frame' | 'reference_image' | 'reference_video' | 'reference_audio'; type VideoGenerationErrorCode = '32001' | '32002' | '32003' | '32004' | '32005' | '32006' | '32007' | '32008'; interface VideoContentText { type: 'text'; text: string; } interface VideoContentImageUrl { type: 'image_url'; image_url: { url: string; width?: number; height?: number; size?: number; }; role: 'first_frame' | 'last_frame' | 'reference_image'; } interface VideoContentVideoUrl { type: 'video_url'; video_url: { url: string; width?: number; height?: number; duration?: number; fps?: number; size?: number; }; role: 'reference_video'; } interface VideoContentAudioUrl { type: 'audio_url'; audio_url: { url: string; }; role: 'reference_audio'; } type VideoContentItem = VideoContentText | VideoContentImageUrl | VideoContentVideoUrl | VideoContentAudioUrl; interface VideoReferenceImageMeta { role: 'first_frame' | 'last_frame' | 'reference_image'; width: number; height: number; size?: number; } interface VideoReferenceVideoMeta { role: 'reference_video'; width: number; height: number; duration?: number; fps?: number; size?: number; } interface UploadVideoReferenceImageParams { file: UploadFileData; fileName?: string; contentType?: string; role: 'first_frame' | 'last_frame' | 'reference_image'; } interface UploadedVideoReferenceImage { fileUrl: string; content: VideoContentImageUrl; referenceImage: VideoReferenceImageMeta; } /** * Parameters for creating a video generation task. * * Model-specific constraints (enforced server-side): * - `happyhorse`: no 480p resolution; no `last_frame` or `audio_url` content; ratio supports 4:5/5:4; * min duration 3s; max prompt length 2500 chars; inputVideoDuration range [3,60] * - `doubao-seedance-*`: min duration 4s; max prompt length 500 chars; inputVideoDuration range [2,15]; * 1080p only available on `doubao-seedance-2-pro` */ interface CreateVideoGenerationParams { model?: VideoGenerationModel; content: VideoContentItem[]; resolution?: VideoGenerationResolution; ratio?: VideoGenerationRatio; duration?: number; generateAudio?: boolean; seed?: number; inputVideoDuration?: number; /** Reference image dimensions used by Seedance validation. Prefer this over embedding metadata in content. */ referenceImages?: VideoReferenceImageMeta[]; /** Reference video dimensions/duration used by Seedance validation. Prefer this over embedding metadata in content. */ referenceVideos?: VideoReferenceVideoMeta[]; /** Audio handling for happyhorse video-edit mode. Only effective when model is 'happyhorse' and content includes a video_url. */ audioSetting?: 'auto' | 'origin'; } interface ListVideoGenerationTasksParams { page?: number; pageSize?: number; status?: VideoGenerationTaskStatus; } interface EstimateVideoGenerationCreditsParams { model: VideoGenerationModel; resolution: VideoGenerationResolution; duration: number; hasVideoInput?: boolean; inputVideoDuration?: number; referenceImages?: VideoReferenceImageMeta[]; referenceVideos?: VideoReferenceVideoMeta[]; ratio?: VideoGenerationRatio; } interface CreateVideoGenerationResponse { taskId: string; status: VideoGenerationTaskStatus; } interface VideoGenerationTaskDetail { id: string; status: VideoGenerationTaskStatus; model: string; params: { content: VideoContentItem[]; resolution: string; ratio: string; duration: number; generateAudio: boolean; seed: number; referenceImages?: VideoReferenceImageMeta[]; referenceVideos?: VideoReferenceVideoMeta[]; }; videoUrl?: string; providerVideoUrl?: string; duration?: number; resolution?: string; ratio?: string; seed?: number; creditCharged: number; createdAt: number; updatedAt: number; } interface VideoGenerationTaskListItem { id: string; status: VideoGenerationTaskStatus; model: string; params: { resolution: string; ratio: string; duration: number; referenceImages?: VideoReferenceImageMeta[]; referenceVideos?: VideoReferenceVideoMeta[]; }; videoUrl?: string; providerVideoUrl?: string; seed?: number; creditCharged: number; createdAt: number; } interface ListVideoGenerationTasksResponse { items: VideoGenerationTaskListItem[]; page: number; pageSize: number; total: number; } interface EstimateVideoGenerationCreditsResponse { tokens: number; credits: number; } type PixVerseModel = 'pixverse' | 'v6' | 'v5' | 'v4.5'; type PixVerseLanguage = 'zh' | 'en'; type PixVerseCapability = 'text_to_video' | 'image_to_video' | 'transition' | 'multi_transition' | 'fusion' | 'restyle' | 'mimic' | 'lip_sync' | 'agent'; type PixVerseQuality = '360p' | '540p' | '720p' | '1080p'; type PixVerseAspectRatio = '9:16' | '16:9' | '1:1' | '4:3' | '3:4'; type PixVerseAgentType = 'ad_master' | 'promo_mix'; type PixVerseImageReferenceType = 'subject' | 'background'; type PixVerseBrandStickerPosition = 'up' | 'down' | 'left' | 'right' | 'upper_left' | 'lower_left' | 'upper_right' | 'lower_right'; type PixVerseIntroOutroPosition = 'start' | 'end'; /** A media asset reference. `duration` is in seconds (integer). */ interface PixVerseAsset { url: string; duration?: number; } interface PixVerseMultiTransitionItem { imageUrl: string; duration: number; prompt: string; } interface PixVerseImageReference { type: PixVerseImageReferenceType; imageUrl: string; /** Reference name; must match `@refName` token inside the fusion prompt. */ refName: string; } interface PixVerseTts { speakerId: string; content: string; } interface PixVerseBrandSticker { imageUrl: string; position: PixVerseBrandStickerPosition; } interface PixVerseIntroOutroClip { videoUrl: string; position: PixVerseIntroOutroPosition; } /** Nested PixVerse-specific options. All fields optional; relevance depends on capability. */ interface PixVerseOptions { agentType?: PixVerseAgentType; motionMode?: string; cameraMovement?: string; templateId?: string | number; sourceVideoId?: string | number; restyleId?: string | number; multiTransition?: PixVerseMultiTransitionItem[]; imageReferences?: PixVerseImageReference[]; tts?: PixVerseTts; soundEffectSwitch?: boolean; soundEffectContent?: string; lipSyncTtsSwitch?: boolean; lipSyncTtsSpeakerId?: string; lipSyncTtsContent?: string; brandSticker?: PixVerseBrandSticker; introOutroClip?: PixVerseIntroOutroClip; } /** * Parameters for creating a PixVerse video generation task. * * Capability-specific constraints (enforced server-side): * - `mimic`: locked to 720p quality * - `agent`: quality must be 720p or 1080p; duration must be 20/30/60 (default 30); requires `pixverse.agentType` * - `multi_transition`: default quality 360p; requires `pixverse.multiTransition` (2-7 items) * - `fusion`: prompt must contain `@refName` for each `pixverse.imageReferences` entry * - `promo_mix` agent: requires >= 4 images * - `restyle` / `lip_sync`: may reuse a prior succeeded PixVerse task via `sourceTaskId` */ interface CreatePixVerseVideoParams { capability: PixVerseCapability; model?: PixVerseModel; /** Service region; `en` (default) is international, `zh` is mainland China. */ language?: PixVerseLanguage; prompt?: string; /** Output duration in seconds (1-60, default 5; agent: 20/30/60). */ duration?: number; aspectRatio?: PixVerseAspectRatio; quality?: PixVerseQuality; /** Reuse a prior succeeded PixVerse task (restyle / lip_sync). */ sourceTaskId?: string; images?: PixVerseAsset[]; videos?: PixVerseAsset[]; audios?: PixVerseAsset[]; pixverse?: PixVerseOptions; } interface CreatePixVerseVideoResponse { taskId: string; episodeId?: string; status: 'generating'; } interface EstimatePixVerseVideoCreditsParams { capability: PixVerseCapability; model?: PixVerseModel; language?: PixVerseLanguage; duration?: number; quality?: PixVerseQuality; pixverse?: { agentType?: PixVerseAgentType; soundEffectSwitch?: boolean; lipSyncTtsSwitch?: boolean; /** Source video duration in seconds (1-180), used for restyle / lip_sync estimates. */ sourceDuration?: number; /** Input audio duration in seconds (1-180), used for lip_sync estimates. */ inputAudioDuration?: number; multiTransition?: Array<{ duration: number; }>; tts?: { content: string; }; }; } /** Shared shape with {@link EstimateVideoGenerationCreditsResponse}. */ interface EstimatePixVerseVideoCreditsResponse { tokens: number; credits: number; } //#endregion //#region src/types/banana.d.ts /** `POST /v1/banana/images` 独有:官方渠道按档计价。`/v1/images` 也接受同一组值。 */ type BananaImageQuality = 'low' | 'medium' | 'high'; type BananaImageScope = 'me' | 'public'; type BananaReferenceImageBase64 = { data: string; mimeType: string; }; type BananaReferenceImageDimension = { width: number; height: number; }; interface CreateBananaImageParams { prompt: string; /** 最多 14 张;各模型另有更严的上限(GPT-Image-2 4 张、Wan2.7 9 张、Seedream 10 张),由后端拒绝。 */ referenceImageUrls?: string[]; /** 最多 5 张,且与 URL 参考图共享全局限流。 */ referenceImageBase64?: BananaReferenceImageBase64[]; /** 顺序对齐 referenceImageUrls + referenceImageBase64;官方渠道按真实宽高逐张计价。 */ referenceImageDimensions?: BananaReferenceImageDimension[]; language?: ImagePromptLanguage; aspectRatio?: AIImageAspectRatio; imageSize?: AIImageSize; /** 生成即公开。后端默认 false,且非订阅用户传 true 会被订阅墙拒绝。 */ isPublic?: boolean; isLossless?: boolean; isRetry?: boolean; model?: ImageModel; enableSearch?: boolean; quality?: BananaImageQuality; /** 重试语义:指向被重试的原图。 */ rootImageId?: string; /** 编辑链语义,与 rootImageId 不复用。 */ editRootImageId?: string; editParentImageId?: string; editSummary?: string; /** * 一次多图生成的分组 id:n 个并行请求带同一个值,Featured/Trending 据此折叠成一组。 * 后端不生成它——客户端不传就没有分组,n 张图会各自散在发现面上。 */ batchId?: string; } interface CreateBananaImageResponse { imageId: string; } interface BananaImageCreator { userId?: string; nickname?: string; avatar?: string; } interface BananaImageItem { id: string; prompt: string; referenceImageUrls: string[]; imageUrl: string; thumbnailUrl: string; aspectRatio: string; imageSize: string; quality?: string; modelName?: string; enableSearch?: boolean; createdAt: number; creator?: BananaImageCreator; hasFavorited?: boolean; stats?: { favoriteCount?: number; }; editRootImageId?: string; editParentImageId?: string; editSummary?: string; /** 只在 `scope=me` 或所有者读取时返回。 */ status?: string; isPublic?: boolean; isRetry?: boolean; rootImageId?: string; latestEditImageId?: string; latestEditThumbnailUrl?: string; } interface ListBananaImagesParams { page?: number; pageSize?: number; /** 默认 `public`;用 `me` 读自己的图(未登录会被拒)。 */ scope?: BananaImageScope; status?: string; modelName?: ImageModel; editRootImageId?: string; } interface ListBananaImagesResponse { items: BananaImageItem[]; pagination: { page: number; pageSize: number; total: number; }; } //#endregion //#region src/types/listenhub-voice.d.ts /** * ListenHub Voice (`listenhub-voice-1.0`) types for {@link ListenHubClient} (camelCase). * * Source of truth: listenhub-api-server `src/openapi-controllers/seed-audio.ts`, * `src/service/seed-audio/{request,index}.ts`, and `api-docs/listenhub.yaml`. * Only the three public endpoints are modeled here; `/v1/listenhub-voice/voices` and * `/v1/listenhub-voice/estimate-credits` are intentionally not part of the SDK surface. */ /** The only supported model. Must stay in sync with the server enum. */ type ListenHubVoiceModel = 'listenhub-voice-1.0'; /** * Public task statuses. The internal `pending_payment` state is never exposed — * the server maps it to `generating`. */ type ListenHubVoiceTaskStatus = 'pending' | 'generating' | 'uploading' | 'success' | 'failed'; /** Output audio container/codec. Defaults to `mp3` server-side. */ type ListenHubVoiceFormat = 'mp3' | 'wav' | 'pcm' | 'ogg_opus'; /** * A single voice element (one item of the `voices` array). Either: * - `{type: 'speaker', id}` — a registered voice: `id` is a ListenHub public * `speakerInnerId` or an official platform `voice_type` (resolved server-side). * - `{type: 'reference', url}` — a custom reference audio URL to clone. */ type ListenHubVoiceVoice = { type: 'speaker'; id: string; } | { type: 'reference'; url: string; }; /** * Reference image input for end-to-end image-to-audio. `url`/`data` are mutually * exclusive (exactly one). Mutually exclusive with `voices`. */ interface ListenHubVoiceImageInput { /** Remote image URL (http/https). */ url?: string; /** Base64-encoded image data. */ data?: string; } interface ListenHubVoiceConfig { /** Speech rate, range [-50, 100]. */ speechRate?: number; /** Loudness rate, range [-50, 100]. */ loudnessRate?: number; /** Pitch rate, range [-12, 12]. */ pitchRate?: number; /** Output format. Defaults to `mp3`. */ format?: ListenHubVoiceFormat; } /** * Parameters for creating a ListenHub Voice generation task. * * Constraints (enforced server-side): * - `text`: required, trimmed, max 1400 chars. * - `voices`: 1-3 items. For multi-voice (>1), every item must be a `reference` * (or a library reference-audio voice) — an official platform `voice_type` only * works for single voice. Mutually exclusive with `image`. * - `image`: at most one image (`url` or `data`). Mutually exclusive with `voices`. * - `durationHint`: range [1, 110]. */ interface CreateListenHubVoiceParams { model?: ListenHubVoiceModel; text: string; voices?: ListenHubVoiceVoice[]; image?: ListenHubVoiceImageInput; audioConfig?: ListenHubVoiceConfig; durationHint?: number; watermark?: boolean; } interface CreateListenHubVoiceResponse { taskId: string; status: ListenHubVoiceTaskStatus; } /** * Response-side reference image shape (sanitized). Never contains base64 `data`: * the server returns only `url` and/or `hasData` plus an optional `thumbnailUrl`. */ interface ListenHubVoiceImageResponse { url?: string; hasData?: boolean; thumbnailUrl?: string; } /** * A ListenHub Voice task as returned by detail and list endpoints (same shape). * `audioUrl` is only present when `status === 'success'`. */ interface ListenHubVoiceTaskDetail { id: string; status: ListenHubVoiceTaskStatus; model: string; params: { text: string; voices?: ListenHubVoiceVoice[]; image?: ListenHubVoiceImageResponse; audioConfig?: ListenHubVoiceConfig; durationHint?: number; watermark?: boolean; }; /** Only exposed when `status === 'success'`. */ audioUrl?: string; audioDuration?: number; creditCharged: number; creditRefunded: number; errorMessage?: string; createdAt: number; updatedAt: number; } /** List items share the same shape as the detail response. */ type ListenHubVoiceTaskListItem = ListenHubVoiceTaskDetail; interface ListListenHubVoiceTasksParams { page?: number; pageSize?: number; status?: ListenHubVoiceTaskStatus; keyword?: string; } interface ListListenHubVoiceTasksResponse { items: ListenHubVoiceTaskListItem[]; page: number; pageSize: number; total: number; } //#endregion //#region src/types/voice-clone.d.ts /** * Voice cloning types for {@link ListenHubClient} (App/JWT surface). * * Source of truth: listenhub-api-server `src/controller/voice-clone.ts`. * The JWT surface and the API-key surface have different request and response * contracts. Do not share their endpoint types between the two clients. * * `/v1/voice-clone/chat` and `/v1/voice-clone/examples` back the interactive * web recording flow and are intentionally not part of the SDK surface. */ /** One reference audio file. */ type VoiceCloneAudioInput = Blob; /** Languages accepted by the voice-clone create endpoint. */ type VoiceCloneLanguage = 'en' | 'zh' | 'ja' | 'es' | 'pt' | 'fr' | 'de' | 'tr' | 'ko' | 'it' | 'th' | 'vi'; type VoiceCloneGender = 'male' | 'female' | 'other'; type VoiceCloneTaskStatus = 'pending' | 'processing' | 'completed' | 'failed'; interface CreateVoiceCloneParams { /** 1-6 reference audio files (single file max 5MB, total max 20MB). */ audioFiles: VoiceCloneAudioInput[]; /** Filenames sent with each file, positionally matched to `audioFiles`. */ audioFilenames?: string[]; language: VoiceCloneLanguage; } interface CreateVoiceCloneResponse { taskId: string; status: VoiceCloneTaskStatus; } /** * Poll result. A failed task raises a `ListenHubError` instead of returning * `status: 'failed'` — that is the JWT surface's behavior, and it differs from * the API-key surface, which returns the failure in the body. */ interface VoiceCloneTaskDetail { status: VoiceCloneTaskStatus; /** Preview of the temporary cloned voice, available once cloning completes. */ demoAudioUrl?: string; } interface ConfirmVoiceCloneParams { taskId: string; /** Max 50 chars. */ name: string; gender: VoiceCloneGender; /** Authorizes the 300-credit charge once the tier quota is used up. */ useCredits?: boolean; } /** A confirmed private speaker, as returned by the detail and update endpoints. */ interface VoiceCloneSpeaker { id: string; name: string; language: string; gender: string; demoAudioUrl?: string; createdAt: string; updatedAt: string; } /** List rows carry `speakerInnerId` (the id accepted by TTS endpoints) but no `updatedAt`. */ interface VoiceCloneSpeakerListItem { id: string; name: string; speakerInnerId: string; language: string; gender: string; demoAudioUrl?: string; createdAt: string; } interface ListVoiceCloneSpeakersResponse { speakers: VoiceCloneSpeakerListItem[]; /** Confirmations allowed per subscription period. */ quota: number; /** True once this period's confirmations are used up. */ isLimitReached: boolean; /** Maximum private speakers the tier may keep at once. */ maxSpeakers: number; remainingConfirmations: number; } interface UpdateVoiceCloneSpeakerParams { /** Max 50 chars. */ name?: string; gender?: VoiceCloneGender; } interface DeleteVoiceCloneSpeakerResponse { speakerId: string; } //#endregion //#region src/listenhub.d.ts declare class ListenHubClient { readonly api: KyInstance; constructor(options?: ClientOptions); refresh(params: { refreshToken: string; }): Promise; connectInit(params: { callbackPort: number; }): Promise; connectToken(params: { sessionId: string; code: string; }): Promise; revoke(params: { refreshToken: string; }): Promise; checkinSubmit(): Promise; checkinStatus(): Promise; getApiKey(): Promise; regenerateApiKey(): Promise; createPodcast(params: CreatePodcastParams): Promise; createTTS(params: CreateTTSParams): Promise; createExplainerVideo(params: CreateExplainerVideoParams): Promise; exportExplainerVideo(episodeId: string): Promise; createSlides(params: CreateSlidesParams): Promise; private listByProduct; listPodcasts(params?: ListEpisodesParams): Promise; listTTS(params?: ListEpisodesParams): Promise; listExplainerVideos(params?: ListEpisodesParams): Promise; listSlides(params?: ListEpisodesParams): Promise; getCreation(episodeId: string): Promise; /** * Batch-delete creations by id (`DELETE /v1/episodes`). Covers podcast / TTS / * storybook / slides / explainer episodes, and AI video: passing a video * episodeId also soft-deletes its video-generation task and refunds credits for * any in-progress task (for legacy videos without an episodeId, pass the task id). * Up to 100 ids per call. */ deleteCreations(params: DeleteEpisodesParams): Promise; getCurrentUser(): Promise; getSubscription(): Promise; getSettings(): Promise; listSpeakers(params?: ListSpeakersParams): Promise; /** Create a clone task from reference audio. Async — poll via {@link getVoiceCloneTask}. */ createVoiceClone(params: CreateVoiceCloneParams): Promise; /** Poll a clone task. Throws `ListenHubError` when cloning failed. */ getVoiceCloneTask(taskId: string): Promise; /** * Turn a completed task into a reusable private speaker. Free within the tier * quota; beyond it the server charges 300 credits and only when `useCredits` is set. */ confirmVoiceClone(params: ConfirmVoiceCloneParams): Promise; listVoiceCloneSpeakers(): Promise; getVoiceCloneSpeaker(speakerId: string): Promise; updateVoiceCloneSpeaker(speakerId: string, params: UpdateVoiceCloneSpeakerParams): Promise; /** Deleting frees one slot against the tier's `maxSpeakers`. */ deleteVoiceCloneSpeaker(speakerId: string): Promise; listAIImages(params?: ListAIImagesParams): Promise; getAIImage(imageId: string): Promise; createAIImage(params: CreateAIImageParams): Promise; /** * Batch-delete AI images by id (`DELETE /v1/images`). Soft-delete, owner-scoped; * unknown / already-deleted / non-owned ids are silently ignored. Up to 100 ids per call. */ deleteAIImages(params: DeleteAIImagesParams): Promise; /** * `POST /v1/banana/images`。与 `createAIImage` 打的是同一个后端的两条不同路由: * banana 侧参考图上限 14(vs 5),并多出 `batchId` / `isPublic`。 * 一次要出 n 张就发 n 个并行请求、带同一个 `batchId` —— 后端没有张数入参。 */ createBananaImage(params: CreateBananaImageParams): Promise; getBananaImage(imageId: string): Promise; listBananaImages(params?: ListBananaImagesParams): Promise; /** * Labnana 视频生成。入参与 `createVideoGeneration` 同一份 schema,差别只在路径: * 后端按 `/banana` 前缀把 application 判成 labnana,读侧据此只返回本产品线的任务。 */ createBananaVideoGeneration(params: CreateVideoGenerationParams): Promise; getBananaVideoGenerationTask(taskId: string): Promise; listBananaVideoGenerationTasks(params?: ListVideoGenerationTasksParams): Promise; estimateBananaVideoGenerationCredits(params: EstimateVideoGenerationCreditsParams): Promise; createMusicGenerate(params: CreateMusicGenerateParams): Promise; createMusicCover(params: CreateMusicCoverParams): Promise; createMusicExtend(params: CreateMusicExtendParams): Promise; getMusicTask(taskId: string): Promise; listMusicTasks(params?: ListMusicTasksParams): Promise; /** Remix an existing song with new lyrics (Mureka). Async — poll via getMusicTask. */ createMusicRemix(params: CreateMusicRemixParams): Promise; /** Generate a standalone instrumental (Mureka). prompt XOR referenceAudio. Async. */ createMusicInstrumental(params: CreateMusicInstrumentalParams): Promise; /** Generate music from an image or video (Mureka). image XOR video. Async. */ createMusicSoundtrack(params: CreateMusicSoundtrackParams): Promise; /** Generate a single instrument/vocal track (Mureka). audio XOR providerSongId. Async. */ createMusicTrack(params: CreateMusicTrackParams): Promise; /** Recognize lyrics (with timestamps) from audio (Mureka). Synchronous. */ recognizeMusic(params: RecognizeMusicParams): Promise; /** Analyze audio — description, tags, genres, instruments (Mureka). Synchronous. */ describeMusic(params: DescribeMusicParams): Promise; /** Separate audio into stems (Mureka). Synchronous — returns download URLs. */ stemMusic(params: StemMusicParams): Promise; createFileUpload(params: CreateFileUploadParams): Promise; uploadFile(params: UploadFileParams): Promise; getFileDownloadUrl(fileUrl: string): Promise; createLyrics(params: CreateLyricsParams): Promise; getLyricsTask(taskId: string): Promise; listLyricsTasks(params?: ListLyricsTasksParams): Promise; createVideoGeneration(params: CreateVideoGenerationParams): Promise; uploadVideoReferenceImage(params: UploadVideoReferenceImageParams): Promise; getVideoGenerationTask(taskId: string): Promise; listVideoGenerationTasks(params?: ListVideoGenerationTasksParams): Promise; estimateVideoGenerationCredits(params: EstimateVideoGenerationCreditsParams): Promise; createPixVerseVideoGeneration(params: CreatePixVerseVideoParams): Promise; estimatePixVerseVideoCredits(params: EstimatePixVerseVideoCreditsParams): Promise; createListenHubVoice(params: CreateListenHubVoiceParams): Promise; getListenHubVoiceTask(taskId: string): Promise; listListenHubVoiceTasks(params?: ListListenHubVoiceTasksParams): Promise; } //#endregion //#region src/domain-selection.d.ts /** * 非幂等请求碰到默认域不可达时抛这个。ky 默认会重试连接层失败的 POST,重试时选定域 * 已经切走,等于把这条请求又发去了另一个域——正是这里要禁止的重发。两个 client 的 * `shouldRetry` 靠这个类型把它挡掉。 */ declare class DomainSwitchedError extends TypeError { constructor(message: string, options: { cause: unknown; }); } //#endregion //#region src/domains.d.ts /** * 出厂 Base URL 的唯一事实源:域别名 → 各接口面的完整 Base URL。 * 换域只改这张表——`client.ts` 的默认 API 域、`openapi-client.ts` 的默认 OpenAPI 域、 * `domain-selection.ts` 的备选域表都从这里派生,下游 CLI 也直接读它, * 不再各自维护一份(issue #728)。 */ declare const DOMAIN_BASE_URLS: { readonly default: { readonly api: "https://api.listenhub.ai/api"; readonly openapi: "https://api.marswave.ai/openapi"; }; readonly app: { readonly api: "https://api.listenhub.app/api"; readonly openapi: "https://api.listenhub.app/openapi"; }; }; /** `LISTENHUB_DOMAIN` 可以填的短名,也是 `DOMAIN_BASE_URLS` 的键。 */ type DomainAlias = keyof typeof DOMAIN_BASE_URLS; //#endregion //#region src/types/openapi.d.ts interface OpenAPIClientOptions { /** OpenAPI Key (format: lh_sk__). Falls back to LISTENHUB_API_KEY env var. */ apiKey?: string; /** Base URL, defaults to https://api.marswave.ai/openapi. Override with LISTENHUB_OPENAPI_URL env var. */ baseURL?: string; timeout?: number; maxRetries?: number; } interface OpenAPICreateEpisodeResponse { episodeId: string; } interface OpenAPICreateTextContentResponse { episodeId: string; message: string; } interface OpenAPICreateFlowSpeechParams { sources: Array<{ type: 'text' | 'url'; content?: string; uri?: string; }>; speakers: Array<{ speakerId: string; }>; language?: string; mode?: 'smart' | 'direct'; /** Generation speed multiplier 0.5–2.0 (at most two decimals). Defaults to 1 (original speed); this is the speaking rate of the generated audio, not a player playback rate. */ speed?: number; } interface OpenAPICreateFlowSpeechTTSParams { scripts: Array<{ content: string; speakerId: string; }>; title?: string; /** Generation speed multiplier 0.5–2.0 (at most two decimals). Defaults to 1 (original speed); this is the speaking rate of the generated audio, not a player playback rate. */ speed?: number; } interface OpenAPIFlowSpeechDetail { episodeId: string; createdAt: number; processStatus: string; message?: string; failCode?: number; completedTime?: number; title?: string; outline?: string; cover?: string; audioUrl?: string; audioStreamUrl?: string; subtitlesUrl?: string; scripts?: string; sourceProcessResult?: { content: string; references?: Array<{ type: string; urlCitation?: { title: string; url: string; favicon: string; }; }>; }; } interface OpenAPICreatePodcastParams { query?: string; sources?: Array<{ type: 'text' | 'url'; content: string; }>; speakers: Array<{ speakerId: string; }>; language?: string; mode?: string; /** Generation speed multiplier 0.5–2.0 (at most two decimals). Defaults to 1 (original speed); this is the speaking rate of the generated audio, not a player playback rate. */ speed?: number; } interface OpenAPIPodcastDetail { episodeId: string; createdAt: number; processStatus: string; contentStatus?: string; message?: string; failCode?: number; completedTime?: number; credits?: number; title?: string; outline?: string; cover?: string; audioUrl?: string; audioStreamUrl?: string; subtitlesUrl?: string; scripts?: Array<{ speakerId: string; speakerName: string; content: string; }>; sourceProcessResult?: { content: string; references?: Array<{ type: string; urlCitation?: { title: string; url: string; favicon: string; }; }>; }; } interface OpenAPIGenerateAudioParams { scripts?: Array<{ content: string; speakerId: string; }>; /** Generation speed multiplier 0.5–2.0 (at most two decimals). Defaults to 1 (original speed); this is the speaking rate of the generated audio, not a player playback rate. */ speed?: number; } interface OpenAPIGenerateAudioResponse { success: boolean; message: string; episodeId: string; status: string; } interface OpenAPISpeechParams { scripts: Array<{ content: string; speakerId: string; }>; /** Generation speed multiplier 0.5–2.0 (at most two decimals). Defaults to 1 (original speed); this is the speaking rate of the generated audio, not a player playback rate. */ speed?: number; } interface OpenAPISpeechResponse { audioUrl: string; audioDuration: number; subtitlesUrl?: string; taskId: string; credits: number; } interface OpenAPITTSParams { input: string; voice: string; response_format?: 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm'; /** Generation speed multiplier 0.5–2.0 (at most two decimals). Defaults to 1 (original speed); this is the speaking rate of the generated audio, not a player playback rate. */ speed?: number; } interface OpenAPICreateStorybookParams { sources: Array<{ type: 'text' | 'url'; content: string; }>; speakers?: Array<{ speakerId: string; }>; skipAudio?: boolean; style?: string; language?: string; mode?: 'info' | 'story' | 'slides'; } interface OpenAPIStorybookDetail { episodeId: string; createdAt: number; mode: string; processStatus: string; message?: string; failCode?: number; completedTime?: number; credits?: number; title?: string; cover?: string; audioUrl?: string; audioDuration?: number; videoUrl?: string; videoStatus?: 'not_generated' | 'pending' | 'success' | 'fail'; pages?: Array<{ text: string; pageNumber: number; imageUrl: string; audioTimestamp: number; }>; sourceProcessResult?: { query: string; content: string; imageSources?: string[]; }; } interface OpenAPIImageReferenceFileData { fileUri: string; mimeType: string; } interface OpenAPIImageReferenceInlineData { data: string; mimeType: string; } interface OpenAPICreateImageParams { provider: string; model?: string; prompt: string; referenceImages?: Array<{ fileData?: OpenAPIImageReferenceFileData; inlineData?: OpenAPIImageReferenceInlineData; }>; imageConfig?: { imageSize?: '1K' | '2K' | '4K'; aspectRatio?: '16:9' | '4:3' | '1:1' | '3:4' | '9:16' | '21:9'; }; } type OpenAPICreateImageResponse = Record; type OpenAPIVideoGenerationTaskStatus = 'pending' | 'generating' | 'uploading' | 'success' | 'failed'; interface OpenAPIVideoReferenceImageMeta { role: 'first_frame' | 'last_frame' | 'reference_image'; width: number; height: number; size?: number; } interface OpenAPIVideoReferenceVideoMeta { role: 'reference_video'; width: number; height: number; duration?: number; fps?: number; size?: number; } interface OpenAPICreateVideoGenerationParams { model?: 'doubao-seedance-2-pro' | 'doubao-seedance-2-fast' | 'happyhorse'; content: Array<{ type: 'text'; text: string; } | { type: 'image_url'; image_url: { url: string; width?: number; height?: number; size?: number; }; role: 'first_frame' | 'last_frame' | 'reference_image'; } | { type: 'video_url'; video_url: { url: string; width?: number; height?: number; duration?: number; fps?: number; size?: number; }; role: 'reference_video'; } | { type: 'audio_url'; audio_url: { url: string; }; role: 'reference_audio'; }>; resolution?: '480p' | '720p' | '1080p'; ratio?: '16:9' | '4:3' | '1:1' | '3:4' | '9:16' | '21:9' | '4:5' | '5:4'; duration?: number; generateAudio?: boolean; seed?: number; inputVideoDuration?: number; referenceImages?: OpenAPIVideoReferenceImageMeta[]; referenceVideos?: OpenAPIVideoReferenceVideoMeta[]; /** Audio handling for happyhorse video-edit mode. Only effective when model is 'happyhorse' and content includes a video_url. */ audioSetting?: 'auto' | 'origin'; } interface OpenAPICreateVideoGenerationResponse { taskId: string; status: OpenAPIVideoGenerationTaskStatus; } interface OpenAPIVideoGenerationTaskDetail { id: string; status: OpenAPIVideoGenerationTaskStatus; model: string; params: { content: OpenAPICreateVideoGenerationParams['content']; resolution: string; ratio: string; duration: number; generateAudio: boolean; seed: number; referenceImages?: OpenAPIVideoReferenceImageMeta[]; referenceVideos?: OpenAPIVideoReferenceVideoMeta[]; }; videoUrl?: string; providerVideoUrl?: string; duration?: number; resolution?: string; ratio?: string; seed?: number; creditCharged: number; createdAt: number; updatedAt: number; } interface OpenAPIListVideoGenerationTasksParams { page?: number; pageSize?: number; status?: OpenAPIVideoGenerationTaskStatus; } interface OpenAPIListVideoGenerationTasksResponse { items: Array<{ id: string; status: OpenAPIVideoGenerationTaskStatus; model: string; params: { resolution: string; ratio: string; duration: number; }; videoUrl?: string; providerVideoUrl?: string; seed?: number; creditCharged: number; createdAt: number; }>; page: number; pageSize: number; total: number; } interface OpenAPIEstimateVideoCreditsParams { model: 'doubao-seedance-2-pro' | 'doubao-seedance-2-fast' | 'happyhorse'; resolution: '480p' | '720p' | '1080p'; duration: number; hasVideoInput?: boolean; inputVideoDuration?: number; referenceImages?: OpenAPIVideoReferenceImageMeta[]; referenceVideos?: OpenAPIVideoReferenceVideoMeta[]; ratio?: '16:9' | '4:3' | '1:1' | '3:4' | '9:16' | '21:9' | '4:5' | '5:4'; } interface OpenAPIEstimateVideoCreditsResponse { tokens: number; credits: number; } type OpenAPIListenHubVoiceTaskStatus = 'pending' | 'generating' | 'uploading' | 'success' | 'failed'; interface OpenAPICreateListenHubVoiceParams { model?: 'listenhub-voice-1.0'; /** Required, trimmed, max 1400 chars. */ text: string; /** 1-3 items; multi-voice (>1) requires reference voices; mutually exclusive with `image`. */ voices?: Array<{ type: 'speaker'; id: string; } | { type: 'reference'; url: string; }>; /** Exactly one of `url`/`data`; mutually exclusive with `voices`. */ image?: { url?: string; data?: string; }; audioConfig?: { speechRate?: number; loudnessRate?: number; pitchRate?: number; format?: 'mp3' | 'wav' | 'pcm' | 'ogg_opus'; }; /** Range [1, 110]. */ durationHint?: number; watermark?: boolean; } interface OpenAPICreateListenHubVoiceResponse { taskId: string; status: OpenAPIListenHubVoiceTaskStatus; } interface OpenAPIListenHubVoiceTaskDetail { id: string; status: OpenAPIListenHubVoiceTaskStatus; model: string; params: { text: string; voices?: Array<{ type: 'speaker'; id: string; } | { type: 'reference'; url: string; }>; /** Sanitized: never contains base64 `data`. */ image?: { url?: string; hasData?: boolean; thumbnailUrl?: string; }; audioConfig?: { speechRate?: number; loudnessRate?: number; pitchRate?: number; format?: 'mp3' | 'wav' | 'pcm' | 'ogg_opus'; }; durationHint?: number; watermark?: boolean; }; /** Only exposed when `status === 'success'`. */ audioUrl?: string; audioDuration?: number; creditCharged: number; creditRefunded: number; errorMessage?: string; createdAt: number; updatedAt: number; } interface OpenAPIListListenHubVoiceTasksParams { page?: number; pageSize?: number; status?: OpenAPIListenHubVoiceTaskStatus; keyword?: string; } interface OpenAPIListListenHubVoiceTasksResponse { items: OpenAPIListenHubVoiceTaskDetail[]; page: number; pageSize: number; total: number; } type OpenAPIPixVerseModel = 'pixverse' | 'v6' | 'v5' | 'v4.5'; type OpenAPIPixVerseLanguage = 'zh' | 'en'; type OpenAPIPixVerseCapability = 'text_to_video' | 'image_to_video' | 'transition' | 'multi_transition' | 'fusion' | 'restyle' | 'mimic' | 'lip_sync' | 'agent'; type OpenAPIPixVerseQuality = '360p' | '540p' | '720p' | '1080p'; type OpenAPIPixVerseAspectRatio = '9:16' | '16:9' | '1:1' | '4:3' | '3:4'; type OpenAPIPixVerseAgentType = 'ad_master' | 'promo_mix'; interface OpenAPIPixVerseAsset { url: string; duration?: number; } interface OpenAPIPixVerseOptions { agentType?: OpenAPIPixVerseAgentType; motionMode?: string; cameraMovement?: string; templateId?: string | number; sourceVideoId?: string | number; restyleId?: string | number; multiTransition?: Array<{ imageUrl: string; duration: number; prompt: string; }>; imageReferences?: Array<{ type: 'subject' | 'background'; imageUrl: string; refName: string; }>; tts?: { speakerId: string; content: string; }; soundEffectSwitch?: boolean; soundEffectContent?: string; lipSyncTtsSwitch?: boolean; lipSyncTtsSpeakerId?: string; lipSyncTtsContent?: string; brandSticker?: { imageUrl: string; position: 'up' | 'down' | 'left' | 'right' | 'upper_left' | 'lower_left' | 'upper_right' | 'lower_right'; }; introOutroClip?: { videoUrl: string; position: 'start' | 'end'; }; } interface OpenAPICreatePixVerseVideoParams { capability: OpenAPIPixVerseCapability; model?: OpenAPIPixVerseModel; language?: OpenAPIPixVerseLanguage; prompt?: string; duration?: number; aspectRatio?: OpenAPIPixVerseAspectRatio; quality?: OpenAPIPixVerseQuality; sourceTaskId?: string; images?: OpenAPIPixVerseAsset[]; videos?: OpenAPIPixVerseAsset[]; audios?: OpenAPIPixVerseAsset[]; pixverse?: OpenAPIPixVerseOptions; } interface OpenAPICreatePixVerseVideoResponse { taskId: string; episodeId?: string; status: 'generating'; } interface OpenAPIEstimatePixVerseCreditsParams { capability: OpenAPIPixVerseCapability; model?: OpenAPIPixVerseModel; language?: OpenAPIPixVerseLanguage; duration?: number; quality?: OpenAPIPixVerseQuality; pixverse?: { agentType?: OpenAPIPixVerseAgentType; soundEffectSwitch?: boolean; lipSyncTtsSwitch?: boolean; sourceDuration?: number; inputAudioDuration?: number; multiTransition?: Array<{ duration: number; }>; tts?: { content: string; }; }; } interface OpenAPICreateContentExtractParams { source: { type: 'url'; uri: string; }; options?: { summarize?: boolean; maxLength?: number; twitter?: { count?: number; }; }; } interface OpenAPIContentExtractDetail { taskId: string; status: 'processing' | 'completed' | 'failed'; createdAt?: number; data?: { content?: string; metadata?: Record; references?: unknown[]; }; credits?: number; failCode?: number; message?: string; } interface OpenAPISubscriptionInfo { totalAvailableCredits: number; subscriptionStartedAt?: number; subscriptionExpiresAt?: number; usageAvailableMonthlyCredits?: number; usageTotalMonthlyCredits?: number; usageAvailablePermanentCredits?: number; usageTotalPermanentCredits?: number; usageAvailableLimitedTimeCredits?: number; resetAt?: number; platform?: string; renewStatus?: boolean; paidStatus?: boolean; subscriptionPlan?: { name?: string; duration?: string; platform?: string; }; } interface OpenAPISpeaker { name: string; speakerId: string; demoAudioUrl: string; gender: string; language: string; profile?: { pitch?: string[]; speed?: string[]; traits?: string[]; styles?: string[]; scenes?: string[]; accent?: string; description?: string; descriptionLocalized?: Record; }; } interface OpenAPIListSpeakersParams { language?: string; status?: number; } interface OpenAPIListSpeakersResponse { items: OpenAPISpeaker[]; } /** Languages accepted by the voice-clone create endpoint. */ type OpenAPIVoiceCloneLanguage = 'en' | 'zh' | 'ja' | 'es' | 'pt' | 'fr' | 'de' | 'tr' | 'ko' | 'it' | 'th' | 'vi'; type OpenAPIVoiceCloneGender = 'male' | 'female' | 'other'; type OpenAPIVoiceCloneTaskStatus = 'pending' | 'processing' | 'completed' | 'failed'; interface OpenAPICreateVoiceCloneParams { /** 1-6 reference audio files (single file max 5MB, total max 20MB). */ audioFiles: Blob[]; /** Filenames sent with each file, positionally matched to `audioFiles`. */ audioFilenames?: string[]; language: OpenAPIVoiceCloneLanguage; /** Declares the caller holds the cloned person's consent. Rejected unless `true`; stored as evidence. */ consentConfirmed: true; /** Confirm the voice inside the poll that finds the task completed, instead of a second call. */ autoConfirm?: boolean; /** Required when `autoConfirm` is true. Max 50 chars. */ name?: string; /** Required when `autoConfirm` is true. */ gender?: OpenAPIVoiceCloneGender; /** Authorizes the 300-credit charge once the tier quota is used up. */ useCredits?: boolean; } interface OpenAPICreateVoiceCloneResponse { taskId: string; status: OpenAPIVoiceCloneTaskStatus; } /** * Poll result. Three terminal shapes the caller must tell apart: * - cloning failed → `status: 'failed'` with `errorCode` / `errorMessage` * - cloned, not confirmed → `demoAudioUrl` (plus `confirmError` when auto-confirm failed) * - confirmed → `speakerId`, usable on `/v1/speech`, `/v1/tts` and `/v1/audio/speech` */ interface OpenAPIVoiceCloneTaskDetail { status: OpenAPIVoiceCloneTaskStatus; errorCode?: number; errorMessage?: string; demoAudioUrl?: string; speakerId?: string; confirmError?: string; } interface OpenAPIConfirmVoiceCloneParams { taskId: string; /** Max 50 chars. */ name: string; gender: OpenAPIVoiceCloneGender; /** Authorizes the 300-credit charge once the tier quota is used up. */ useCredits?: boolean; } interface OpenAPIConfirmVoiceCloneResponse { speakerId: string; } interface OpenAPIVoiceCloneSpeaker { id: string; /** The id accepted by the TTS endpoints. */ speakerInnerId: string; name: string; language: string; gender: string; demoAudioUrl?: string; createdAt: string; updatedAt: string; } /** List rows carry `speakerInnerId` but no `updatedAt`. */ interface OpenAPIVoiceCloneSpeakerListItem { id: string; name: string; speakerInnerId: string; language: string; gender: string; demoAudioUrl?: string; createdAt: string; } interface OpenAPIListVoiceCloneSpeakersResponse { speakers: OpenAPIVoiceCloneSpeakerListItem[]; /** Confirmations allowed per subscription period. */ quota: number; isLimitReached: boolean; /** Maximum private speakers the tier may keep at once. */ maxSpeakers: number; remainingConfirmations: number; } interface OpenAPIUpdateVoiceCloneSpeakerParams { /** Max 50 chars. */ name?: string; gender?: OpenAPIVoiceCloneGender; } interface OpenAPIDeleteVoiceCloneSpeakerResponse { speakerId: string; } //#endregion //#region src/openapi-client.d.ts declare class OpenAPIClient { private api; constructor(opts?: OpenAPIClientOptions); listSpeakers(params?: OpenAPIListSpeakersParams): Promise; createFlowSpeech(params: OpenAPICreateFlowSpeechParams): Promise; getFlowSpeech(episodeId: string): Promise; getFlowSpeechTextStream(episodeId: string, event: 'script' | 'outline'): Promise; createFlowSpeechTTS(params: OpenAPICreateFlowSpeechTTSParams): Promise; createPodcast(params: OpenAPICreatePodcastParams): Promise; getPodcast(episodeId: string): Promise; getPodcastTextStream(episodeId: string, event: 'script' | 'outline'): Promise; createPodcastTextContent(params: OpenAPICreatePodcastParams): Promise; generatePodcastAudio(episodeId: string, params?: OpenAPIGenerateAudioParams): Promise; speech(params: OpenAPISpeechParams): Promise; tts(params: OpenAPITTSParams): Promise; audioSpeech(params: OpenAPITTSParams): Promise; createStorybook(params: OpenAPICreateStorybookParams): Promise; getStorybook(episodeId: string): Promise; generateStorybookVideo(episodeId: string): Promise<{ success: boolean; }>; createImage(params: OpenAPICreateImageParams): Promise; createFileUpload(params: CreateFileUploadParams): Promise; uploadFile(params: UploadFileParams): Promise; createVideoGeneration(params: OpenAPICreateVideoGenerationParams): Promise; uploadVideoReferenceImage(params: UploadVideoReferenceImageParams): Promise; getVideoGenerationTask(taskId: string): Promise; listVideoGenerationTasks(params?: OpenAPIListVideoGenerationTasksParams): Promise; estimateVideoCredits(params: OpenAPIEstimateVideoCreditsParams): Promise; createPixVerseVideoGeneration(params: OpenAPICreatePixVerseVideoParams): Promise; estimatePixVerseVideoCredits(params: OpenAPIEstimatePixVerseCreditsParams): Promise; createListenHubVoice(params: OpenAPICreateListenHubVoiceParams): Promise; getListenHubVoiceTask(taskId: string): Promise; listListenHubVoiceTasks(params?: OpenAPIListListenHubVoiceTasksParams): Promise; /** Create a clone task from reference audio. Async — poll via {@link getVoiceCloneTask}. */ createVoiceClone(params: OpenAPICreateVoiceCloneParams): Promise; /** * Poll a clone task. With `autoConfirm`, the poll that first sees the task * completed also confirms it — and charges — so read the three terminal shapes * of {@link OpenAPIVoiceCloneTaskDetail} rather than assuming success. * A concurrent confirmation for the same user answers 429, an unavailable * dependency 503; both are retryable and honor `Retry-After`. */ getVoiceCloneTask(taskId: string): Promise; /** * Turn a completed task into a reusable private speaker. Free within the tier * quota; beyond it the server charges 300 credits and only when `useCredits` is set. */ confirmVoiceClone(params: OpenAPIConfirmVoiceCloneParams): Promise; listVoiceCloneSpeakers(): Promise; getVoiceCloneSpeaker(speakerId: string): Promise; updateVoiceCloneSpeaker(speakerId: string, params: OpenAPIUpdateVoiceCloneSpeakerParams): Promise; /** Deleting frees one slot against the tier's `maxSpeakers`. */ deleteVoiceCloneSpeaker(speakerId: string): Promise; createContentExtract(params: OpenAPICreateContentExtractParams): Promise<{ taskId: string; }>; getContentExtract(taskId: string): Promise; getSubscription(): Promise; createMusicGenerate(params: CreateMusicGenerateParams): Promise; /** @deprecated Cover is pinned to the legacy Suno provider; prefer createMusicRemix. */ createMusicCover(params: CreateMusicCoverParams): Promise; createMusicExtend(params: CreateMusicExtendParams): Promise; getMusicTask(taskId: string): Promise; listMusicTasks(params?: ListMusicTasksParams): Promise; /** Remix an existing song with new lyrics (Mureka). Async — poll via getMusicTask. */ createMusicRemix(params: CreateMusicRemixParams): Promise; /** Generate a standalone instrumental (Mureka). prompt XOR referenceAudio. Async. */ createMusicInstrumental(params: CreateMusicInstrumentalParams): Promise; /** Generate music from an image or video (Mureka). image XOR video. Async. */ createMusicSoundtrack(params: CreateMusicSoundtrackParams): Promise; /** Generate a single instrument/vocal track (Mureka). audio XOR providerSongId. Async. */ createMusicTrack(params: CreateMusicTrackParams): Promise; /** Recognize lyrics (with timestamps) from audio (Mureka). Synchronous. */ recognizeMusic(params: RecognizeMusicParams): Promise; /** Analyze audio — description, tags, genres, instruments (Mureka). Synchronous. */ describeMusic(params: DescribeMusicParams): Promise; /** Separate audio into stems (Mureka). Synchronous — returns download URLs. */ stemMusic(params: StemMusicParams): Promise; } //#endregion export { ACCEPTED_IMAGE_MODELS, type AIImageAspectRatio, type AIImageItem, type AIImageSize, type ApiKeyResponse, type BananaImageCreator, type BananaImageItem, type BananaImageQuality, type BananaImageScope, type BananaReferenceImageBase64, type BananaReferenceImageDimension, type CheckinResponse, type CheckinStatusResponse, type ClientOptions, type ConfirmVoiceCloneParams, type ConnectInitResponse, type ContentSource, type CreateAIImageParams, type CreateAIImageResponse, type CreateBananaImageParams, type CreateBananaImageResponse, type CreateEpisodeResponse, type CreateExplainerVideoParams, type CreateFileUploadParams, type CreateFileUploadResponse, type CreateListenHubVoiceParams, type CreateListenHubVoiceResponse, type CreateLyricsParams, type CreateLyricsTaskResponse, type CreateMusicCoverParams, type CreateMusicExtendParams, type CreateMusicGenerateParams, type CreateMusicInstrumentalParams, type CreateMusicRemixParams, type CreateMusicSoundtrackParams, type CreateMusicTaskResponse, type CreateMusicTrackParams, type CreatePixVerseVideoParams, type CreatePixVerseVideoResponse, type CreatePodcastParams, type CreateSlidesParams, type CreateTTSParams, type CreateVideoGenerationParams, type CreateVideoGenerationResponse, type CreateVoiceCloneParams, type CreateVoiceCloneResponse, DOMAIN_BASE_URLS, type DeleteAIImagesParams, type DeleteEpisodesParams, type DeleteVoiceCloneSpeakerResponse, type DescribeMusicParams, type DescribeMusicResponse, type DomainAlias, DomainSwitchedError, type EpisodeCreator, type EpisodeDetail, type EpisodeDetailAudio, type EpisodeDetailPage, type EpisodeDetailPreprocess, type EpisodeDetailReference, type EpisodeDetailScript, type EpisodeDetailSeoMeta, type EpisodeDetailTopicData, type EpisodeDetailVideo, type EpisodeImageConfig, type EpisodeInput, type EpisodeItem, type EpisodeSpeaker, type EstimatePixVerseVideoCreditsParams, type EstimatePixVerseVideoCreditsResponse, type EstimateVideoGenerationCreditsParams, type EstimateVideoGenerationCreditsResponse, type GetFileDownloadUrlResponse, IMAGE_MODELS, type ImageModel, type ImagePromptLanguage, type ImageSize, LEGACY_IMAGE_MODEL_ALIASES, type Language, type ListAIImagesParams, type ListAIImagesResponse, type ListBananaImagesParams, type ListBananaImagesResponse, type ListEpisodesParams, type ListEpisodesResponse, type ListListenHubVoiceTasksParams, type ListListenHubVoiceTasksResponse, type ListLyricsTasksParams, type ListLyricsTasksResponse, type ListMusicTasksParams, type ListMusicTasksResponse, type ListSpeakersParams, type ListSpeakersResponse, type ListVideoGenerationTasksParams, type ListVideoGenerationTasksResponse, type ListVoiceCloneSpeakersResponse, ListenHubClient, ListenHubError, type ListenHubVoiceConfig, type ListenHubVoiceFormat, type ListenHubVoiceImageInput, type ListenHubVoiceImageResponse, type ListenHubVoiceModel, type ListenHubVoiceTaskDetail, type ListenHubVoiceTaskListItem, type ListenHubVoiceTaskStatus, type ListenHubVoiceVoice, type LyricsTaskDetail, type LyricsTaskStatus, type LyricsVariant, type MusicFileInput, type MusicGenerateType, type MusicModel, type MusicTaskDetail, type MusicTaskStatus, type MusicTaskType, type MusicTrack, OpenAPIClient, type OpenAPIClientOptions, type OpenAPIConfirmVoiceCloneParams, type OpenAPIConfirmVoiceCloneResponse, type OpenAPIContentExtractDetail, type OpenAPICreateContentExtractParams, type OpenAPICreateEpisodeResponse, type OpenAPICreateFlowSpeechParams, type OpenAPICreateFlowSpeechTTSParams, type OpenAPICreateImageParams, type OpenAPICreateImageResponse, type OpenAPICreateListenHubVoiceParams, type OpenAPICreateListenHubVoiceResponse, type OpenAPICreatePixVerseVideoParams, type OpenAPICreatePixVerseVideoResponse, type OpenAPICreatePodcastParams, type OpenAPICreateStorybookParams, type OpenAPICreateTextContentResponse, type OpenAPICreateVideoGenerationParams, type OpenAPICreateVideoGenerationResponse, type OpenAPICreateVoiceCloneParams, type OpenAPICreateVoiceCloneResponse, type OpenAPIDeleteVoiceCloneSpeakerResponse, type OpenAPIEstimatePixVerseCreditsParams, type OpenAPIEstimateVideoCreditsParams, type OpenAPIEstimateVideoCreditsResponse, type OpenAPIFlowSpeechDetail, type OpenAPIGenerateAudioParams, type OpenAPIGenerateAudioResponse, type OpenAPIImageReferenceFileData, type OpenAPIImageReferenceInlineData, type OpenAPIListListenHubVoiceTasksParams, type OpenAPIListListenHubVoiceTasksResponse, type OpenAPIListSpeakersParams, type OpenAPIListSpeakersResponse, type OpenAPIListVideoGenerationTasksParams, type OpenAPIListVideoGenerationTasksResponse, type OpenAPIListVoiceCloneSpeakersResponse, type OpenAPIListenHubVoiceTaskDetail, type OpenAPIListenHubVoiceTaskStatus, type OpenAPIPixVerseAgentType, type OpenAPIPixVerseAspectRatio, type OpenAPIPixVerseAsset, type OpenAPIPixVerseCapability, type OpenAPIPixVerseLanguage, type OpenAPIPixVerseModel, type OpenAPIPixVerseOptions, type OpenAPIPixVerseQuality, type OpenAPIPodcastDetail, type OpenAPISpeaker, type OpenAPISpeechParams, type OpenAPISpeechResponse, type OpenAPIStorybookDetail, type OpenAPISubscriptionInfo, type OpenAPITTSParams, type OpenAPIUpdateVoiceCloneSpeakerParams, type OpenAPIVideoGenerationTaskDetail, type OpenAPIVideoGenerationTaskStatus, type OpenAPIVideoReferenceImageMeta, type OpenAPIVideoReferenceVideoMeta, type OpenAPIVoiceCloneGender, type OpenAPIVoiceCloneLanguage, type OpenAPIVoiceCloneSpeaker, type OpenAPIVoiceCloneSpeakerListItem, type OpenAPIVoiceCloneTaskDetail, type OpenAPIVoiceCloneTaskStatus, type PixVerseAgentType, type PixVerseAspectRatio, type PixVerseAsset, type PixVerseBrandSticker, type PixVerseBrandStickerPosition, type PixVerseCapability, type PixVerseImageReference, type PixVerseImageReferenceType, type PixVerseIntroOutroClip, type PixVerseIntroOutroPosition, type PixVerseLanguage, type PixVerseModel, type PixVerseMultiTransitionItem, type PixVerseOptions, type PixVerseQuality, type PixVerseTts, type ProcessStatus, type ProductId, type RecognizeMusicParams, type RecognizeMusicResponse, type SettingsItem, type SettingsResponse, type SettingsSpeaker, type SlideAspectRatio, type Speaker, type StemMusicParams, type StemMusicResponse, type StoredCredentials, type StyleImage, type SubscriptionInfo, type SubscriptionPlan, type TokenResponse, type UpdateVoiceCloneSpeakerParams, type UploadFileData, type UploadFileParams, type UploadVideoReferenceImageParams, type UploadedVideoReferenceImage, type UrlSourceMetadata, type UserProfile, type VideoContentAudioUrl, type VideoContentImageUrl, type VideoContentItem, type VideoContentRole, type VideoContentText, type VideoContentVideoUrl, type VideoGenerationErrorCode, type VideoGenerationModel, type VideoGenerationRatio, type VideoGenerationResolution, type VideoGenerationTaskDetail, type VideoGenerationTaskListItem, type VideoGenerationTaskStatus, type VideoReferenceImageMeta, type VideoReferenceVideoMeta, type VoiceCloneAudioInput, type VoiceCloneGender, type VoiceCloneLanguage, type VoiceCloneSpeaker, type VoiceCloneSpeakerListItem, type VoiceCloneTaskDetail, type VoiceCloneTaskStatus };