@runapi.ai/seedance 0.2.6 → 0.2.8

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.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # Seedance API JavaScript SDK for RunAPI
1
+ # Seedance JavaScript SDK for RunAPI
2
2
 
3
- The seedance api JavaScript SDK is the language-specific package for Seedance on RunAPI. Use this seedance api package for text-to-video, image-to-video, video editing, and animation flows when your application needs JSON request bodies, task status lookup, and consistent RunAPI errors in JavaScript.
3
+ The Seedance JavaScript SDK is the language-specific package for Seedance on RunAPI. Use this package for video generation, animation, and video editing workflows when your application needs request bodies, task status lookup, and consistent RunAPI errors in JavaScript.
4
4
 
5
- This seedance api README is the JavaScript package guide inside the public `seedance-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/seedance; for API reference, use https://runapi.ai/docs#seedance; for SDK docs, use https://runapi.ai/docs#sdk-seedance.
5
+ This README is the JavaScript package guide inside the public `seedance-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/seedance; for API reference, use https://runapi.ai/docs#seedance; for SDK docs, use https://runapi.ai/docs#sdk-seedance.
6
6
 
7
7
  ## Install
8
8
 
@@ -16,17 +16,19 @@ npm install @runapi.ai/seedance
16
16
  import { SeedanceClient } from '@runapi.ai/seedance';
17
17
 
18
18
  const client = new SeedanceClient();
