@acedatacloud/sdk 2026.718.1 → 2026.727.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Localization (localization) — generated from the platform OpenAPI spec.
3
+ *
4
+ * Do not edit by hand: run `python scripts/generate_providers.py`. Parameter
5
+ * names, types, enums and required-ness all come from the live spec.
6
+ */
7
+
8
+ import { Transport } from '../../runtime/transport';
9
+
10
+
11
+ export interface LocalizationTranslateOptions {
12
+ /** Please provide the content that needs to be translated. */
13
+ input: Record<string, unknown>;
14
+ /** The target language area to be translated to. */
15
+ locale: "en" | "de" | "pt" | "es" | "fr" | "zh-CN" | "zh-TW" | "it" | "ko" | "ja" | "ru" | "pl" | "fi" | "sv" | "el" | "uk" | "ar" | "sr";
16
+ /** The file type of the input text (such as `json` or `md`). */
17
+ extension: "json" | "md";
18
+ /** The large language model used for translation is `gpt-3.5` by default. */
19
+ model?: "gpt-3.5" | "gpt-4";
20
+ callbackUrl?: string;
21
+ /** Any parameter added upstream before the SDK is regenerated. */
22
+ [key: string]: unknown;
23
+ }
24
+
25
+ /** localization client. */
26
+ export class Localization {
27
+ constructor(private transport: Transport) {}
28
+
29
+ /** Translate a JSON input into any localized file */
30
+ async translate(options: LocalizationTranslateOptions): Promise<Record<string, unknown>> {
31
+ const body: Record<string, unknown> = {};
32
+ body["input"] = options.input;
33
+ body["locale"] = options.locale;
34
+ body["extension"] = options.extension;
35
+ if (options.model !== undefined) body["model"] = options.model;
36
+ for (const [key, value] of Object.entries(options)) {
37
+ if (!["async", "callbackUrl", "extension", "input", "locale", "maxWait", "model", "pollInterval", "wait"].includes(key) && value !== undefined) {
38
+ body[key] = value;
39
+ }
40
+ }
41
+ if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
42
+ return (await this.transport.request('POST', "/localization/translate", { json: body })) as Record<string, unknown>;
43
+ }
44
+
45
+ }
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Luma (luma) — generated from the platform OpenAPI spec.
3
+ *
4
+ * Do not edit by hand: run `python scripts/generate_providers.py`. Parameter
5
+ * names, types, enums and required-ness all come from the live spec.
6
+ */
7
+
8
+ import { Transport } from '../../runtime/transport';
9
+ import { TaskHandle } from '../../runtime/tasks';
10
+
11
+
12
+ function taskId(result: Record<string, unknown>): string {
13
+ if (typeof result?.task_id === 'string') return result.task_id;
14
+ const data = result?.data as Record<string, unknown> | undefined;
15
+ if (data && typeof data.task_id === 'string') return data.task_id;
16
+ return typeof result?.id === 'string' ? result.id : '';
17
+ }
18
+
19
+ export interface LumaGenerateOptions {
20
+ /** Whether to enable loop playback for the generated video. */
21
+ loop?: boolean;
22
+ /** Operation type. Use `generate` when creating a video for the first time, and use `extend` when continuing an existing video. */
23
+ action?: "generate" | "extend";
24
+ /** Text prompts for generating videos. */
25
+ prompt?: string;
26
+ /** The timeout for the API return data (unit: seconds). */
27
+ timeout?: number;
28
+ /** The unique identifier of the generated video used for the continuation operation (`extend`). If both are specified, `video_id` takes precedence over `video_url`. */
29
+ videoId?: string;
30
+ /** The original video URL used for the extend operation (`extend`). If `video_id` is specified at the same time, then `video_id` shall prevail. */
31
+ videoUrl?: string;
32
+ /** Whether to enable automatic optimization enhancement for the input prompt text, suitable for use when unsure how to write prompt words. */
33
+ enhancement?: boolean;
34
+ /** Generate the aspect ratio of the video, for example `16:9`. */
35
+ aspectRatio?: string;
36
+ /** The URL of the ending frame image, which will be used as the last frame of the generated video. */
37
+ endImageUrl?: string;
38
+ /** The URL of the starting frame image, which will be used as the first frame of the generated video. */
39
+ startImageUrl?: string;
40
+ /** Submit asynchronously and poll. Defaults to true. */
41
+ async?: boolean;
42
+ /** Wait for completion before returning the handle. */
43
+ wait?: boolean;
44
+ pollInterval?: number;
45
+ maxWait?: number;
46
+ callbackUrl?: string;
47
+ /** Any parameter added upstream before the SDK is regenerated. */
48
+ [key: string]: unknown;
49
+ }
50
+
51
+ /** luma client. */
52
+ export class Luma {
53
+ constructor(private transport: Transport) {}
54
+
55
+ /** Generate videos based on prompt and image frames */
56
+ async generate(options: LumaGenerateOptions = {}): Promise<TaskHandle> {
57
+ const body: Record<string, unknown> = {};
58
+ body["loop"] = options.loop ?? false;
59
+ body["action"] = options.action ?? "generate";
60
+ body["prompt"] = options.prompt ?? "Astronauts shuttle from space to volcano";
61
+ body["timeout"] = options.timeout ?? 300;
62
+ if (options.videoId !== undefined) body["video_id"] = options.videoId;
63
+ if (options.videoUrl !== undefined) body["video_url"] = options.videoUrl;
64
+ body["enhancement"] = options.enhancement ?? true;
65
+ if (options.aspectRatio !== undefined) body["aspect_ratio"] = options.aspectRatio;
66
+ body["end_image_url"] = options.endImageUrl ?? "https://cdn.acedata.cloud/0iad3k.png";
67
+ body["start_image_url"] = options.startImageUrl ?? "https://cdn.acedata.cloud/r9vsv9.png";
68
+ for (const [key, value] of Object.entries(options)) {
69
+ if (!["action", "aspectRatio", "async", "callbackUrl", "endImageUrl", "enhancement", "loop", "maxWait", "pollInterval", "prompt", "startImageUrl", "timeout", "videoId", "videoUrl", "wait"].includes(key) && value !== undefined) {
70
+ body[key] = value;
71
+ }
72
+ }
73
+ if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
74
+ body.async = options.async ?? true;
75
+ const result = (await this.transport.request('POST', "/luma/videos", { json: body })) as Record<string, unknown>;
76
+ const handle = new TaskHandle(taskId(result), "/luma/tasks", this.transport, result);
77
+ if (options.wait) {
78
+ await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
79
+ }
80
+ return handle;
81
+ }
82
+
83
+ }
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Maestro (maestro) — generated from the platform OpenAPI spec.
3
+ *
4
+ * Do not edit by hand: run `python scripts/generate_providers.py`. Parameter
5
+ * names, types, enums and required-ness all come from the live spec.
6
+ */
7
+
8
+ import { Transport } from '../../runtime/transport';
9
+
10
+
11
+ export interface MaestroGenerateOptions {
12
+ /** Natural-language brief describing the video to produce (the topic, what to show, tone, audience). The agent decides the script, visuals, voiceover and edit. */
13
+ prompt: string;
14
+ /** Output languages, e.g. ["zh-cn", "en"]. The first is the primary language; each additional one reuses the visuals with a localized voiceover + render and is billed +6 credits. */
15
+ langs?: string[];
16
+ /** Optional visual-style preset — expressed through typography, palette, motion, image treatment and pacing. Orthogonal to `scenario` (it does NOT change routing). `auto` (default) lets the director pick; every other value adopts a real named look: `cinematic` = dark film-noir (black + blood-red, Oswald); `glass` = Apple / iOS-26 frosted liquid glass; `luxury` = timeless near-black + indigo, huge whitespace; `swiss` = precise grid + electric blue + oversized numerals; `modern` = clean light SaaS; `editorial` = cream magazine + serif; `warm` = intimate cream + amber; `vibrant` = festive folk colour; `neon` = electric neon glow; `mono` = grayscale, type-led; `pastel` = soft candy pastels; `bold` = huge poster type; `industrial` = raw glitch + rust; `futuristic` = particle glow. A freeform string is also accepted as a soft hint. */
17
+ style?: "auto" | "cinematic" | "glass" | "luxury" | "swiss" | "modern" | "editorial" | "warm" | "vibrant" | "neon" | "mono" | "pastel" | "bold" | "industrial" | "futuristic" | "retro";
18
+ /** Optional narration voice — the **timbre** of the voiceover, independent of language. `auto` (default) lets the director pick a fitting voice. Every preset is cross-lingual: the same voice speaks whatever language(s) you set in `langs`, so choose purely by character — `warm-female`, `bright-female`, `anchor-female`, `clean-female`, `calm-male`, `deep-male`, `documentary-male`, `energetic-male`, `storyteller-male`. Advanced: a raw 32-character Fish `reference_id` is also accepted. For `drama` / `avatar` this sets the primary / narrator timbre; distinct characters may still get their own. */
19
+ voice?: "auto" | "warm-female" | "bright-female" | "anchor-female" | "clean-female" | "calm-male" | "deep-male" | "documentary-male" | "energetic-male" | "storyteller-male";
20
+ /** generate = a new video. remix / edit / extend = iterate on a previous video (require `ref_task_id`). */
21
+ action?: "generate" | "remix" | "edit" | "extend";
22
+ /** Output aspect ratio (hint — the agent may follow the prompt). */
23
+ aspect?: "9:16" | "16:9" | "1:1";
24
+ /** Production tier, a multiplier on the duration-based price. `draft` = a fast rough cut for previewing the idea (~0.5× the standard credits); `standard` = balanced (default, 1×); `premium` = richer, more detailed and polished (~2× the standard credits). Affects turnaround, detail and price. */
25
+ quality?: "draft" | "standard" | "premium";
26
+ /** Target video length in seconds (1–600, i.e. up to 10 minutes). Billed by duration: credits ≈ 0.85 × duration × quality multiplier × scenario multiplier, so a longer or video-native workflow costs proportionally more. */
27
+ duration?: number;
28
+ /** How to route the video — a hint; the AI director still decides the final structure. `auto` (default) = the director chooses from your brief. `narrated` = multi-scene narrated video with real photos + voiceover + data cards (people / brands / explainers / history / products). `drama` = acted short drama with characters + dialogue (短剧) and bills at 1.35×. `avatar` = talking-head / digital human (needs a portrait image via `file_urls`, or a chosen digital human) and bills at 1.15×. `motion` = abstract kinetic-typography / data / logo motion graphic. `slideshow` = presentation deck / pitch. Legacy values `general` / `explainer` / `product` / `website` / `changelog` / `captions` are still accepted (mapped to `auto`), and `slides` maps to `slideshow`. */
29
+ scenario?: "auto" | "narrated" | "drama" | "avatar" | "motion" | "slideshow";
30
+ /** Optional reference media (image / video / audio URLs) the agent can use — e.g. a product shot or logo to feature, footage to caption. */
31
+ fileUrls?: string[];
32
+ /** Required when `action` is remix / edit / extend: the task_id of the previous video to start from. */
33
+ refTaskId?: string;
34
+ callbackUrl?: string;
35
+ /** Any parameter added upstream before the SDK is regenerated. */
36
+ [key: string]: unknown;
37
+ }
38
+
39
+ export interface MaestroEstimatesOptions {
40
+ callbackUrl?: string;
41
+ /** Any parameter added upstream before the SDK is regenerated. */
42
+ [key: string]: unknown;
43
+ }
44
+
45
+ /** maestro client. */
46
+ export class Maestro {
47
+ constructor(private transport: Transport) {}
48
+
49
+ /** Maestro Video Generation API */
50
+ async generate(options: MaestroGenerateOptions): Promise<Record<string, unknown>> {
51
+ const body: Record<string, unknown> = {};
52
+ body["prompt"] = options.prompt;
53
+ body["langs"] = options.langs ?? ["zh-cn"];
54
+ body["style"] = options.style ?? "auto";
55
+ body["voice"] = options.voice ?? "auto";
56
+ body["action"] = options.action ?? "generate";
57
+ body["aspect"] = options.aspect ?? "9:16";
58
+ body["quality"] = options.quality ?? "standard";
59
+ body["duration"] = options.duration ?? 30;
60
+ body["scenario"] = options.scenario ?? "auto";
61
+ if (options.fileUrls !== undefined) body["file_urls"] = options.fileUrls;
62
+ if (options.refTaskId !== undefined) body["ref_task_id"] = options.refTaskId;
63
+ for (const [key, value] of Object.entries(options)) {
64
+ if (!["action", "aspect", "async", "callbackUrl", "duration", "fileUrls", "langs", "maxWait", "pollInterval", "prompt", "quality", "refTaskId", "scenario", "style", "voice", "wait"].includes(key) && value !== undefined) {
65
+ body[key] = value;
66
+ }
67
+ }
68
+ if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
69
+ return (await this.transport.request('POST', "/maestro/videos", { json: body })) as Record<string, unknown>;
70
+ }
71
+
72
+ /** Call /maestro/estimates. */
73
+ async estimates(options: MaestroEstimatesOptions = {}): Promise<Record<string, unknown>> {
74
+ const body: Record<string, unknown> = {};
75
+ for (const [key, value] of Object.entries(options)) {
76
+ if (!["async", "callbackUrl", "maxWait", "pollInterval", "wait"].includes(key) && value !== undefined) {
77
+ body[key] = value;
78
+ }
79
+ }
80
+ if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
81
+ return (await this.transport.request('POST', "/maestro/estimates", { json: body })) as Record<string, unknown>;
82
+ }
83
+
84
+ }
@@ -0,0 +1,74 @@
1
+ /**
2
+ * NanoBanana (nano-banana) — generated from the platform OpenAPI spec.
3
+ *
4
+ * Do not edit by hand: run `python scripts/generate_providers.py`. Parameter
5
+ * names, types, enums and required-ness all come from the live spec.
6
+ */
7
+
8
+ import { Transport } from '../../runtime/transport';
9
+ import { TaskHandle } from '../../runtime/tasks';
10
+
11
+
12
+ function taskId(result: Record<string, unknown>): string {
13
+ if (typeof result?.task_id === 'string') return result.task_id;
14
+ const data = result?.data as Record<string, unknown> | undefined;
15
+ if (data && typeof data.task_id === 'string') return data.task_id;
16
+ return typeof result?.id === 'string' ? result.id : '';
17
+ }
18
+
19
+ export interface NanoBananaGenerateOptions {
20
+ /** Image operation type. If it is `generate`, then generate an image based on the prompt; if it is `edit`, then edit the image based on the prompt and `image_urls`. */
21
+ action: "generate" | "edit";
22
+ /** Prompts for generating images. */
23
+ prompt: string;
24
+ /** The number of images to be generated or edited supports 1 to 4, with a default of 1. If some images fail to generate, the corresponding `data` only contains the successfully generated images and charges based on the number of successful ones. */
25
+ count?: number;
26
+ /** Models used for generating images. If not specified, the default is `nano-banana`. `nano-banana-2-lite` is an alias for `gemini-3.1-flash-lite-image` (only 1K, fast generation speed), `nano-banana-2` is an alias for `gemini-3.1-flash-image` (provides professional-level quality at flash speed), `nano-banana-pro` is an alias for `gemini-3-pro-image`, and `nano-banana` is an alias for `gemini-2.5-flash-image`. Models with the `:official` suffix (`nano-banana:official`, `nano-banana-2-lite:official`, `nano-banana-2:official`, `nano-banana-pro:official`) are provided through official channels, offering better image quality and stability, with different billing. */
27
+ model?: "nano-banana" | "nano-banana-2-lite" | "nano-banana-2" | "nano-banana-pro" | "nano-banana:official" | "nano-banana-2-lite:official" | "nano-banana-2:official" | "nano-banana-pro:official";
28
+ /** Link to the image that needs to be edited. It can be an accessible http or https URL, or a Base64 encoded image string in the format `data:image/png;base64,iVBORw0KG...`. Each image must not exceed 10MB in size. This parameter is required when `action` is `edit`. */
29
+ imageUrls?: string[];
30
+ /** Resolution of generated images. Supported values are `1K`, `2K`, `4K`, with a default of `1K`. If this parameter is specified, images will be generated at the specified resolution regardless of whether the `action` is `generate` or `edit` (smaller reference images can be redrawn at a higher resolution); if not specified, the default value of `1K` will be used. `nano-banana` and `nano-banana-2-lite` only support `1K`; `2K` / `4K` are only applicable to models that support high resolution. */
31
+ resolution?: "1K" | "2K" | "4K";
32
+ /** Aspect ratio for generating images. Supported values are `1:1`, `3:2`, `2:3`, `16:9`, `9:16`, `4:3`, `3:4`. If this parameter is specified, the specified aspect ratio will be used for generation regardless of whether `action` is `generate` or `edit`; if not specified, the default for `action` as `generate` is `1:1`, and for `action` as `edit`, it will automatically adopt the aspect ratio of the first image in `image_urls` to preserve the original composition. Note: In `edit` mode, specifying an aspect ratio that differs significantly from the original image will cause the model to redraw according to the new ratio, which may deviate from the reference image. */
33
+ aspectRatio?: "1:1" | "3:2" | "2:3" | "16:9" | "9:16" | "4:3" | "3:4";
34
+ /** Submit asynchronously and poll. Defaults to true. */
35
+ async?: boolean;
36
+ /** Wait for completion before returning the handle. */
37
+ wait?: boolean;
38
+ pollInterval?: number;
39
+ maxWait?: number;
40
+ callbackUrl?: string;
41
+ /** Any parameter added upstream before the SDK is regenerated. */
42
+ [key: string]: unknown;
43
+ }
44
+
45
+ /** nano-banana client. */
46
+ export class NanoBanana {
47
+ constructor(private transport: Transport) {}
48
+
49
+ /** Google Nano Banana image generation and editing API. Supports nano-banana, nano-banana-2, and nano-banana-pro for text-to-image generation and reference-image editing. */
50
+ async generate(options: NanoBananaGenerateOptions): Promise<TaskHandle> {
51
+ const body: Record<string, unknown> = {};
52
+ body["action"] = options.action;
53
+ body["prompt"] = options.prompt;
54
+ body["count"] = options.count ?? 1;
55
+ if (options.model !== undefined) body["model"] = options.model;
56
+ if (options.imageUrls !== undefined) body["image_urls"] = options.imageUrls;
57
+ if (options.resolution !== undefined) body["resolution"] = options.resolution;
58
+ body["aspect_ratio"] = options.aspectRatio ?? "1:1";
59
+ for (const [key, value] of Object.entries(options)) {
60
+ if (!["action", "aspectRatio", "async", "callbackUrl", "count", "imageUrls", "maxWait", "model", "pollInterval", "prompt", "resolution", "wait"].includes(key) && value !== undefined) {
61
+ body[key] = value;
62
+ }
63
+ }
64
+ if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
65
+ body.async = options.async ?? true;
66
+ const result = (await this.transport.request('POST', "/nano-banana/images", { json: body })) as Record<string, unknown>;
67
+ const handle = new TaskHandle(taskId(result), "/nano-banana/tasks", this.transport, result);
68
+ if (options.wait) {
69
+ await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
70
+ }
71
+ return handle;
72
+ }
73
+
74
+ }
@@ -0,0 +1,182 @@
1
+ /**
2
+ * Producer (producer) — generated from the platform OpenAPI spec.
3
+ *
4
+ * Do not edit by hand: run `python scripts/generate_providers.py`. Parameter
5
+ * names, types, enums and required-ness all come from the live spec.
6
+ */
7
+
8
+ import { Transport } from '../../runtime/transport';
9
+ import { TaskHandle } from '../../runtime/tasks';
10
+
11
+
12
+ function taskId(result: Record<string, unknown>): string {
13
+ if (typeof result?.task_id === 'string') return result.task_id;
14
+ const data = result?.data as Record<string, unknown> | undefined;
15
+ if (data && typeof data.task_id === 'string') return data.task_id;
16
+ return typeof result?.id === 'string' ? result.id : '';
17
+ }
18
+
19
+ export interface ProducerUploadOptions {
20
+ /** The CDN address for the custom audio files to be uploaded. */
21
+ audioUrl: string;
22
+ callbackUrl?: string;
23
+ /** Any parameter added upstream before the SDK is regenerated. */
24
+ [key: string]: unknown;
25
+ }
26
+
27
+ export interface ProducerGenerateOptions {
28
+ /** Reference audio ID. */
29
+ audioId: string;
30
+ callbackUrl?: string;
31
+ /** Any parameter added upstream before the SDK is regenerated. */
32
+ [key: string]: unknown;
33
+ }
34
+
35
+ export interface ProducerWavOptions {
36
+ /** Reference audio ID. */
37
+ audioId: string;
38
+ callbackUrl?: string;
39
+ /** Any parameter added upstream before the SDK is regenerated. */
40
+ [key: string]: unknown;
41
+ }
42
+
43
+ export interface ProducerProducerAudiosOptions {
44
+ /** Lyrics content for generating audio. */
45
+ lyric: string;
46
+ /** Types of audio generation operations. Supported values include `generate` (generate based on prompts), `cover` (cover song), `extend` (continue writing), `variation` (variant), `swap_vocals` (replace vocals), `swap_instrumentals` (replace instrumentals), `replace_section` (replace section), `stems` (separate tracks). */
47
+ action: "generate" | "cover" | "extend" | "variation" | "swap_vocals" | "swap_instrumentals" | "replace_section" | "stems";
48
+ /** Prompts for generating audio should not exceed 200 characters in length. */
49
+ prompt: string;
50
+ /** Random seed used for audio generation. */
51
+ seed?: string;
52
+ /** The model used for generating music is `FUZZ-2.0` by default. */
53
+ model?: "FUZZ-2.0 Pro" | "FUZZ-2.0" | "FUZZ-2.0 Raw" | "FUZZ-1.1 Pro" | "FUZZ-1.0 Pro" | "FUZZ-1.0" | "FUZZ-1.1" | "FUZZ-0.8";
54
+ /** Title used for generating songs. */
55
+ title?: string;
56
+ /** Is it a custom mode? If `true`, the audio will be generated based on the `lyric`; otherwise, it will be generated based on the `prompt`. */
57
+ custom?: boolean;
58
+ /** The unique ID of the reference song. */
59
+ audioId?: string;
60
+ /** The degree of uniqueness of style can be selected between 0 and 1, with a default value of 0.5. */
61
+ weirdness?: number;
62
+ /** Specify the time point (in seconds) from which to continue writing the song. */
63
+ continueAt?: number;
64
+ /** If `true`, the generated audio will only contain the accompaniment, without vocal lyrics. */
65
+ instrumental?: boolean;
66
+ /** The impact intensity of the audio prompt words can be selected between 0.2 and 1, with a default value of 0.5. */
67
+ soundStrength?: number;
68
+ /** The degree of influence of lyrics on audio generation can be selected between 0 and 1, with a default value of 0.5. */
69
+ lyricsStrength?: number;
70
+ /** Replace the end time point of the segment (seconds). */
71
+ replaceSectionEnd?: number;
72
+ /** Replace the starting time point of the segment (seconds). */
73
+ replaceSectionStart?: number;
74
+ /** Submit asynchronously and poll. Defaults to true. */
75
+ async?: boolean;
76
+ /** Wait for completion before returning the handle. */
77
+ wait?: boolean;
78
+ pollInterval?: number;
79
+ maxWait?: number;
80
+ callbackUrl?: string;
81
+ /** Any parameter added upstream before the SDK is regenerated. */
82
+ [key: string]: unknown;
83
+ }
84
+
85
+ export interface ProducerLyricsOptions {
86
+ /** Prompts for generating lyrics. */
87
+ prompt: Record<string, unknown>;
88
+ callbackUrl?: string;
89
+ /** Any parameter added upstream before the SDK is regenerated. */
90
+ [key: string]: unknown;
91
+ }
92
+
93
+ /** producer client. */
94
+ export class Producer {
95
+ constructor(private transport: Transport) {}
96
+
97
+ /** Producer reference audio upload API, upload audio to get an audio_id for generation. */
98
+ async upload(options: ProducerUploadOptions): Promise<Record<string, unknown>> {
99
+ const body: Record<string, unknown> = {};
100
+ body["audio_url"] = options.audioUrl;
101
+ for (const [key, value] of Object.entries(options)) {
102
+ if (!["async", "audioUrl", "callbackUrl", "maxWait", "pollInterval", "wait"].includes(key) && value !== undefined) {
103
+ body[key] = value;
104
+ }
105
+ }
106
+ if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
107
+ return (await this.transport.request('POST', "/producer/upload", { json: body })) as Record<string, unknown>;
108
+ }
109
+
110
+ /** AceData Producer MP4 retrieval API. Pass an audio_id to receive an MP4 video download link with cover art. */
111
+ async generate(options: ProducerGenerateOptions): Promise<Record<string, unknown>> {
112
+ const body: Record<string, unknown> = {};
113
+ body["audio_id"] = options.audioId;
114
+ for (const [key, value] of Object.entries(options)) {
115
+ if (!["async", "audioId", "callbackUrl", "maxWait", "pollInterval", "wait"].includes(key) && value !== undefined) {
116
+ body[key] = value;
117
+ }
118
+ }
119
+ if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
120
+ return (await this.transport.request('POST', "/producer/videos", { json: body })) as Record<string, unknown>;
121
+ }
122
+
123
+ /** AceData Producer WAV (lossless) retrieval API. Pass an audio_id to receive a WAV-format download link. */
124
+ async wav(options: ProducerWavOptions): Promise<Record<string, unknown>> {
125
+ const body: Record<string, unknown> = {};
126
+ body["audio_id"] = options.audioId;
127
+ for (const [key, value] of Object.entries(options)) {
128
+ if (!["async", "audioId", "callbackUrl", "maxWait", "pollInterval", "wait"].includes(key) && value !== undefined) {
129
+ body[key] = value;
130
+ }
131
+ }
132
+ if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
133
+ return (await this.transport.request('POST', "/producer/wav", { json: body })) as Record<string, unknown>;
134
+ }
135
+
136
+ /** Producer AI music generation API, generates 1 song per request. */
137
+ async producer_audios(options: ProducerProducerAudiosOptions): Promise<TaskHandle> {
138
+ const body: Record<string, unknown> = {};
139
+ body["lyric"] = options.lyric;
140
+ body["action"] = options.action;
141
+ body["prompt"] = options.prompt;
142
+ if (options.seed !== undefined) body["seed"] = options.seed;
143
+ if (options.model !== undefined) body["model"] = options.model;
144
+ if (options.title !== undefined) body["title"] = options.title;
145
+ if (options.custom !== undefined) body["custom"] = options.custom;
146
+ if (options.audioId !== undefined) body["audio_id"] = options.audioId;
147
+ body["weirdness"] = options.weirdness ?? false;
148
+ body["continue_at"] = options.continueAt ?? false;
149
+ body["instrumental"] = options.instrumental ?? false;
150
+ body["sound_strength"] = options.soundStrength ?? false;
151
+ body["lyrics_strength"] = options.lyricsStrength ?? false;
152
+ body["replace_section_end"] = options.replaceSectionEnd ?? false;
153
+ body["replace_section_start"] = options.replaceSectionStart ?? false;
154
+ for (const [key, value] of Object.entries(options)) {
155
+ if (!["action", "async", "audioId", "callbackUrl", "continueAt", "custom", "instrumental", "lyric", "lyricsStrength", "maxWait", "model", "pollInterval", "prompt", "replaceSectionEnd", "replaceSectionStart", "seed", "soundStrength", "title", "wait", "weirdness"].includes(key) && value !== undefined) {
156
+ body[key] = value;
157
+ }
158
+ }
159
+ if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
160
+ body.async = options.async ?? true;
161
+ const result = (await this.transport.request('POST', "/producer/audios", { json: body })) as Record<string, unknown>;
162
+ const handle = new TaskHandle(taskId(result), "/producer/tasks", this.transport, result);
163
+ if (options.wait) {
164
+ await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
165
+ }
166
+ return handle;
167
+ }
168
+
169
+ /** Producer AI lyrics generation API, input a prompt to generate lyrics. */
170
+ async lyrics(options: ProducerLyricsOptions): Promise<Record<string, unknown>> {
171
+ const body: Record<string, unknown> = {};
172
+ body["prompt"] = options.prompt;
173
+ for (const [key, value] of Object.entries(options)) {
174
+ if (!["async", "callbackUrl", "maxWait", "pollInterval", "prompt", "wait"].includes(key) && value !== undefined) {
175
+ body[key] = value;
176
+ }
177
+ }
178
+ if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
179
+ return (await this.transport.request('POST', "/producer/lyrics", { json: body })) as Record<string, unknown>;
180
+ }
181
+
182
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Seedance (seedance) — generated from the platform OpenAPI spec.
3
+ *
4
+ * Do not edit by hand: run `python scripts/generate_providers.py`. Parameter
5
+ * names, types, enums and required-ness all come from the live spec.
6
+ */
7
+
8
+ import { Transport } from '../../runtime/transport';
9
+ import { TaskHandle } from '../../runtime/tasks';
10
+
11
+
12
+ function taskId(result: Record<string, unknown>): string {
13
+ if (typeof result?.task_id === 'string') return result.task_id;
14
+ const data = result?.data as Record<string, unknown> | undefined;
15
+ if (data && typeof data.task_id === 'string') return data.task_id;
16
+ return typeof result?.id === 'string' ? result.id : '';
17
+ }
18
+
19
+ export interface SeedanceGenerateOptions {
20
+ /** Model ID for video generation */
21
+ model: "doubao-seedance-1-0-pro-250528" | "doubao-seedance-1-0-pro-fast-251015" | "doubao-seedance-1-5-pro-251215" | "doubao-seedance-1-0-lite-t2v-250428" | "doubao-seedance-1-0-lite-i2v-250428" | "doubao-seedance-2-0-260128" | "doubao-seedance-2-0-fast-260128" | "doubao-seedance-2-0-mini-260615";
22
+ /** Input content for video generation. Each entry must include one of `text`, `image_url`, `audio_url`, or `video_url` corresponding to the `type`. The meaning of other fields and whether they are required depends on the value of `type`. */
23
+ content: unknown[];
24
+ /** The random seed used for reproducible generation has a value range from -1 to 4294967295; -1 indicates randomness. */
25
+ seed?: number;
26
+ /** Aspect ratio of the generated video */
27
+ ratio?: "16:9" | "4:3" | "1:1" | "3:4" | "9:16" | "21:9" | "adaptive";
28
+ /** The frame count for generating a video must meet 25 + 4n (such as 29, 33, 37... 361). Either duration or frames can be specified; if both are specified, frames take priority over duration. */
29
+ frames?: number;
30
+ /** The duration of the generated video, in seconds. Either duration or frames can be specified; if both are specified, frames take priority over duration. The duration range varies for each model: Seedance 2.0 series is 4 to 15 seconds or -1, Seedance 1.5 Pro is 4 to 12 seconds or -1, and Seedance 1.0 series is 2 to 12 seconds. -1 indicates automatic duration. */
31
+ duration?: number;
32
+ /** Whether to add a watermark to the generated video. */
33
+ watermark?: boolean;
34
+ /** Video resolution. The default value depends on the model used: most models default to 720p, while the lite model defaults to 480p. Note that the supported resolutions vary by model: `4k` is only supported by doubao-seedance-2-0 (standard version); doubao-seedance-2-0-fast and doubao-seedance-2-0-mini do not support 1080p and 4k. */
35
+ resolution?: "480p" | "720p" | "1080p" | "4k";
36
+ /** Is the camera position fixed during the generation process? */
37
+ camerafixed?: boolean;
38
+ /** Whether to generate audio from video. The `doubao-seedance-1-5-pro-251215` and `doubao-seedance-2-0` series models support this parameter, while other models will ignore this parameter. */
39
+ generateAudio?: boolean;
40
+ /** Whether to return the last frame of the generated video. */
41
+ returnLastFrame?: boolean;
42
+ /** Task timeout threshold, unit in seconds */
43
+ executionExpiresAfter?: number;
44
+ /** Submit asynchronously and poll. Defaults to true. */
45
+ async?: boolean;
46
+ /** Wait for completion before returning the handle. */
47
+ wait?: boolean;
48
+ pollInterval?: number;
49
+ maxWait?: number;
50
+ callbackUrl?: string;
51
+ /** Any parameter added upstream before the SDK is regenerated. */
52
+ [key: string]: unknown;
53
+ }
54
+
55
+ /** seedance client. */
56
+ export class Seedance {
57
+ constructor(private transport: Transport) {}
58
+
59
+ /** ByteDance Seedance video generation API. Supports doubao-seedance-1-0-pro-250528, doubao-seedance-1-0-pro-fast-251015, doubao-seedance-1-5-pro-251215, doubao-seedance-1-0-lite-t2v-250428, and doubao-s */
60
+ async generate(options: SeedanceGenerateOptions): Promise<TaskHandle> {
61
+ const body: Record<string, unknown> = {};
62
+ body["model"] = options.model;
63
+ body["content"] = options.content;
64
+ if (options.seed !== undefined) body["seed"] = options.seed;
65
+ body["ratio"] = options.ratio ?? "16:9";
66
+ if (options.frames !== undefined) body["frames"] = options.frames;
67
+ if (options.duration !== undefined) body["duration"] = options.duration;
68
+ if (options.watermark !== undefined) body["watermark"] = options.watermark;
69
+ if (options.resolution !== undefined) body["resolution"] = options.resolution;
70
+ if (options.camerafixed !== undefined) body["camerafixed"] = options.camerafixed;
71
+ body["generate_audio"] = options.generateAudio ?? false;
72
+ body["return_last_frame"] = options.returnLastFrame ?? false;
73
+ body["execution_expires_after"] = options.executionExpiresAfter ?? 172800;
74
+ for (const [key, value] of Object.entries(options)) {
75
+ if (!["async", "callbackUrl", "camerafixed", "content", "duration", "executionExpiresAfter", "frames", "generateAudio", "maxWait", "model", "pollInterval", "ratio", "resolution", "returnLastFrame", "seed", "wait", "watermark"].includes(key) && value !== undefined) {
76
+ body[key] = value;
77
+ }
78
+ }
79
+ if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
80
+ body.async = options.async ?? true;
81
+ const result = (await this.transport.request('POST', "/seedance/videos", { json: body })) as Record<string, unknown>;
82
+ const handle = new TaskHandle(taskId(result), "/seedance/tasks", this.transport, result);
83
+ if (options.wait) {
84
+ await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
85
+ }
86
+ return handle;
87
+ }
88
+
89
+ }