@runapi.ai/seedance 0.2.1 → 0.2.6
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 +1 -1
- package/dist/index.d.mts +36 -38
- package/dist/index.d.ts +36 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -5
- package/skills/seedance/README.md +34 -2
- package/skills/seedance/SKILL.md +54 -184
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Seedance API 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
|
|
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.
|
|
4
4
|
|
|
5
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.
|
|
6
6
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, 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' | 'seedance-2-fast' | 'seedance-v1-lite' | 'seedance-v1-pro' | 'seedance-v1-pro-fast';
|
|
5
|
-
type SeedanceModel2 = 'seedance-2' | 'seedance-2-fast';
|
|
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';
|
|
6
6
|
type SeedanceModelV1 = 'seedance-v1-lite' | 'seedance-v1-pro' | 'seedance-v1-pro-fast';
|
|
7
7
|
type AspectRatio15Pro = '1:1' | '4:3' | '3:4' | '16:9' | '9:16' | '21:9';
|
|
8
8
|
type AspectRatio2 = AspectRatio15Pro | 'auto';
|
|
@@ -12,7 +12,7 @@ type Resolution15Pro = '480p' | '720p' | '1080p';
|
|
|
12
12
|
type Resolution2 = '480p' | '720p' | '1080p';
|
|
13
13
|
type ResolutionV1 = '480p' | '720p' | '1080p';
|
|
14
14
|
type ResolutionV1ProFast = '720p' | '1080p';
|
|
15
|
-
type DurationV1 =
|
|
15
|
+
type DurationV1 = 5 | 10;
|
|
16
16
|
interface GenerationCommonParams {
|
|
17
17
|
/** Text description of desired video content */
|
|
18
18
|
prompt: string;
|
|
@@ -20,8 +20,8 @@ interface GenerationCommonParams {
|
|
|
20
20
|
callback_url?: string;
|
|
21
21
|
/** Generate audio track for the video */
|
|
22
22
|
generate_audio?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
|
|
23
|
+
/** Content safety check toggle */
|
|
24
|
+
enable_safety_checker?: boolean;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* seedance-1.5-pro generation parameters.
|
|
@@ -31,11 +31,11 @@ interface Generation15ProParams extends GenerationCommonParams {
|
|
|
31
31
|
model: 'seedance-1.5-pro';
|
|
32
32
|
/** Required for seedance-1.5-pro */
|
|
33
33
|
aspect_ratio: AspectRatio15Pro;
|
|
34
|
-
|
|
34
|
+
output_resolution?: Resolution15Pro;
|
|
35
35
|
/** Fixed values: 4, 8, or 12 seconds */
|
|
36
|
-
|
|
37
|
-
/** Up to 2 image URLs for image-to-video */
|
|
38
|
-
|
|
36
|
+
duration_seconds: 4 | 8 | 12;
|
|
37
|
+
/** Up to 2 source image URLs for image-to-video */
|
|
38
|
+
source_image_urls?: string[];
|
|
39
39
|
/** Lock camera movement */
|
|
40
40
|
lock_camera?: boolean;
|
|
41
41
|
}
|
|
@@ -43,31 +43,31 @@ interface Generation15ProParams extends GenerationCommonParams {
|
|
|
43
43
|
interface Generation2BaseParams extends GenerationCommonParams {
|
|
44
44
|
model: SeedanceModel2;
|
|
45
45
|
aspect_ratio?: AspectRatio2;
|
|
46
|
-
|
|
46
|
+
output_resolution?: Resolution2;
|
|
47
47
|
/** Integer 4-15 */
|
|
48
|
-
|
|
48
|
+
duration_seconds?: number;
|
|
49
49
|
/** Enable web search for prompt enrichment. */
|
|
50
50
|
web_search?: boolean;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* seedance-2/2-fast text-to-video mode.
|
|
53
|
+
* seedance-2.0/2-fast text-to-video mode.
|
|
54
54
|
* Pure text prompt, no image/reference inputs.
|
|
55
55
|
*/
|
|
56
56
|
interface Generation2TextParams extends Generation2BaseParams {
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* seedance-2/2-fast frame mode.
|
|
59
|
+
* seedance-2.0/2-fast frame mode.
|
|
60
60
|
* Guide generation with first (required) and optional last frame images.
|
|
61
61
|
* Mutually exclusive with reference mode.
|
|
62
62
|
*/
|
|
63
63
|
interface Generation2FrameParams extends Generation2BaseParams {
|
|
64
64
|
/** First frame image URL (required for frame mode) */
|
|
65
|
-
|
|
65
|
+
first_frame_image_url: string;
|
|
66
66
|
/** Last frame image URL */
|
|
67
|
-
|
|
67
|
+
last_frame_image_url?: string;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* seedance-2/2-fast reference mode.
|
|
70
|
+
* seedance-2.0/2-fast reference mode.
|
|
71
71
|
* Guide generation with reference images, videos, or audio.
|
|
72
72
|
* Mutually exclusive with frame mode.
|
|
73
73
|
*/
|
|
@@ -81,50 +81,48 @@ interface Generation2ReferenceParams extends Generation2BaseParams {
|
|
|
81
81
|
}
|
|
82
82
|
/** Common fields for v1-lite and v1-pro (not v1-pro-fast). */
|
|
83
83
|
interface GenerationV1SharedParams extends GenerationCommonParams {
|
|
84
|
-
/** `
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
/** `5` or `10`. Required. */
|
|
85
|
+
duration_seconds: DurationV1;
|
|
86
|
+
output_resolution?: ResolutionV1;
|
|
87
87
|
/** Lock camera movement */
|
|
88
88
|
lock_camera?: boolean;
|
|
89
89
|
/** Random seed; `-1` for random. Integer in [-1, 2147483647]. */
|
|
90
90
|
seed?: number;
|
|
91
|
-
/** Safety checker toggle */
|
|
92
|
-
enable_safety_checker?: boolean;
|
|
93
91
|
}
|
|
94
92
|
/**
|
|
95
93
|
* seedance-v1-lite text-to-video or image-to-video. Mode is auto-detected by
|
|
96
|
-
* `
|
|
94
|
+
* `first_frame_image_url` presence. `last_frame_image_url` is only valid in image-to-video mode.
|
|
97
95
|
*/
|
|
98
96
|
interface GenerationV1LiteParams extends GenerationV1SharedParams {
|
|
99
97
|
model: 'seedance-v1-lite';
|
|
100
|
-
/** Required in text-to-video mode. Omit when `
|
|
98
|
+
/** Required in text-to-video mode. Omit when `first_frame_image_url` is set. */
|
|
101
99
|
aspect_ratio?: AspectRatioV1Lite;
|
|
102
|
-
/**
|
|
103
|
-
|
|
100
|
+
/** First frame image URL. Triggers image-to-video mode when set. */
|
|
101
|
+
first_frame_image_url?: string;
|
|
104
102
|
/** Ending frame image URL; image-to-video mode only. */
|
|
105
|
-
|
|
103
|
+
last_frame_image_url?: string;
|
|
106
104
|
}
|
|
107
105
|
/**
|
|
108
106
|
* seedance-v1-pro text-to-video or image-to-video. Mode is auto-detected by
|
|
109
|
-
* `
|
|
107
|
+
* `first_frame_image_url` presence.
|
|
110
108
|
*/
|
|
111
109
|
interface GenerationV1ProParams extends GenerationV1SharedParams {
|
|
112
110
|
model: 'seedance-v1-pro';
|
|
113
|
-
/** Required in text-to-video mode. Omit when `
|
|
111
|
+
/** Required in text-to-video mode. Omit when `first_frame_image_url` is set. */
|
|
114
112
|
aspect_ratio?: AspectRatioV1Pro;
|
|
115
|
-
/**
|
|
116
|
-
|
|
113
|
+
/** First frame image URL. Triggers image-to-video mode when set. */
|
|
114
|
+
first_frame_image_url?: string;
|
|
117
115
|
}
|
|
118
116
|
/**
|
|
119
117
|
* seedance-v1-pro-fast image-to-video only. Smaller parameter surface —
|
|
120
|
-
* no `aspect_ratio`, `lock_camera`,
|
|
118
|
+
* no `aspect_ratio`, `lock_camera`, or `seed`.
|
|
121
119
|
*/
|
|
122
120
|
interface GenerationV1ProFastParams extends GenerationCommonParams {
|
|
123
121
|
model: 'seedance-v1-pro-fast';
|
|
124
|
-
/** Required
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
/** Required first frame image URL. */
|
|
123
|
+
first_frame_image_url: string;
|
|
124
|
+
output_resolution?: ResolutionV1ProFast;
|
|
125
|
+
duration_seconds: DurationV1;
|
|
128
126
|
}
|
|
129
127
|
/** Discriminated union of all generation parameter variants */
|
|
130
128
|
type TextToVideoParams = Generation15ProParams | Generation2TextParams | Generation2FrameParams | Generation2ReferenceParams | GenerationV1LiteParams | GenerationV1ProParams | GenerationV1ProFastParams;
|
|
@@ -138,13 +136,13 @@ interface TextToVideoResponse {
|
|
|
138
136
|
id: string;
|
|
139
137
|
status: AsyncTaskStatus;
|
|
140
138
|
videos?: VideoMetadata[];
|
|
141
|
-
|
|
139
|
+
last_frame_image_url?: string;
|
|
142
140
|
error?: string;
|
|
143
141
|
[key: string]: unknown;
|
|
144
142
|
}
|
|
145
143
|
/**
|
|
146
144
|
* Resolved response returned by the `run()` method after polling sees
|
|
147
|
-
* `status: 'completed'`. Narrows `videos` to non-optional; `
|
|
145
|
+
* `status: 'completed'`. Narrows `videos` to non-optional; `last_frame_image_url`
|
|
148
146
|
* stays optional because it may be absent.
|
|
149
147
|
*/
|
|
150
148
|
type CompletedTextToVideoResponse = TextToVideoResponse & {
|
|
@@ -171,7 +169,7 @@ declare class TextToVideo {
|
|
|
171
169
|
* });
|
|
172
170
|
*
|
|
173
171
|
* const result = await client.textToVideo.run({
|
|
174
|
-
* model: 'seedance-2',
|
|
172
|
+
* model: 'seedance-2.0',
|
|
175
173
|
* prompt: 'A cat walking through a garden',
|
|
176
174
|
* });
|
|
177
175
|
* ```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, 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' | 'seedance-2-fast' | 'seedance-v1-lite' | 'seedance-v1-pro' | 'seedance-v1-pro-fast';
|
|
5
|
-
type SeedanceModel2 = 'seedance-2' | 'seedance-2-fast';
|
|
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';
|
|
6
6
|
type SeedanceModelV1 = 'seedance-v1-lite' | 'seedance-v1-pro' | 'seedance-v1-pro-fast';
|
|
7
7
|
type AspectRatio15Pro = '1:1' | '4:3' | '3:4' | '16:9' | '9:16' | '21:9';
|
|
8
8
|
type AspectRatio2 = AspectRatio15Pro | 'auto';
|
|
@@ -12,7 +12,7 @@ type Resolution15Pro = '480p' | '720p' | '1080p';
|
|
|
12
12
|
type Resolution2 = '480p' | '720p' | '1080p';
|
|
13
13
|
type ResolutionV1 = '480p' | '720p' | '1080p';
|
|
14
14
|
type ResolutionV1ProFast = '720p' | '1080p';
|
|
15
|
-
type DurationV1 =
|
|
15
|
+
type DurationV1 = 5 | 10;
|
|
16
16
|
interface GenerationCommonParams {
|
|
17
17
|
/** Text description of desired video content */
|
|
18
18
|
prompt: string;
|
|
@@ -20,8 +20,8 @@ interface GenerationCommonParams {
|
|
|
20
20
|
callback_url?: string;
|
|
21
21
|
/** Generate audio track for the video */
|
|
22
22
|
generate_audio?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
|
|
23
|
+
/** Content safety check toggle */
|
|
24
|
+
enable_safety_checker?: boolean;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* seedance-1.5-pro generation parameters.
|
|
@@ -31,11 +31,11 @@ interface Generation15ProParams extends GenerationCommonParams {
|
|
|
31
31
|
model: 'seedance-1.5-pro';
|
|
32
32
|
/** Required for seedance-1.5-pro */
|
|
33
33
|
aspect_ratio: AspectRatio15Pro;
|
|
34
|
-
|
|
34
|
+
output_resolution?: Resolution15Pro;
|
|
35
35
|
/** Fixed values: 4, 8, or 12 seconds */
|
|
36
|
-
|
|
37
|
-
/** Up to 2 image URLs for image-to-video */
|
|
38
|
-
|
|
36
|
+
duration_seconds: 4 | 8 | 12;
|
|
37
|
+
/** Up to 2 source image URLs for image-to-video */
|
|
38
|
+
source_image_urls?: string[];
|
|
39
39
|
/** Lock camera movement */
|
|
40
40
|
lock_camera?: boolean;
|
|
41
41
|
}
|
|
@@ -43,31 +43,31 @@ interface Generation15ProParams extends GenerationCommonParams {
|
|
|
43
43
|
interface Generation2BaseParams extends GenerationCommonParams {
|
|
44
44
|
model: SeedanceModel2;
|
|
45
45
|
aspect_ratio?: AspectRatio2;
|
|
46
|
-
|
|
46
|
+
output_resolution?: Resolution2;
|
|
47
47
|
/** Integer 4-15 */
|
|
48
|
-
|
|
48
|
+
duration_seconds?: number;
|
|
49
49
|
/** Enable web search for prompt enrichment. */
|
|
50
50
|
web_search?: boolean;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* seedance-2/2-fast text-to-video mode.
|
|
53
|
+
* seedance-2.0/2-fast text-to-video mode.
|
|
54
54
|
* Pure text prompt, no image/reference inputs.
|
|
55
55
|
*/
|
|
56
56
|
interface Generation2TextParams extends Generation2BaseParams {
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* seedance-2/2-fast frame mode.
|
|
59
|
+
* seedance-2.0/2-fast frame mode.
|
|
60
60
|
* Guide generation with first (required) and optional last frame images.
|
|
61
61
|
* Mutually exclusive with reference mode.
|
|
62
62
|
*/
|
|
63
63
|
interface Generation2FrameParams extends Generation2BaseParams {
|
|
64
64
|
/** First frame image URL (required for frame mode) */
|
|
65
|
-
|
|
65
|
+
first_frame_image_url: string;
|
|
66
66
|
/** Last frame image URL */
|
|
67
|
-
|
|
67
|
+
last_frame_image_url?: string;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* seedance-2/2-fast reference mode.
|
|
70
|
+
* seedance-2.0/2-fast reference mode.
|
|
71
71
|
* Guide generation with reference images, videos, or audio.
|
|
72
72
|
* Mutually exclusive with frame mode.
|
|
73
73
|
*/
|
|
@@ -81,50 +81,48 @@ interface Generation2ReferenceParams extends Generation2BaseParams {
|
|
|
81
81
|
}
|
|
82
82
|
/** Common fields for v1-lite and v1-pro (not v1-pro-fast). */
|
|
83
83
|
interface GenerationV1SharedParams extends GenerationCommonParams {
|
|
84
|
-
/** `
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
/** `5` or `10`. Required. */
|
|
85
|
+
duration_seconds: DurationV1;
|
|
86
|
+
output_resolution?: ResolutionV1;
|
|
87
87
|
/** Lock camera movement */
|
|
88
88
|
lock_camera?: boolean;
|
|
89
89
|
/** Random seed; `-1` for random. Integer in [-1, 2147483647]. */
|
|
90
90
|
seed?: number;
|
|
91
|
-
/** Safety checker toggle */
|
|
92
|
-
enable_safety_checker?: boolean;
|
|
93
91
|
}
|
|
94
92
|
/**
|
|
95
93
|
* seedance-v1-lite text-to-video or image-to-video. Mode is auto-detected by
|
|
96
|
-
* `
|
|
94
|
+
* `first_frame_image_url` presence. `last_frame_image_url` is only valid in image-to-video mode.
|
|
97
95
|
*/
|
|
98
96
|
interface GenerationV1LiteParams extends GenerationV1SharedParams {
|
|
99
97
|
model: 'seedance-v1-lite';
|
|
100
|
-
/** Required in text-to-video mode. Omit when `
|
|
98
|
+
/** Required in text-to-video mode. Omit when `first_frame_image_url` is set. */
|
|
101
99
|
aspect_ratio?: AspectRatioV1Lite;
|
|
102
|
-
/**
|
|
103
|
-
|
|
100
|
+
/** First frame image URL. Triggers image-to-video mode when set. */
|
|
101
|
+
first_frame_image_url?: string;
|
|
104
102
|
/** Ending frame image URL; image-to-video mode only. */
|
|
105
|
-
|
|
103
|
+
last_frame_image_url?: string;
|
|
106
104
|
}
|
|
107
105
|
/**
|
|
108
106
|
* seedance-v1-pro text-to-video or image-to-video. Mode is auto-detected by
|
|
109
|
-
* `
|
|
107
|
+
* `first_frame_image_url` presence.
|
|
110
108
|
*/
|
|
111
109
|
interface GenerationV1ProParams extends GenerationV1SharedParams {
|
|
112
110
|
model: 'seedance-v1-pro';
|
|
113
|
-
/** Required in text-to-video mode. Omit when `
|
|
111
|
+
/** Required in text-to-video mode. Omit when `first_frame_image_url` is set. */
|
|
114
112
|
aspect_ratio?: AspectRatioV1Pro;
|
|
115
|
-
/**
|
|
116
|
-
|
|
113
|
+
/** First frame image URL. Triggers image-to-video mode when set. */
|
|
114
|
+
first_frame_image_url?: string;
|
|
117
115
|
}
|
|
118
116
|
/**
|
|
119
117
|
* seedance-v1-pro-fast image-to-video only. Smaller parameter surface —
|
|
120
|
-
* no `aspect_ratio`, `lock_camera`,
|
|
118
|
+
* no `aspect_ratio`, `lock_camera`, or `seed`.
|
|
121
119
|
*/
|
|
122
120
|
interface GenerationV1ProFastParams extends GenerationCommonParams {
|
|
123
121
|
model: 'seedance-v1-pro-fast';
|
|
124
|
-
/** Required
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
/** Required first frame image URL. */
|
|
123
|
+
first_frame_image_url: string;
|
|
124
|
+
output_resolution?: ResolutionV1ProFast;
|
|
125
|
+
duration_seconds: DurationV1;
|
|
128
126
|
}
|
|
129
127
|
/** Discriminated union of all generation parameter variants */
|
|
130
128
|
type TextToVideoParams = Generation15ProParams | Generation2TextParams | Generation2FrameParams | Generation2ReferenceParams | GenerationV1LiteParams | GenerationV1ProParams | GenerationV1ProFastParams;
|
|
@@ -138,13 +136,13 @@ interface TextToVideoResponse {
|
|
|
138
136
|
id: string;
|
|
139
137
|
status: AsyncTaskStatus;
|
|
140
138
|
videos?: VideoMetadata[];
|
|
141
|
-
|
|
139
|
+
last_frame_image_url?: string;
|
|
142
140
|
error?: string;
|
|
143
141
|
[key: string]: unknown;
|
|
144
142
|
}
|
|
145
143
|
/**
|
|
146
144
|
* Resolved response returned by the `run()` method after polling sees
|
|
147
|
-
* `status: 'completed'`. Narrows `videos` to non-optional; `
|
|
145
|
+
* `status: 'completed'`. Narrows `videos` to non-optional; `last_frame_image_url`
|
|
148
146
|
* stays optional because it may be absent.
|
|
149
147
|
*/
|
|
150
148
|
type CompletedTextToVideoResponse = TextToVideoResponse & {
|
|
@@ -171,7 +169,7 @@ declare class TextToVideo {
|
|
|
171
169
|
* });
|
|
172
170
|
*
|
|
173
171
|
* const result = await client.textToVideo.run({
|
|
174
|
-
* model: 'seedance-2',
|
|
172
|
+
* model: 'seedance-2.0',
|
|
175
173
|
* prompt: 'A cat walking through a garden',
|
|
176
174
|
* });
|
|
177
175
|
* ```
|
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',\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"],"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"]}
|
package/dist/index.mjs.map
CHANGED
|
@@ -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',\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/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":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runapi.ai/seedance",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "RunAPI Seedance SDK for JavaScript, Ruby, and Go",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -25,12 +25,10 @@
|
|
|
25
25
|
"build": "tsup",
|
|
26
26
|
"test": "vitest run",
|
|
27
27
|
"typecheck": "tsc --noEmit",
|
|
28
|
-
"clean": "rm -rf dist"
|
|
29
|
-
"test:text2video": "dotenv -e manual-tests/.env -- tsx manual-tests/test-text-to-video.ts",
|
|
30
|
-
"test:manual": "pnpm run test:text2video"
|
|
28
|
+
"clean": "rm -rf dist"
|
|
31
29
|
},
|
|
32
30
|
"dependencies": {
|
|
33
|
-
"@runapi.ai/core": "^0.2.
|
|
31
|
+
"@runapi.ai/core": "^0.2.5"
|
|
34
32
|
},
|
|
35
33
|
"devDependencies": {
|
|
36
34
|
"@types/node": "^20.0.0",
|
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/runapi-ai/seedance">
|
|
3
|
+
<h3 align="center">Seedance API Skill for RunAPI</h3>
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
Install this agent skill, inspect Seedance fields, then run jobs through the RunAPI CLI.
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://runapi.ai/models/seedance"><strong>Model Reference</strong></a> · <a href="https://github.com/runapi-ai/cli"><strong>CLI</strong></a> · <a href="https://github.com/runapi-ai/seedance-sdk"><strong>SDK</strong></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<div align="center">
|
|
16
|
+
|
|
17
|
+
[](https://www.skills.sh/runapi-ai/seedance/seedance)
|
|
18
|
+
[](https://clawhub.ai/runapi-ai/runapi-seedance)
|
|
19
|
+
[](https://github.com/runapi-ai/seedance/blob/main/LICENSE)
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
<br/>
|
|
2
23
|
|
|
3
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.
|
|
4
25
|
|
|
@@ -10,7 +31,18 @@ The canonical agent file is `skills/seedance/SKILL.md`.
|
|
|
10
31
|
npx skills add runapi-ai/seedance -g
|
|
11
32
|
```
|
|
12
33
|
|
|
13
|
-
Or
|
|
34
|
+
Or paste this prompt to your AI agent:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
Install the seedance skill for me:
|
|
38
|
+
|
|
39
|
+
1. Clone https://github.com/runapi-ai/seedance
|
|
40
|
+
2. Copy the skills/seedance/ directory into your
|
|
41
|
+
user-level skills directory (e.g. ~/.claude/skills/
|
|
42
|
+
for Claude Code, ~/.codex/skills/ for Codex).
|
|
43
|
+
3. Verify that SKILL.md is present.
|
|
44
|
+
4. Confirm the install path when done.
|
|
45
|
+
```
|
|
14
46
|
|
|
15
47
|
## Quick example
|
|
16
48
|
|
package/skills/seedance/SKILL.md
CHANGED
|
@@ -1,211 +1,81 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: seedance
|
|
3
|
-
description: Generate
|
|
4
|
-
documentation: https://runapi.ai/models/seedance
|
|
5
|
-
provider_page: https://runapi.ai/providers/bytedance
|
|
6
|
-
catalog: https://runapi.ai/models
|
|
3
|
+
description: Generate and edit video with Seedance through RunAPI. Use when the user asks an agent to create, edit, or transform video with Seedance. Default to the RunAPI CLI for one-off generation; use SDKs only when the user is integrating RunAPI into an app or backend.
|
|
4
|
+
documentation: https://runapi.ai/models/seedance.md
|
|
5
|
+
provider_page: https://runapi.ai/providers/bytedance.md
|
|
6
|
+
catalog: https://runapi.ai/models.md
|
|
7
|
+
metadata:
|
|
8
|
+
openclaw:
|
|
9
|
+
homepage: https://runapi.ai/models/seedance
|
|
10
|
+
requires:
|
|
11
|
+
bins:
|
|
12
|
+
- runapi
|
|
13
|
+
install:
|
|
14
|
+
- kind: brew
|
|
15
|
+
formula: runapi-ai/tap/runapi
|
|
16
|
+
bins:
|
|
17
|
+
- runapi
|
|
18
|
+
envVars:
|
|
19
|
+
- name: RUNAPI_API_KEY
|
|
20
|
+
required: false
|
|
21
|
+
description: Optional RunAPI API key; agents should prefer environment auth or saved CLI config. Browser login is interactive fallback only.
|
|
7
22
|
---
|
|
8
|
-
# @runapi.ai/seedance — RunAPI.ai Seedance video generation
|
|
9
23
|
|
|
10
|
-
|
|
24
|
+
# Seedance on RunAPI
|
|
11
25
|
|
|
12
|
-
|
|
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.
|
|
13
27
|
|
|
14
|
-
|
|
28
|
+
## Routing decision
|
|
15
29
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
```
|
|
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**.
|
|
19
32
|
|
|
20
|
-
|
|
33
|
+
## CLI path
|
|
21
34
|
|
|
22
|
-
|
|
23
|
-
# .env
|
|
24
|
-
RUNAPI_API_KEY=runapi_xxx # get one at https://runapi.ai/settings/api_keys
|
|
25
|
-
```
|
|
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.
|
|
26
36
|
|
|
27
|
-
|
|
28
|
-
import { SeedanceClient } from '@runapi.ai/seedance';
|
|
37
|
+
Inspect the available commands and request fields with CLI help:
|
|
29
38
|
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
```shell
|
|
40
|
+
runapi seedance --help
|
|
41
|
+
runapi seedance text-to-video --help
|
|
32
42
|
```
|
|
33
43
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
## Core recipe — text to video
|
|
44
|
+
Run a one-off task (synchronous — polls until the task completes):
|
|
37
45
|
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
model: 'seedance-2',
|
|
41
|
-
prompt: 'A drone shot over mountains at sunset',
|
|
42
|
-
aspect_ratio: '16:9',
|
|
43
|
-
duration: 8,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const url = result.videos[0].url;
|
|
46
|
+
```shell
|
|
47
|
+
runapi seedance text-to-video --input-file request.json
|
|
47
48
|
```
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
Submit asynchronously and poll separately:
|
|
50
51
|
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const status = await client.textToVideo.get(id);
|
|
55
|
-
if (status.status === 'completed') { /* ... */ }
|
|
52
|
+
```shell
|
|
53
|
+
runapi seedance text-to-video --async --input-file request.json
|
|
54
|
+
runapi wait <task-id> --service seedance --action text-to-video
|
|
56
55
|
```
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
`run()` polls every 2 s for up to 15 min by default. Tune when needed:
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
await client.textToVideo.run(params, { maxWaitMs: 30 * 60_000, pollIntervalMs: 5_000 });
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
If `TaskTimeoutError` fires, the task is still running server-side — resume with `textToVideo.get(id)` or finish via webhook.
|
|
67
|
-
|
|
68
|
-
## Image-to-video (seedance-1.5-pro)
|
|
69
|
-
|
|
70
|
-
```ts
|
|
71
|
-
await client.textToVideo.run({
|
|
72
|
-
model: 'seedance-1.5-pro',
|
|
73
|
-
prompt: 'The flower blooms and petals scatter',
|
|
74
|
-
aspect_ratio: '16:9',
|
|
75
|
-
input_urls: ['https://cdn.example.com/flower.jpg'],
|
|
76
|
-
resolution: '1080p',
|
|
77
|
-
duration: 8,
|
|
78
|
-
lock_camera: true, // lock camera movement
|
|
79
|
-
});
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Frame mode (seedance-2 / 2-fast)
|
|
83
|
-
|
|
84
|
-
Guide with first (required) and optional last frame. **Mutually exclusive with reference mode.**
|
|
85
|
-
|
|
86
|
-
```ts
|
|
87
|
-
await client.textToVideo.run({
|
|
88
|
-
model: 'seedance-2',
|
|
89
|
-
prompt: 'A sunrise over the ocean',
|
|
90
|
-
first_frame_url: 'https://cdn.example.com/start.jpg',
|
|
91
|
-
last_frame_url: 'https://cdn.example.com/end.jpg',
|
|
92
|
-
});
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Reference mode (seedance-2 / 2-fast)
|
|
96
|
-
|
|
97
|
-
Guide with reference images, videos, or audio. **Mutually exclusive with frame mode.**
|
|
98
|
-
|
|
99
|
-
```ts
|
|
100
|
-
await client.textToVideo.run({
|
|
101
|
-
model: 'seedance-2',
|
|
102
|
-
prompt: 'A person dancing in the same style',
|
|
103
|
-
reference_video_urls: ['https://cdn.example.com/dance.mp4'],
|
|
104
|
-
reference_audio_urls: ['https://cdn.example.com/beat.mp3'],
|
|
105
|
-
});
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## Models
|
|
109
|
-
|
|
110
|
-
| `model` | Modes | Notes |
|
|
111
|
-
|---|---|---|
|
|
112
|
-
| `seedance-1.5-pro` | text-to-video, image-to-video (`input_urls`), `lock_camera` | `aspect_ratio` required. `resolution`: `480p` / `720p` / `1080p`. `duration`: 4 / 8 / 12. |
|
|
113
|
-
| `seedance-2` | text / frame / reference | `resolution`: `480p` / `720p` / `1080p`. `duration`: integer 4–15. |
|
|
114
|
-
| `seedance-2-fast` | text / frame / reference | Faster, cheaper variant of `seedance-2`. `resolution`: `480p` / `720p`. |
|
|
115
|
-
| `seedance-v1-lite` | text-to-video, image-to-video (auto-detected via `input_urls`) | `aspect_ratio` required in text mode (`…, 9:21`). `resolution`: `480p` / `720p` / `1080p`. `duration`: `"5"` or `"10"`. Image mode supports `last_frame_url`. Extras: `seed`, `enable_safety_checker`, `lock_camera`. |
|
|
116
|
-
| `seedance-v1-pro` | text-to-video, image-to-video (auto-detected via `input_urls`) | Same as v1-lite but `aspect_ratio` set is `…, 21:9`. No `last_frame_url`. |
|
|
117
|
-
| `seedance-v1-pro-fast` | image-to-video only | `input_urls` required. `resolution`: `720p` / `1080p`. `duration`: `"5"` or `"10"`. Narrow param set — no `aspect_ratio` / `lock_camera` / `seed` / `enable_safety_checker`. |
|
|
118
|
-
|
|
119
|
-
Exact credit costs per model are shown at https://runapi.ai/pricing and in the dashboard — do not hardcode prices in application code.
|
|
120
|
-
|
|
121
|
-
## Callbacks (webhooks)
|
|
122
|
-
|
|
123
|
-
Pass `callback_url` on `create()` (or any `run()` call) and RunAPI will POST the final payload to you:
|
|
124
|
-
|
|
125
|
-
```ts
|
|
126
|
-
await client.textToVideo.create({
|
|
127
|
-
model: 'seedance-2',
|
|
128
|
-
prompt: '...',
|
|
129
|
-
callback_url: 'https://your.app/webhooks/runapi/seedance',
|
|
130
|
-
});
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Payload shape:
|
|
134
|
-
|
|
135
|
-
```ts
|
|
136
|
-
{ id: string; status: 'completed' | 'failed'; videos?: { url: string }[]; last_frame_url?: string; error?: string }
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
**Always verify the signature before trusting the body.** RunAPI signs every callback with your account's Callback Secret (rotate at `/accounts/callback_secret`). Headers:
|
|
140
|
-
|
|
141
|
-
- `X-Callback-Id` — UUID, store to make handler idempotent
|
|
142
|
-
- `X-Callback-Timestamp` — unix seconds, reject if `|now - ts| > 300`
|
|
143
|
-
- `X-Callback-Signature` — base64 HMAC-SHA256 over `` `${id}.${ts}.${rawBody}` `` using the base64-decoded secret
|
|
144
|
-
|
|
145
|
-
```ts
|
|
146
|
-
import crypto from 'node:crypto';
|
|
147
|
-
|
|
148
|
-
function verify(raw: string, id: string, ts: string, sig: string, secret: string) {
|
|
149
|
-
const key = Buffer.from(secret, 'base64');
|
|
150
|
-
const mac = crypto.createHmac('sha256', key)
|
|
151
|
-
.update(`${id}.${ts}.${raw}`)
|
|
152
|
-
.digest('base64');
|
|
153
|
-
return crypto.timingSafeEqual(Buffer.from(mac), Buffer.from(sig));
|
|
154
|
-
}
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Reply `2xx` within 10s; any non-2xx triggers retries.
|
|
158
|
-
|
|
159
|
-
## Errors
|
|
160
|
-
|
|
161
|
-
All errors are re-exported from `@runapi.ai/core`. Always `instanceof` — never string-match messages.
|
|
162
|
-
|
|
163
|
-
| Error | Status | Action |
|
|
164
|
-
|---|---|---|
|
|
165
|
-
| `AuthenticationError` | 401 | abort; surface "reconnect your API key" |
|
|
166
|
-
| `InsufficientCreditsError` | 402 | prompt user to top up at runapi.ai/billing |
|
|
167
|
-
| `ValidationError` | 400 / 422 | fix params; do not retry |
|
|
168
|
-
| `RateLimitError` | 429 | sleep `err.retryAfterMs`, then retry |
|
|
169
|
-
| `ServiceUnavailableError` | 503 / 455 | retry with backoff; transient service issue |
|
|
170
|
-
| `TaskFailedError` | — | show `err.details` to user; do not auto-retry |
|
|
171
|
-
| `TaskTimeoutError` | — | re-poll with `textToVideo.get(id)` |
|
|
172
|
-
|
|
173
|
-
```ts
|
|
174
|
-
import { InsufficientCreditsError, TaskFailedError } from '@runapi.ai/seedance';
|
|
175
|
-
|
|
176
|
-
try {
|
|
177
|
-
await client.textToVideo.run({ model: 'seedance-2', prompt: '...' });
|
|
178
|
-
} catch (err) {
|
|
179
|
-
if (err instanceof InsufficientCreditsError) { /* surface top-up CTA */ }
|
|
180
|
-
else if (err instanceof TaskFailedError) { /* show err.details */ }
|
|
181
|
-
else throw err;
|
|
182
|
-
}
|
|
183
|
-
```
|
|
57
|
+
Available commands: `text-to-video`.
|
|
184
58
|
|
|
185
|
-
##
|
|
59
|
+
## SDK integration path
|
|
186
60
|
|
|
187
|
-
-
|
|
188
|
-
- For `seedance-1.5-pro`, `aspect_ratio` is required and `resolution`/`duration` use a different set of values than the 2.x models.
|
|
189
|
-
- For `seedance-2` / `seedance-2-fast`, **frame mode and reference mode are mutually exclusive** — do not send both `first_frame_url` and `reference_*_urls` in the same request.
|
|
190
|
-
- `aspect_ratio: 'auto'` is 2.x-only (useful with frame mode to inherit dimensions from the reference frame).
|
|
191
|
-
- `reference_audio_urls` requires at least one `reference_image_urls` or `reference_video_urls` to be set.
|
|
192
|
-
- `last_frame_url` is optional in the response and may be absent.
|
|
193
|
-
- `callback_url` must be reachable from the public internet. `localhost` / `127.0.0.1` URLs will never fire — use a tunnel (cloudflared, ngrok, tailscale funnel) when developing locally.
|
|
61
|
+
When integrating Seedance into an app, backend, worker, or library — not for one-off tasks — use a RunAPI SDK package:
|
|
194
62
|
|
|
195
|
-
|
|
63
|
+
- JavaScript / TypeScript: `@runapi.ai/seedance`
|
|
64
|
+
- Ruby: `runapi-seedance`
|
|
65
|
+
- Go: `github.com/runapi-ai/seedance-sdk/go`
|
|
196
66
|
|
|
197
|
-
|
|
67
|
+
## References
|
|
198
68
|
|
|
199
|
-
|
|
69
|
+
- Model overview, pricing, and rate limits: https://runapi.ai/models/seedance.md
|
|
70
|
+
- Provider comparison: https://runapi.ai/providers/bytedance.md
|
|
71
|
+
- Full model catalog: https://runapi.ai/models.md
|
|
200
72
|
|
|
201
|
-
|
|
73
|
+
## Variants
|
|
202
74
|
|
|
203
|
-
|
|
204
|
-
- [v1
|
|
205
|
-
- [v1 pro](https://runapi.ai/models/seedance/v1-pro)
|
|
206
|
-
- [
|
|
207
|
-
- [
|
|
208
|
-
- [2.0](https://runapi.ai/models/seedance/2.0)
|
|
209
|
-
- [2.0 fast](https://runapi.ai/models/seedance/2.0-fast)
|
|
75
|
+
- [v1 lite](https://runapi.ai/models/seedance/v1-lite.md)
|
|
76
|
+
- [v1 pro](https://runapi.ai/models/seedance/v1-pro.md)
|
|
77
|
+
- [v1 pro fast](https://runapi.ai/models/seedance/v1-pro-fast.md)
|
|
78
|
+
- [1.5 pro](https://runapi.ai/models/seedance/1.5-pro.md)
|
|
79
|
+
- [2.0](https://runapi.ai/models/seedance/2.0.md)
|
|
80
|
+
- [2.0 fast](https://runapi.ai/models/seedance/2.0-fast.md)
|
|
210
81
|
|
|
211
|
-
Compare Seedance with other Bytedance models at https://runapi.ai/providers/bytedance. Browse every RunAPI model and skill at https://runapi.ai/models. SDK repository: https://github.com/runapi-ai/seedance-sdk. Skill repository: https://github.com/runapi-ai/seedance.
|