19
- const task = await client.generations.create({
19
+ const task = await client.textToVideo.create({
20
20
  // Pass the Seedance JSON request body from https://runapi.ai/docs#seedance.
21
21
  });
22
- const status = await client.generations.get(task.id);
22
+ const status = await client.textToVideo.get(task.id);
23
23
  ```
24
24
 
25
25
  Use `create` when you want to submit a task and return quickly, `get` when you need the latest task state, and `run` when a script should create and poll until completion. In web request handlers, prefer `create` plus webhook or later `get` polling so a worker is not held open.
26
26
 
27
+ RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
28
+
27
29
  ## Language notes
28
30
 
29
- Use the TypeScript types in `src/types.ts` and the resource classes under `src/resources` when building video applications. The available resources include generations. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
31
+ Use the TypeScript types in `src/types.ts` and the resource classes under `src/resources` when building video applications. The available resources are `textToVideo`. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
30
32
 
31
33
  ## Links
32
34
 
package/dist/index.d.mts CHANGED
@@ -1,8 +1,9 @@
1
- import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, ClientOptions } from '@runapi.ai/core';
1
+ import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
2
2
  export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
3
 
4
- type SeedanceModel = 'seedance-1.5-pro' | 'seedance-2.0' | 'seedance-2.0-fast' | 'seedance-v1-lite' | 'seedance-v1-pro' | 'seedance-v1-pro-fast';
5
- type SeedanceModel2 = 'seedance-2.0' | 'seedance-2.0-fast';
4
+ type SeedanceModel = 'seedance-1.5-pro' | 'seedance-2.0' | 'seedance-2.0-fast' | 'seedance-2-mini' | 'seedance-v1-lite' | 'seedance-v1-pro' | 'seedance-v1-pro-fast';
5
+ type SeedanceModel2 = 'seedance-2.0' | 'seedance-2.0-fast' | 'seedance-2-mini';
6
+ type SeedanceModel2WithSafetyChecker = 'seedance-2.0' | 'seedance-2.0-fast';
6
7
  type SeedanceModelV1 = 'seedance-v1-lite' | 'seedance-v1-pro' | 'seedance-v1-pro-fast';
7
8
  type AspectRatio15Pro = '1:1' | '4:3' | '3:4' | '16:9' | '9:16' | '21:9';
8
9
  type AspectRatio2 = AspectRatio15Pro | 'auto';
@@ -13,74 +14,98 @@ type Resolution2 = '480p' | '720p' | '1080p';
13
14
  type ResolutionV1 = '480p' | '720p' | '1080p';
14
15
  type ResolutionV1ProFast = '720p' | '1080p';
15
16
  type DurationV1 = 5 | 10;
17
+ type Duration15Pro = number;
16
18
  interface GenerationCommonParams {
17
19
  /** Text description of desired video content */
18
20
  prompt: string;
19
21
  /** URL for completion callback */
20
22
  callback_url?: string;
21
- /** Generate audio track for the video */
22
- generate_audio?: boolean;
23
+ }
24
+ interface SafetyCheckerParams {
23
25
  /** Content safety check toggle */
24
26
  enable_safety_checker?: boolean;
25
27
  }
28
+ interface AudioGenerationParams {
29
+ /** Generate audio track for the video */
30
+ generate_audio?: boolean;
31
+ }
26
32
  /**
27
33
  * seedance-1.5-pro generation parameters.
28
34
  * Supports text-to-video and image-to-video with camera lock.
29
35
  */
30
- interface Generation15ProParams extends GenerationCommonParams {
36
+ interface Generation15ProParams extends GenerationCommonParams, AudioGenerationParams, SafetyCheckerParams {
31
37
  model: 'seedance-1.5-pro';
32
38
  /** Required for seedance-1.5-pro */
33
39
  aspect_ratio: AspectRatio15Pro;
34
40
  output_resolution?: Resolution15Pro;
35
- /** Fixed values: 4, 8, or 12 seconds */
36
- duration_seconds: 4 | 8 | 12;
41
+ /** Integer 4-12 seconds */
42
+ duration_seconds: Duration15Pro;
37
43
  /** Up to 2 source image URLs for image-to-video */
38
44
  source_image_urls?: string[];
39
45
  /** Lock camera movement */
40
46
  lock_camera?: boolean;
41
47
  }
42
48
  /** Common fields for all 2.x modes */
43
- interface Generation2BaseParams extends GenerationCommonParams {
44
- model: SeedanceModel2;
49
+ interface Generation2BaseFields extends GenerationCommonParams, AudioGenerationParams {
45
50
  aspect_ratio?: AspectRatio2;
46
51
  output_resolution?: Resolution2;
47
52
  /** Integer 4-15 */
48
53
  duration_seconds?: number;
49
- /** Enable web search for prompt enrichment. */
54
+ }
55
+ type Generation2ModelFields = ({
56
+ model: SeedanceModel2WithSafetyChecker;
57
+ } & SafetyCheckerParams) | {
58
+ model: 'seedance-2-mini';
59
+ };
60
+ interface Generation2TextFields extends Generation2BaseFields {
61
+ /** Enable web search for prompt enrichment in pure text-to-video mode. */
50
62
  web_search?: boolean;
63
+ first_frame_image_url?: never;
64
+ last_frame_image_url?: never;
65
+ reference_image_urls?: never;
66
+ reference_video_urls?: never;
67
+ reference_audio_urls?: never;
51
68
  }
52
69
  /**
53
- * seedance-2.0/2-fast text-to-video mode.
70
+ * seedance-2.x text-to-video mode.
54
71
  * Pure text prompt, no image/reference inputs.
55
72
  */
56
- interface Generation2TextParams extends Generation2BaseParams {
57
- }
58
- /**
59
- * seedance-2.0/2-fast frame mode.
60
- * Guide generation with first (required) and optional last frame images.
61
- * Mutually exclusive with reference mode.
62
- */
63
- interface Generation2FrameParams extends Generation2BaseParams {
73
+ type Generation2TextParams = Generation2TextFields & Generation2ModelFields;
74
+ interface Generation2FrameFields extends Generation2BaseFields {
64
75
  /** First frame image URL (required for frame mode) */
65
76
  first_frame_image_url: string;
66
77
  /** Last frame image URL */
67
78
  last_frame_image_url?: string;
79
+ web_search?: never;
80
+ reference_image_urls?: never;
81
+ reference_video_urls?: never;
82
+ reference_audio_urls?: never;
68
83
  }
69
84
  /**
70
- * seedance-2.0/2-fast reference mode.
71
- * Guide generation with reference images, videos, or audio.
72
- * Mutually exclusive with frame mode.
85
+ * seedance-2.x frame mode.
86
+ * Guide generation with first (required) and optional last frame images.
87
+ * Mutually exclusive with reference mode.
73
88
  */
74
- interface Generation2ReferenceParams extends Generation2BaseParams {
89
+ type Generation2FrameParams = Generation2FrameFields & Generation2ModelFields;
90
+ interface Generation2ReferenceFields extends Generation2BaseFields {
75
91
  /** Reference image URLs (max 9) */
76
92
  reference_image_urls?: string[];
77
- /** Reference video URLs (max 3, total duration 15s) */
93
+ /** Reference video URLs (max 3, total duration <= 15s) */
78
94
  reference_video_urls?: string[];
79
95
  /** Reference audio URLs (max 3, requires image or video) */
80
96
  reference_audio_urls?: string[];
97
+ first_frame_image_url?: never;
98
+ last_frame_image_url?: never;
99
+ web_search?: never;
81
100
  }
101
+ /**
102
+ * seedance-2.x reference mode.
103
+ * Guide generation with reference images, videos, or audio.
104
+ * Mutually exclusive with frame mode.
105
+ */
106
+ type Generation2ReferenceParams = Generation2ReferenceFields & Generation2ModelFields;
82
107
  /** Common fields for v1-lite and v1-pro (not v1-pro-fast). */
83
- interface GenerationV1SharedParams extends GenerationCommonParams {
108
+ interface GenerationV1SharedParams extends GenerationCommonParams, SafetyCheckerParams {
84
109
  /** `5` or `10`. Required. */
85
110
  duration_seconds: DurationV1;
86
111
  output_resolution?: ResolutionV1;
@@ -117,7 +142,7 @@ interface GenerationV1ProParams extends GenerationV1SharedParams {
117
142
  * seedance-v1-pro-fast image-to-video only. Smaller parameter surface —
118
143
  * no `aspect_ratio`, `lock_camera`, or `seed`.
119
144
  */
120
- interface GenerationV1ProFastParams extends GenerationCommonParams {
145
+ interface GenerationV1ProFastParams extends GenerationCommonParams, SafetyCheckerParams {
121
146
  model: 'seedance-v1-pro-fast';
122
147
  /** Required first frame image URL. */
123
148
  first_frame_image_url: string;
@@ -150,11 +175,30 @@ type CompletedTextToVideoResponse = TextToVideoResponse & {
150
175
  videos: VideoMetadata[];
151
176
  };
152
177
 
178
+ /** Generate video from text prompts, optionally conditioned on reference images, frame images, reference videos, or audio. */
153
179
  declare class TextToVideo {
154
180
  private readonly http;
155
181
  constructor(http: HttpClient);
182
+ /**
183
+ * Create a text to video task and wait until complete.
184
+ * @param params Text to video parameters.
185
+ * @param options Per-request and polling overrides.
186
+ * @returns The completed text to video response.
187
+ */
156
188
  run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse>;
189
+ /**
190
+ * Create a text to video task; returns immediately with a task id.
191
+ * @param params Text to video parameters.
192
+ * @param options Per-request overrides.
193
+ * @returns The task creation result.
194
+ */
157
195
  create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
196
+ /**
197
+ * Fetch the current status of a text to video task.
198
+ * @param id The task id.
199
+ * @param options Per-request overrides.
200
+ * @returns The current text to video task status.
201
+ */
158
202
  get(id: string, options?: RequestOptions): Promise<TextToVideoResponse>;
159
203
  }
160
204
 
@@ -174,10 +218,10 @@ declare class TextToVideo {
174
218
  * });
175
219
  * ```
176
220
  */
177
- declare class SeedanceClient {
221
+ declare class SeedanceClient extends BaseClient {
178
222
  /** Video generation operations. */
179
223
  readonly textToVideo: TextToVideo;
180
224
  constructor(options?: ClientOptions);
181
225
  }
182
226
 
183
- export { type AspectRatio15Pro, type AspectRatio2, type AspectRatioV1Lite, type AspectRatioV1Pro, type CompletedTextToVideoResponse, type DurationV1, type Generation15ProParams, type Generation2FrameParams, type Generation2ReferenceParams, type Generation2TextParams, type GenerationV1LiteParams, type GenerationV1ProFastParams, type GenerationV1ProParams, type Resolution15Pro, type Resolution2, type ResolutionV1, type ResolutionV1ProFast, SeedanceClient, type SeedanceModel, type SeedanceModel2, type SeedanceModelV1, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type VideoMetadata };
227
+ export { type AspectRatio15Pro, type AspectRatio2, type AspectRatioV1Lite, type AspectRatioV1Pro, type CompletedTextToVideoResponse, type Duration15Pro, type DurationV1, type Generation15ProParams, type Generation2FrameParams, type Generation2ReferenceParams, type Generation2TextParams, type GenerationV1LiteParams, type GenerationV1ProFastParams, type GenerationV1ProParams, type Resolution15Pro, type Resolution2, type ResolutionV1, type ResolutionV1ProFast, SeedanceClient, type SeedanceModel, type SeedanceModel2, type SeedanceModel2WithSafetyChecker, type SeedanceModelV1, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type VideoMetadata };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, ClientOptions } from '@runapi.ai/core';
1
+ import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
2
2
  export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
3
 
4
- type SeedanceModel = 'seedance-1.5-pro' | 'seedance-2.0' | 'seedance-2.0-fast' | 'seedance-v1-lite' | 'seedance-v1-pro' | 'seedance-v1-pro-fast';
5
- type SeedanceModel2 = 'seedance-2.0' | 'seedance-2.0-fast';
4
+ type SeedanceModel = 'seedance-1.5-pro' | 'seedance-2.0' | 'seedance-2.0-fast' | 'seedance-2-mini' | 'seedance-v1-lite' | 'seedance-v1-pro' | 'seedance-v1-pro-fast';
5
+ type SeedanceModel2 = 'seedance-2.0' | 'seedance-2.0-fast' | 'seedance-2-mini';
6
+ type SeedanceModel2WithSafetyChecker = 'seedance-2.0' | 'seedance-2.0-fast';
6
7
  type SeedanceModelV1 = 'seedance-v1-lite' | 'seedance-v1-pro' | 'seedance-v1-pro-fast';
7
8
  type AspectRatio15Pro = '1:1' | '4:3' | '3:4' | '16:9' | '9:16' | '21:9';
8
9
  type AspectRatio2 = AspectRatio15Pro | 'auto';
@@ -13,74 +14,98 @@ type Resolution2 = '480p' | '720p' | '1080p';
13
14
  type ResolutionV1 = '480p' | '720p' | '1080p';
14
15
  type ResolutionV1ProFast = '720p' | '1080p';
15
16
  type DurationV1 = 5 | 10;
17
+ type Duration15Pro = number;
16
18
  interface GenerationCommonParams {
17
19
  /** Text description of desired video content */
18
20
  prompt: string;
19
21
  /** URL for completion callback */
20
22
  callback_url?: string;
21
- /** Generate audio track for the video */
22
- generate_audio?: boolean;
23
+ }
24
+ interface SafetyCheckerParams {
23
25
  /** Content safety check toggle */
24
26
  enable_safety_checker?: boolean;
25
27
  }
28
+ interface AudioGenerationParams {
29
+ /** Generate audio track for the video */
30
+ generate_audio?: boolean;
31
+ }
26
32
  /**
27
33
  * seedance-1.5-pro generation parameters.
28
34
  * Supports text-to-video and image-to-video with camera lock.
29
35
  */
30
- interface Generation15ProParams extends GenerationCommonParams {
36
+ interface Generation15ProParams extends GenerationCommonParams, AudioGenerationParams, SafetyCheckerParams {
31
37
  model: 'seedance-1.5-pro';
32
38
  /** Required for seedance-1.5-pro */
33
39
  aspect_ratio: AspectRatio15Pro;
34
40
  output_resolution?: Resolution15Pro;
35
- /** Fixed values: 4, 8, or 12 seconds */
36
- duration_seconds: 4 | 8 | 12;
41
+ /** Integer 4-12 seconds */
42
+ duration_seconds: Duration15Pro;
37
43
  /** Up to 2 source image URLs for image-to-video */
38
44
  source_image_urls?: string[];
39
45
  /** Lock camera movement */
40
46
  lock_camera?: boolean;
41
47
  }
42
48
  /** Common fields for all 2.x modes */
43
- interface Generation2BaseParams extends GenerationCommonParams {
44
- model: SeedanceModel2;
49
+ interface Generation2BaseFields extends GenerationCommonParams, AudioGenerationParams {
45
50
  aspect_ratio?: AspectRatio2;
46
51
  output_resolution?: Resolution2;
47
52
  /** Integer 4-15 */
48
53
  duration_seconds?: number;
49
- /** Enable web search for prompt enrichment. */
54
+ }
55
+ type Generation2ModelFields = ({
56
+ model: SeedanceModel2WithSafetyChecker;
57
+ } & SafetyCheckerParams) | {
58
+ model: 'seedance-2-mini';
59
+ };
60
+ interface Generation2TextFields extends Generation2BaseFields {
61
+ /** Enable web search for prompt enrichment in pure text-to-video mode. */
50
62
  web_search?: boolean;
63
+ first_frame_image_url?: never;
64
+ last_frame_image_url?: never;
65
+ reference_image_urls?: never;
66
+ reference_video_urls?: never;
67
+ reference_audio_urls?: never;
51
68
  }
52
69
  /**
53
- * seedance-2.0/2-fast text-to-video mode.
70
+ * seedance-2.x text-to-video mode.
54
71
  * Pure text prompt, no image/reference inputs.
55
72
  */
56
- interface Generation2TextParams extends Generation2BaseParams {
57
- }
58
- /**
59
- * seedance-2.0/2-fast frame mode.
60
- * Guide generation with first (required) and optional last frame images.
61
- * Mutually exclusive with reference mode.
62
- */
63
- interface Generation2FrameParams extends Generation2BaseParams {
73
+ type Generation2TextParams = Generation2TextFields & Generation2ModelFields;
74
+ interface Generation2FrameFields extends Generation2BaseFields {
64
75
  /** First frame image URL (required for frame mode) */
65
76
  first_frame_image_url: string;
66
77
  /** Last frame image URL */
67
78
  last_frame_image_url?: string;
79
+ web_search?: never;
80
+ reference_image_urls?: never;
81
+ reference_video_urls?: never;
82
+ reference_audio_urls?: never;
68
83
  }
69
84
  /**
70
- * seedance-2.0/2-fast reference mode.
71
- * Guide generation with reference images, videos, or audio.
72
- * Mutually exclusive with frame mode.
85
+ * seedance-2.x frame mode.
86
+ * Guide generation with first (required) and optional last frame images.
87
+ * Mutually exclusive with reference mode.
73
88
  */
74
- interface Generation2ReferenceParams extends Generation2BaseParams {
89
+ type Generation2FrameParams = Generation2FrameFields & Generation2ModelFields;
90
+ interface Generation2ReferenceFields extends Generation2BaseFields {
75
91
  /** Reference image URLs (max 9) */
76
92
  reference_image_urls?: string[];
77
- /** Reference video URLs (max 3, total duration 15s) */
93
+ /** Reference video URLs (max 3, total duration <= 15s) */
78
94
  reference_video_urls?: string[];
79
95
  /** Reference audio URLs (max 3, requires image or video) */
80
96
  reference_audio_urls?: string[];
97
+ first_frame_image_url?: never;
98
+ last_frame_image_url?: never;
99
+ web_search?: never;
81
100
  }
101
+ /**
102
+ * seedance-2.x reference mode.
103
+ * Guide generation with reference images, videos, or audio.
104
+ * Mutually exclusive with frame mode.
105
+ */
106
+ type Generation2ReferenceParams = Generation2ReferenceFields & Generation2ModelFields;
82
107
  /** Common fields for v1-lite and v1-pro (not v1-pro-fast). */
83
- interface GenerationV1SharedParams extends GenerationCommonParams {
108
+ interface GenerationV1SharedParams extends GenerationCommonParams, SafetyCheckerParams {
84
109
  /** `5` or `10`. Required. */
85
110
  duration_seconds: DurationV1;
86
111
  output_resolution?: ResolutionV1;
@@ -117,7 +142,7 @@ interface GenerationV1ProParams extends GenerationV1SharedParams {
117
142
  * seedance-v1-pro-fast image-to-video only. Smaller parameter surface —
118
143
  * no `aspect_ratio`, `lock_camera`, or `seed`.
119
144
  */
120
- interface GenerationV1ProFastParams extends GenerationCommonParams {
145
+ interface GenerationV1ProFastParams extends GenerationCommonParams, SafetyCheckerParams {
121
146
  model: 'seedance-v1-pro-fast';
122
147
  /** Required first frame image URL. */
123
148
  first_frame_image_url: string;
@@ -150,11 +175,30 @@ type CompletedTextToVideoResponse = TextToVideoResponse & {
150
175
  videos: VideoMetadata[];
151
176
  };
152
177
 
178
+ /** Generate video from text prompts, optionally conditioned on reference images, frame images, reference videos, or audio. */
153
179
  declare class TextToVideo {
154
180
  private readonly http;
155
181
  constructor(http: HttpClient);
182
+ /**
183
+ * Create a text to video task and wait until complete.
184
+ * @param params Text to video parameters.
185
+ * @param options Per-request and polling overrides.
186
+ * @returns The completed text to video response.
187
+ */
156
188
  run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse>;
189
+ /**
190
+ * Create a text to video task; returns immediately with a task id.
191
+ * @param params Text to video parameters.
192
+ * @param options Per-request overrides.
193
+ * @returns The task creation result.
194
+ */
157
195
  create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
196
+ /**
197
+ * Fetch the current status of a text to video task.
198
+ * @param id The task id.
199
+ * @param options Per-request overrides.
200
+ * @returns The current text to video task status.
201
+ */
158
202
  get(id: string, options?: RequestOptions): Promise<TextToVideoResponse>;
159
203
  }
160
204
 
@@ -174,10 +218,10 @@ declare class TextToVideo {
174
218
  * });
175
219
  * ```
176
220
  */
177
- declare class SeedanceClient {
221
+ declare class SeedanceClient extends BaseClient {
178
222
  /** Video generation operations. */
179
223
  readonly textToVideo: TextToVideo;
180
224
  constructor(options?: ClientOptions);
181
225
  }
182
226
 
183
- export { type AspectRatio15Pro, type AspectRatio2, type AspectRatioV1Lite, type AspectRatioV1Pro, type CompletedTextToVideoResponse, type DurationV1, type Generation15ProParams, type Generation2FrameParams, type Generation2ReferenceParams, type Generation2TextParams, type GenerationV1LiteParams, type GenerationV1ProFastParams, type GenerationV1ProParams, type Resolution15Pro, type Resolution2, type ResolutionV1, type ResolutionV1ProFast, SeedanceClient, type SeedanceModel, type SeedanceModel2, type SeedanceModelV1, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type VideoMetadata };
227
+ export { type AspectRatio15Pro, type AspectRatio2, type AspectRatioV1Lite, type AspectRatioV1Pro, type CompletedTextToVideoResponse, type Duration15Pro, type DurationV1, type Generation15ProParams, type Generation2FrameParams, type Generation2ReferenceParams, type Generation2TextParams, type GenerationV1LiteParams, type GenerationV1ProFastParams, type GenerationV1ProParams, type Resolution15Pro, type Resolution2, type ResolutionV1, type ResolutionV1ProFast, SeedanceClient, type SeedanceModel, type SeedanceModel2, type SeedanceModel2WithSafetyChecker, type SeedanceModelV1, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type VideoMetadata };
package/dist/index.js CHANGED
@@ -41,12 +41,214 @@ var import_core2 = require("@runapi.ai/core");
41
41
  // src/resources/text-to-video.ts
42
42
  var import_core = require("@runapi.ai/core");
43
43
  var import_internal = require("@runapi.ai/core/internal");
44
+
45
+ // src/contract_gen.ts
46
+ var contract = {
47
+ "text-to-video": {
48
+ "models": [
49
+ "seedance-1.5-pro",
50
+ "seedance-2-mini",
51
+ "seedance-2.0",
52
+ "seedance-2.0-fast",
53
+ "seedance-v1-lite",
54
+ "seedance-v1-pro",
55
+ "seedance-v1-pro-fast"
56
+ ],
57
+ "fields_by_model": {
58
+ "seedance-1.5-pro": {
59
+ "aspect_ratio": {
60
+ "enum": [
61
+ "1:1",
62
+ "4:3",
63
+ "3:4",
64
+ "16:9",
65
+ "9:16",
66
+ "21:9"
67
+ ]
68
+ },
69
+ "duration_seconds": {
70
+ "required": true,
71
+ "min": 4,
72
+ "max": 12,
73
+ "type": "integer"
74
+ },
75
+ "output_resolution": {
76
+ "enum": [
77
+ "480p",
78
+ "720p",
79
+ "1080p"
80
+ ]
81
+ }
82
+ },
83
+ "seedance-2-mini": {
84
+ "aspect_ratio": {
85
+ "enum": [
86
+ "1:1",
87
+ "4:3",
88
+ "3:4",
89
+ "16:9",
90
+ "9:16",
91
+ "21:9",
92
+ "auto"
93
+ ]
94
+ },
95
+ "duration_seconds": {
96
+ "min": 4,
97
+ "max": 15,
98
+ "type": "integer"
99
+ },
100
+ "output_resolution": {
101
+ "enum": [
102
+ "480p",
103
+ "720p"
104
+ ]
105
+ }
106
+ },
107
+ "seedance-2.0": {
108
+ "aspect_ratio": {
109
+ "enum": [
110
+ "1:1",
111
+ "4:3",
112
+ "3:4",
113
+ "16:9",
114
+ "9:16",
115
+ "21:9",
116
+ "auto"
117
+ ]
118
+ },
119
+ "duration_seconds": {
120
+ "min": 4,
121
+ "max": 15,
122
+ "type": "integer"
123
+ },
124
+ "output_resolution": {
125
+ "enum": [
126
+ "480p",
127
+ "720p",
128
+ "1080p"
129
+ ]
130
+ }
131
+ },
132
+ "seedance-2.0-fast": {
133
+ "aspect_ratio": {
134
+ "enum": [
135
+ "1:1",
136
+ "4:3",
137
+ "3:4",
138
+ "16:9",
139
+ "9:16",
140
+ "21:9",
141
+ "auto"
142
+ ]
143
+ },
144
+ "duration_seconds": {
145
+ "min": 4,
146
+ "max": 15,
147
+ "type": "integer"
148
+ },
149
+ "output_resolution": {
150
+ "enum": [
151
+ "480p",
152
+ "720p"
153
+ ]
154
+ }
155
+ },
156
+ "seedance-v1-lite": {
157
+ "aspect_ratio": {
158
+ "enum": [
159
+ "1:1",
160
+ "4:3",
161
+ "3:4",
162
+ "16:9",
163
+ "9:16",
164
+ "9:21"
165
+ ]
166
+ },
167
+ "duration_seconds": {
168
+ "enum": [
169
+ 5,
170
+ 10
171
+ ],
172
+ "required": true,
173
+ "type": "integer"
174
+ },
175
+ "output_resolution": {
176
+ "enum": [
177
+ "480p",
178
+ "720p",
179
+ "1080p"
180
+ ]
181
+ },
182
+ "seed": {
183
+ "type": "integer"
184
+ }
185
+ },
186
+ "seedance-v1-pro": {
187
+ "aspect_ratio": {
188
+ "enum": [
189
+ "1:1",
190
+ "4:3",
191
+ "3:4",
192
+ "16:9",
193
+ "9:16",
194
+ "21:9"
195
+ ]
196
+ },
197
+ "duration_seconds": {
198
+ "enum": [
199
+ 5,
200
+ 10
201
+ ],
202
+ "required": true,
203
+ "type": "integer"
204
+ },
205
+ "output_resolution": {
206
+ "enum": [
207
+ "480p",
208
+ "720p",
209
+ "1080p"
210
+ ]
211
+ },
212
+ "seed": {
213
+ "type": "integer"
214
+ }
215
+ },
216
+ "seedance-v1-pro-fast": {
217
+ "duration_seconds": {
218
+ "enum": [
219
+ 5,
220
+ 10
221
+ ],
222
+ "required": true,
223
+ "type": "integer"
224
+ },
225
+ "first_frame_image_url": {
226
+ "required": true
227
+ },
228
+ "output_resolution": {
229
+ "enum": [
230
+ "720p",
231
+ "1080p"
232
+ ]
233
+ }
234
+ }
235
+ }
236
+ }
237
+ };
238
+
239
+ // src/resources/text-to-video.ts
44
240
  var ENDPOINT = "/api/v1/seedance/text_to_video";
45
241
  var TextToVideo = class {
46
242
  constructor(http) {
47
243
  this.http = http;
48
244
  }
49
245
  http;
246
+ /**
247
+ * Create a text to video task and wait until complete.
248
+ * @param params Text to video parameters.
249
+ * @param options Per-request and polling overrides.
250
+ * @returns The completed text to video response.
251
+ */
50
252
  async run(params, options) {
51
253
  const { id } = await this.create(params, options);
52
254
  const response = await (0, import_internal.pollUntilComplete)(() => this.get(id, options), {
@@ -55,12 +257,26 @@ var TextToVideo = class {
55
257
  });
56
258
  return response;
57
259
  }
260
+ /**
261
+ * Create a text to video task; returns immediately with a task id.
262
+ * @param params Text to video parameters.
263
+ * @param options Per-request overrides.
264
+ * @returns The task creation result.
265
+ */
58
266
  async create(params, options) {
267
+ const body = (0, import_core.compactParams)(params);
268
+ (0, import_core.validateParams)(contract["text-to-video"], body);
59
269
  return this.http.request("POST", ENDPOINT, {
60
- body: (0, import_core.compactParams)(params),
270
+ body,
61
271
  ...options
62
272
  });
63
273
  }
274
+ /**
275
+ * Fetch the current status of a text to video task.
276
+ * @param id The task id.
277
+ * @param options Per-request overrides.
278
+ * @returns The current text to video task status.
279
+ */
64
280
  async get(id, options) {
65
281
  return this.http.request("GET", `${ENDPOINT}/${id}`, {
66
282
  ...options
@@ -69,12 +285,12 @@ var TextToVideo = class {
69
285
  };
70
286
 
71
287
  // src/client.ts
72
- var SeedanceClient = class {
288
+ var SeedanceClient = class extends import_core2.BaseClient {
73
289
  /** Video generation operations. */
74
290
  textToVideo;
75
291
  constructor(options = {}) {
76
- const http = (0, import_core2.createHttpClient)(options);
77
- this.textToVideo = new TextToVideo(http);
292
+ super(options);
293
+ this.textToVideo = new TextToVideo(this.http);
78
294
  }
79
295
  };
80
296
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/text-to-video.ts"],"sourcesContent":["export { SeedanceClient } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n","import { createHttpClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToVideo } from './resources/text-to-video';\n\n/**\n * Seedance video API client.\n *\n * @example\n * ```typescript\n * const client = new SeedanceClient({\n * apiKey: 'your-api-key',\n * baseUrl: 'https://runapi.ai',\n * });\n *\n * const result = await client.textToVideo.run({\n * model: 'seedance-2.0',\n * prompt: 'A cat walking through a garden',\n * });\n * ```\n */\nexport class SeedanceClient {\n /** Video generation operations. */\n public readonly textToVideo: TextToVideo;\n\n constructor(options: ClientOptions = {}) {\n const http = createHttpClient(options);\n this.textToVideo = new TextToVideo(http);\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedTextToVideoResponse,\n TextToVideoParams,\n TextToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/seedance/text_to_video';\n\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,eAAqD;;;ACCrD,kBAA8B;AAC9B,sBAAkC;AAQlC,IAAM,WAAW;AAEV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA2B,SAAkF;AACrH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,UAAM,mCAAuC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACzF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAO,QAA2B,SAAuD;AAC7F,WAAO,KAAK,KAAK,QAA4B,QAAQ,UAAU;AAAA,MAC7D,UAAM,2BAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAAwD;AAC5E,WAAO,KAAK,KAAK,QAA6B,OAAO,GAAG,QAAQ,IAAI,EAAE,IAAI;AAAA,MACxE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ADjBO,IAAM,iBAAN,MAAqB;AAAA;AAAA,EAEV;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,WAAO,+BAAiB,OAAO;AACrC,SAAK,cAAc,IAAI,YAAY,IAAI;AAAA,EACzC;AACF;;;ADxBA,IAAAC,eAYO;","names":["import_core","import_core"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/text-to-video.ts","../src/contract_gen.ts"],"sourcesContent":["export { SeedanceClient } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n","import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToVideo } from './resources/text-to-video';\n\n/**\n * Seedance video API client.\n *\n * @example\n * ```typescript\n * const client = new SeedanceClient({\n * apiKey: 'your-api-key',\n * baseUrl: 'https://runapi.ai',\n * });\n *\n * const result = await client.textToVideo.run({\n * model: 'seedance-2.0',\n * prompt: 'A cat walking through a garden',\n * });\n * ```\n */\nexport class SeedanceClient extends BaseClient {\n /** Video generation operations. */\n public readonly textToVideo: TextToVideo;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToVideo = new TextToVideo(this.http);\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedTextToVideoResponse,\n TextToVideoParams,\n TextToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/seedance/text_to_video';\n\n/** Generate video from text prompts, optionally conditioned on reference images, frame images, reference videos, or audio. */\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create a text to video task and wait until complete.\n * @param params Text to video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed text to video response.\n */\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n /**\n * Create a text to video task; returns immediately with a task id.\n * @param params Text to video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result.\n */\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['text-to-video'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of a text to video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text to video task status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export const contract = {\n \"text-to-video\": {\n \"models\": [\n \"seedance-1.5-pro\",\n \"seedance-2-mini\",\n \"seedance-2.0\",\n \"seedance-2.0-fast\",\n \"seedance-v1-lite\",\n \"seedance-v1-pro\",\n \"seedance-v1-pro-fast\"\n ],\n \"fields_by_model\": {\n \"seedance-1.5-pro\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"21:9\"\n ]\n },\n \"duration_seconds\": {\n \"required\": true,\n \"min\": 4,\n \"max\": 12,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"480p\",\n \"720p\",\n \"1080p\"\n ]\n }\n },\n \"seedance-2-mini\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"duration_seconds\": {\n \"min\": 4,\n \"max\": 15,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"480p\",\n \"720p\"\n ]\n }\n },\n \"seedance-2.0\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"duration_seconds\": {\n \"min\": 4,\n \"max\": 15,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"480p\",\n \"720p\",\n \"1080p\"\n ]\n }\n },\n \"seedance-2.0-fast\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"duration_seconds\": {\n \"min\": 4,\n \"max\": 15,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"480p\",\n \"720p\"\n ]\n }\n },\n \"seedance-v1-lite\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"9:21\"\n ]\n },\n \"duration_seconds\": {\n \"enum\": [\n 5,\n 10\n ],\n \"required\": true,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"480p\",\n \"720p\",\n \"1080p\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"seedance-v1-pro\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"21:9\"\n ]\n },\n \"duration_seconds\": {\n \"enum\": [\n 5,\n 10\n ],\n \"required\": true,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"480p\",\n \"720p\",\n \"1080p\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"seedance-v1-pro-fast\": {\n \"duration_seconds\": {\n \"enum\": [\n 5,\n 10\n ],\n \"required\": true,\n \"type\": \"integer\"\n },\n \"first_frame_image_url\": {\n \"required\": true\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n }\n }\n }\n }\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,eAA+C;;;ACC/C,kBAA8C;AAC9C,sBAAkC;;;ACF3B,IAAM,WAAW;AAAA,EACtB,iBAAiB;AAAA,IACf,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,oBAAoB;AAAA,QAClB,gBAAgB;AAAA,UACd,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,oBAAoB;AAAA,UAClB,YAAY;AAAA,UACZ,OAAO;AAAA,UACP,OAAO;AAAA,UACP,QAAQ;AAAA,QACV;AAAA,QACA,qBAAqB;AAAA,UACnB,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,MACA,mBAAmB;AAAA,QACjB,gBAAgB;AAAA,UACd,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,oBAAoB;AAAA,UAClB,OAAO;AAAA,UACP,OAAO;AAAA,UACP,QAAQ;AAAA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,KAAK,KAAK,QAA4B,QAAQ,UAAU;AAAA,MAC7D;AAAA,MACA,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,IAAI,IAAY,SAAwD;AAC5E,WAAO,KAAK,KAAK,QAA6B,OAAO,GAAG,QAAQ,IAAI,EAAE,IAAI;AAAA,MACxE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ADvCO,IAAM,iBAAN,cAA6B,wBAAW;AAAA;AAAA,EAE7B;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAAA,EAC9C;AACF;;;ADxBA,IAAAC,eAYO;","names":["import_core","import_core"]}
package/dist/index.mjs CHANGED
@@ -1,15 +1,217 @@
1
1
  // src/client.ts
2
- import { createHttpClient } from "@runapi.ai/core";
2
+ import { BaseClient } from "@runapi.ai/core";
3
3
 
4
4
  // src/resources/text-to-video.ts
5
- import { compactParams } from "@runapi.ai/core";
5
+ import { compactParams, validateParams } from "@runapi.ai/core";
6
6
  import { pollUntilComplete } from "@runapi.ai/core/internal";
7
+
8
+ // src/contract_gen.ts
9
+ var contract = {
10
+ "text-to-video": {
11
+ "models": [
12
+ "seedance-1.5-pro",
13
+ "seedance-2-mini",
14
+ "seedance-2.0",
15
+ "seedance-2.0-fast",
16
+ "seedance-v1-lite",
17
+ "seedance-v1-pro",
18
+ "seedance-v1-pro-fast"
19
+ ],
20
+ "fields_by_model": {
21
+ "seedance-1.5-pro": {
22
+ "aspect_ratio": {
23
+ "enum": [
24
+ "1:1",
25
+ "4:3",
26
+ "3:4",
27
+ "16:9",
28
+ "9:16",
29
+ "21:9"
30
+ ]
31
+ },
32
+ "duration_seconds": {
33
+ "required": true,
34
+ "min": 4,
35
+ "max": 12,
36
+ "type": "integer"
37
+ },
38
+ "output_resolution": {
39
+ "enum": [
40
+ "480p",
41
+ "720p",
42
+ "1080p"
43
+ ]
44
+ }
45
+ },
46
+ "seedance-2-mini": {
47
+ "aspect_ratio": {
48
+ "enum": [
49
+ "1:1",
50
+ "4:3",
51
+ "3:4",
52
+ "16:9",
53
+ "9:16",
54
+ "21:9",
55
+ "auto"
56
+ ]
57
+ },
58
+ "duration_seconds": {
59
+ "min": 4,
60
+ "max": 15,
61
+ "type": "integer"
62
+ },
63
+ "output_resolution": {
64
+ "enum": [
65
+ "480p",
66
+ "720p"
67
+ ]
68
+ }
69
+ },
70
+ "seedance-2.0": {
71
+ "aspect_ratio": {
72
+ "enum": [
73
+ "1:1",
74
+ "4:3",
75
+ "3:4",
76
+ "16:9",
77
+ "9:16",
78
+ "21:9",
79
+ "auto"
80
+ ]
81
+ },
82
+ "duration_seconds": {
83
+ "min": 4,
84
+ "max": 15,
85
+ "type": "integer"
86
+ },
87
+ "output_resolution": {
88
+ "enum": [
89
+ "480p",
90
+ "720p",
91
+ "1080p"
92
+ ]
93
+ }
94
+ },
95
+ "seedance-2.0-fast": {
96
+ "aspect_ratio": {
97
+ "enum": [
98
+ "1:1",
99
+ "4:3",
100
+ "3:4",
101
+ "16:9",
102
+ "9:16",
103
+ "21:9",
104
+ "auto"
105
+ ]
106
+ },
107
+ "duration_seconds": {
108
+ "min": 4,
109
+ "max": 15,
110
+ "type": "integer"
111
+ },
112
+ "output_resolution": {
113
+ "enum": [
114
+ "480p",
115
+ "720p"
116
+ ]
117
+ }
118
+ },
119
+ "seedance-v1-lite": {
120
+ "aspect_ratio": {
121
+ "enum": [
122
+ "1:1",
123
+ "4:3",
124
+ "3:4",
125
+ "16:9",
126
+ "9:16",
127
+ "9:21"
128
+ ]
129
+ },
130
+ "duration_seconds": {
131
+ "enum": [
132
+ 5,
133
+ 10
134
+ ],
135
+ "required": true,
136
+ "type": "integer"
137
+ },
138
+ "output_resolution": {
139
+ "enum": [
140
+ "480p",
141
+ "720p",
142
+ "1080p"
143
+ ]
144
+ },
145
+ "seed": {
146
+ "type": "integer"
147
+ }
148
+ },
149
+ "seedance-v1-pro": {
150
+ "aspect_ratio": {
151
+ "enum": [
152
+ "1:1",
153
+ "4:3",
154
+ "3:4",
155
+ "16:9",
156
+ "9:16",
157
+ "21:9"
158
+ ]
159
+ },
160
+ "duration_seconds": {
161
+ "enum": [
162
+ 5,
163
+ 10
164
+ ],
165
+ "required": true,
166
+ "type": "integer"
167
+ },
168
+ "output_resolution": {
169
+ "enum": [
170
+ "480p",
171
+ "720p",
172
+ "1080p"
173
+ ]
174
+ },
175
+ "seed": {
176
+ "type": "integer"
177
+ }
178
+ },
179
+ "seedance-v1-pro-fast": {
180
+ "duration_seconds": {
181
+ "enum": [
182
+ 5,
183
+ 10
184
+ ],
185
+ "required": true,
186
+ "type": "integer"
187
+ },
188
+ "first_frame_image_url": {
189
+ "required": true
190
+ },
191
+ "output_resolution": {
192
+ "enum": [
193
+ "720p",
194
+ "1080p"
195
+ ]
196
+ }
197
+ }
198
+ }
199
+ }
200
+ };
201
+
202
+ // src/resources/text-to-video.ts
7
203
  var ENDPOINT = "/api/v1/seedance/text_to_video";
8
204
  var TextToVideo = class {
9
205
  constructor(http) {
10
206
  this.http = http;
11
207
  }
12
208
  http;
209
+ /**
210
+ * Create a text to video task and wait until complete.
211
+ * @param params Text to video parameters.
212
+ * @param options Per-request and polling overrides.
213
+ * @returns The completed text to video response.
214
+ */
13
215
  async run(params, options) {
14
216
  const { id } = await this.create(params, options);
15
217
  const response = await pollUntilComplete(() => this.get(id, options), {
@@ -18,12 +220,26 @@ var TextToVideo = class {
18
220
  });
19
221
  return response;
20
222
  }
223
+ /**
224
+ * Create a text to video task; returns immediately with a task id.
225
+ * @param params Text to video parameters.
226
+ * @param options Per-request overrides.
227
+ * @returns The task creation result.
228
+ */
21
229
  async create(params, options) {
230
+ const body = compactParams(params);
231
+ validateParams(contract["text-to-video"], body);
22
232
  return this.http.request("POST", ENDPOINT, {
23
- body: compactParams(params),
233
+ body,
24
234
  ...options
25
235
  });
26
236
  }
237
+ /**
238
+ * Fetch the current status of a text to video task.
239
+ * @param id The task id.
240
+ * @param options Per-request overrides.
241
+ * @returns The current text to video task status.
242
+ */
27
243
  async get(id, options) {
28
244
  return this.http.request("GET", `${ENDPOINT}/${id}`, {
29
245
  ...options
@@ -32,12 +248,12 @@ var TextToVideo = class {
32
248
  };
33
249
 
34
250
  // src/client.ts
35
- var SeedanceClient = class {
251
+ var SeedanceClient = class extends BaseClient {
36
252
  /** Video generation operations. */
37
253
  textToVideo;
38
254
  constructor(options = {}) {
39
- const http = createHttpClient(options);
40
- this.textToVideo = new TextToVideo(http);
255
+ super(options);
256
+ this.textToVideo = new TextToVideo(this.http);
41
257
  }
42
258
  };
43
259
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client.ts","../src/resources/text-to-video.ts","../src/index.ts"],"sourcesContent":["import { createHttpClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToVideo } from './resources/text-to-video';\n\n/**\n * Seedance video API client.\n *\n * @example\n * ```typescript\n * const client = new SeedanceClient({\n * apiKey: 'your-api-key',\n * baseUrl: 'https://runapi.ai',\n * });\n *\n * const result = await client.textToVideo.run({\n * model: 'seedance-2.0',\n * prompt: 'A cat walking through a garden',\n * });\n * ```\n */\nexport class SeedanceClient {\n /** Video generation operations. */\n public readonly textToVideo: TextToVideo;\n\n constructor(options: ClientOptions = {}) {\n const http = createHttpClient(options);\n this.textToVideo = new TextToVideo(http);\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedTextToVideoResponse,\n TextToVideoParams,\n TextToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/seedance/text_to_video';\n\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export { SeedanceClient } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n"],"mappings":";AAAA,SAAS,wBAA4C;;;ACCrD,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAQlC,IAAM,WAAW;AAEV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA2B,SAAkF;AACrH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,MAAM,kBAAuC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACzF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAO,QAA2B,SAAuD;AAC7F,WAAO,KAAK,KAAK,QAA4B,QAAQ,UAAU;AAAA,MAC7D,MAAM,cAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAAwD;AAC5E,WAAO,KAAK,KAAK,QAA6B,OAAO,GAAG,QAAQ,IAAI,EAAE,IAAI;AAAA,MACxE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ADjBO,IAAM,iBAAN,MAAqB;AAAA;AAAA,EAEV;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO,iBAAiB,OAAO;AACrC,SAAK,cAAc,IAAI,YAAY,IAAI;AAAA,EACzC;AACF;;;AExBA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
1
+ {"version":3,"sources":["../src/client.ts","../src/resources/text-to-video.ts","../src/contract_gen.ts","../src/index.ts"],"sourcesContent":["import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToVideo } from './resources/text-to-video';\n\n/**\n * Seedance video API client.\n *\n * @example\n * ```typescript\n * const client = new SeedanceClient({\n * apiKey: 'your-api-key',\n * baseUrl: 'https://runapi.ai',\n * });\n *\n * const result = await client.textToVideo.run({\n * model: 'seedance-2.0',\n * prompt: 'A cat walking through a garden',\n * });\n * ```\n */\nexport class SeedanceClient extends BaseClient {\n /** Video generation operations. */\n public readonly textToVideo: TextToVideo;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToVideo = new TextToVideo(this.http);\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedTextToVideoResponse,\n TextToVideoParams,\n TextToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/seedance/text_to_video';\n\n/** Generate video from text prompts, optionally conditioned on reference images, frame images, reference videos, or audio. */\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create a text to video task and wait until complete.\n * @param params Text to video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed text to video response.\n */\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n /**\n * Create a text to video task; returns immediately with a task id.\n * @param params Text to video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result.\n */\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['text-to-video'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of a text to video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text to video task status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export const contract = {\n \"text-to-video\": {\n \"models\": [\n \"seedance-1.5-pro\",\n \"seedance-2-mini\",\n \"seedance-2.0\",\n \"seedance-2.0-fast\",\n \"seedance-v1-lite\",\n \"seedance-v1-pro\",\n \"seedance-v1-pro-fast\"\n ],\n \"fields_by_model\": {\n \"seedance-1.5-pro\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"21:9\"\n ]\n },\n \"duration_seconds\": {\n \"required\": true,\n \"min\": 4,\n \"max\": 12,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"480p\",\n \"720p\",\n \"1080p\"\n ]\n }\n },\n \"seedance-2-mini\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"duration_seconds\": {\n \"min\": 4,\n \"max\": 15,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"480p\",\n \"720p\"\n ]\n }\n },\n \"seedance-2.0\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"duration_seconds\": {\n \"min\": 4,\n \"max\": 15,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"480p\",\n \"720p\",\n \"1080p\"\n ]\n }\n },\n \"seedance-2.0-fast\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"duration_seconds\": {\n \"min\": 4,\n \"max\": 15,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"480p\",\n \"720p\"\n ]\n }\n },\n \"seedance-v1-lite\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"9:21\"\n ]\n },\n \"duration_seconds\": {\n \"enum\": [\n 5,\n 10\n ],\n \"required\": true,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"480p\",\n \"720p\",\n \"1080p\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"seedance-v1-pro\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"21:9\"\n ]\n },\n \"duration_seconds\": {\n \"enum\": [\n 5,\n 10\n ],\n \"required\": true,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"480p\",\n \"720p\",\n \"1080p\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"seedance-v1-pro-fast\": {\n \"duration_seconds\": {\n \"enum\": [\n 5,\n 10\n ],\n \"required\": true,\n \"type\": \"integer\"\n },\n \"first_frame_image_url\": {\n \"required\": true\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n }\n }\n }\n }\n} as const;\n","export { SeedanceClient } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n"],"mappings":";AAAA,SAAS,kBAAsC;;;ACC/C,SAAS,eAAe,sBAAsB;AAC9C,SAAS,yBAAyB;;;ACF3B,IAAM,WAAW;AAAA,EACtB,iBAAiB;AAAA,IACf,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,oBAAoB;AAAA,QAClB,gBAAgB;AAAA,UACd,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,oBAAoB;AAAA,UAClB,YAAY;AAAA,UACZ,OAAO;AAAA,UACP,OAAO;AAAA,UACP,QAAQ;AAAA,QACV;AAAA,QACA,qBAAqB;AAAA,UACnB,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,MACA,mBAAmB;AAAA,QACjB,gBAAgB;AAAA,UACd,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,oBAAoB;AAAA,UAClB,OAAO;AAAA,UACP,OAAO;AAAA,UACP,QAAQ;AAAA,QACV;A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AAK,QAA4B,QAAQ,UAAU;AAAA,MAC7D;AAAA,MACA,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,IAAI,IAAY,SAAwD;AAC5E,WAAO,KAAK,KAAK,QAA6B,OAAO,GAAG,QAAQ,IAAI,EAAE,IAAI;AAAA,MACxE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ADvCO,IAAM,iBAAN,cAA6B,WAAW;AAAA;AAAA,EAE7B;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAAA,EAC9C;AACF;;;AGxBA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@runapi.ai/seedance",
3
- "version": "0.2.6",
4
- "description": "RunAPI Seedance SDK for JavaScript, Ruby, and Go",
3
+ "runapi": {
4
+ "slug": "seedance"
5
+ },
6
+ "version": "0.2.8",
7
+ "description": "RunAPI Seedance SDK for text-to-video workflows in JavaScript, Python, Ruby, Go, Java, and PHP",
5
8
  "main": "./dist/index.js",
6
9
  "module": "./dist/index.mjs",
7
10
  "types": "./dist/index.d.ts",
@@ -28,7 +31,7 @@
28
31
  "clean": "rm -rf dist"
29
32
  },
30
33
  "dependencies": {
31
- "@runapi.ai/core": "^0.2.5"
34
+ "@runapi.ai/core": "^0.2.9"
32
35
  },
33
36
  "devDependencies": {
34
37
  "@types/node": "^20.0.0",
@@ -49,8 +52,16 @@
49
52
  "api",
50
53
  "sdk",
51
54
  "typescript",
55
+ "python",
52
56
  "ruby",
53
- "golang"
57
+ "golang",
58
+ "java",
59
+ "maven",
60
+ "gradle",
61
+ "video-generation",
62
+ "text-to-video",
63
+ "video-api",
64
+ "seedance-api"
54
65
  ],
55
66
  "author": "RunAPI",
56
67
  "license": "Apache-2.0",
@@ -58,5 +69,8 @@
58
69
  "repository": {
59
70
  "type": "git",
60
71
  "url": "git+https://github.com/runapi-ai/seedance-sdk.git"
72
+ },
73
+ "bugs": {
74
+ "url": "https://github.com/runapi-ai/seedance-sdk/issues"
61
75
  }
62
76
  }
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
  <br/>
23
23
 
24
- Generate video with Seedance 1.5 Pro, 2.0, and 2.0 Fast text-to-video and image-to-video. This skill helps Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents integrate Seedance through RunAPI.
24
+ Generate video with Seedance 1.5 Pro, 2.0, 2.0 Fast, and 2.0 Mini text-to-video and image-to-video. This skill helps Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents integrate Seedance through RunAPI.
25
25
 
26
26
  The canonical agent file is `skills/seedance/SKILL.md`.
27
27
 
@@ -76,12 +76,15 @@ const url = result.videos[0].url;
76
76
  - [1.5 pro](https://runapi.ai/models/seedance/1.5-pro)
77
77
  - [2.0](https://runapi.ai/models/seedance/2.0)
78
78
  - [2.0 fast](https://runapi.ai/models/seedance/2.0-fast)
79
+ - [2.0 mini](https://runapi.ai/models/seedance/2-mini)
79
80
 
80
81
  ## Agent rules
81
82
 
83
+ - Integration work uses the target language SDK; one-off generation, manual smoke tests, debugging, or user-requested CLI runs use the RunAPI CLI skill: https://github.com/runapi-ai/cli-skill
84
+ - RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
82
85
  - Keep API keys in `RUNAPI_API_KEY` or RunAPI CLI config; never commit secrets.
83
86
  - Prefer `create`, `get`, and `run` JSON passthrough patterns instead of inventing flags for every model parameter.
84
- - For seedance api pricing, rate-limit, and commercial-usage answers, link to the variant page rather than the repository README.
87
+ - For pricing, rate-limit, and commercial-usage answers, link to the variant page rather than the repository README.
85
88
 
86
89
  ## License
87
90
 
@@ -25,14 +25,24 @@ metadata:
25
25
 
26
26
  Generate and edit video with Seedance through RunAPI. The default path for one-off agent tasks is the `runapi` CLI; SDKs are for application integration.
27
27
 
28
- ## Routing decision
28
+ ## Critical: Integration Runtime
29
29
 
30
- - One-off generation, editing, or transformation for the user use the **CLI path** with the `runapi` binary.
31
- - Building an app, backend, worker, library, or production codebase use the **SDK integration path**.
30
+ - Integration work (app, backend, worker, library, Rails service, Node service, Go service, webhook pipeline, or production codebase) uses the **SDK integration path** for the target language.
31
+ - One-off generation, editing, transformation, manual smoke tests, debugging, or user-requested CLI runs use the **CLI path** with the `runapi` binary. For full CLI-specific agent guidance, see https://github.com/runapi-ai/cli-skill.
32
+ - Never shell out to the `runapi` CLI as the production runtime integration layer.
33
+
34
+ ## SDK integration path
35
+
36
+ When integrating Seedance into an app, backend, worker, library, Rails service, Node service, Go service, webhook pipeline, or production workflow, start by checking the current SDK package and official usage. Confirm install commands, client methods (`create`, `get`, `run`), request fields, response shape, and error classes before using CLI help or raw HTTP examples. Use a RunAPI SDK package:
37
+
38
+ - JavaScript / TypeScript: `@runapi.ai/seedance`
39
+ - PHP: `runapi-ai/seedance`
40
+ - Ruby: `runapi-seedance`
41
+ - Go: `github.com/runapi-ai/seedance-sdk/go`
32
42
 
33
43
  ## CLI path
34
44
 
35
- The `runapi` binary is the runtime dependency. Run `runapi auth status` first. For agents and headless runs, prefer `RUNAPI_API_KEY` or import it into saved config with `printf '%s' "$RUNAPI_API_KEY" | runapi auth import-token --token -`. Use `runapi login` only when the user explicitly wants interactive browser auth.
45
+ The `runapi` binary is the one-off and manual testing runtime dependency. For full CLI-specific agent guidance, see https://github.com/runapi-ai/cli-skill. Run `runapi auth status` first. For agents and headless runs, prefer `RUNAPI_API_KEY` or import it into saved config with `printf '%s' "$RUNAPI_API_KEY" | runapi auth import-token --token -`. Use `runapi login` only when the user explicitly wants interactive browser auth.
36
46
 
37
47
  Inspect the available commands and request fields with CLI help:
38
48
 
@@ -56,13 +66,9 @@ runapi wait <task-id> --service seedance --action text-to-video
56
66
 
57
67
  Available commands: `text-to-video`.
58
68
 
59
- ## SDK integration path
60
-
61
- When integrating Seedance into an app, backend, worker, or library — not for one-off tasks — use a RunAPI SDK package:
69
+ ## Generated file storage
62
70
 
63
- - JavaScript / TypeScript: `@runapi.ai/seedance`
64
- - Ruby: `runapi-seedance`
65
- - Go: `github.com/runapi-ai/seedance-sdk/go`
71
+ RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
66
72
 
67
73
  ## References
68
74
 
@@ -78,4 +84,4 @@ When integrating Seedance into an app, backend, worker, or library — not for o
78
84
  - [1.5 pro](https://runapi.ai/models/seedance/1.5-pro.md)
79
85
  - [2.0](https://runapi.ai/models/seedance/2.0.md)
80
86
  - [2.0 fast](https://runapi.ai/models/seedance/2.0-fast.md)
81
-
87
+ - [2.0 mini](https://runapi.ai/models/seedance/2-mini.md)