@ai-sdk/bytedance 0.0.0-b66d09a8-20260328011513

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/CHANGELOG.md ADDED
@@ -0,0 +1,120 @@
1
+ # @ai-sdk/bytedance
2
+
3
+ ## 0.0.0-b66d09a8-20260328011513
4
+
5
+ ### Major Changes
6
+
7
+ - 8359612: Start v7 pre-release
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [531251e]
12
+ - Updated dependencies [1f509d4]
13
+ - Updated dependencies [5c2a5a2]
14
+ - Updated dependencies [f7d4f01]
15
+ - Updated dependencies [776b617]
16
+ - Updated dependencies [3887c70]
17
+ - Updated dependencies [61753c3]
18
+ - Updated dependencies [8359612]
19
+ - @ai-sdk/provider-utils@0.0.0-b66d09a8-20260328011513
20
+ - @ai-sdk/provider@0.0.0-b66d09a8-20260328011513
21
+
22
+ ## 2.0.0-beta.7
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [1f509d4]
27
+ - @ai-sdk/provider-utils@5.0.0-beta.7
28
+ - @ai-sdk/provider@4.0.0-beta.5
29
+
30
+ ## 2.0.0-beta.6
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [3887c70]
35
+ - @ai-sdk/provider-utils@5.0.0-beta.6
36
+ - @ai-sdk/provider@4.0.0-beta.4
37
+
38
+ ## 2.0.0-beta.5
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [776b617]
43
+ - @ai-sdk/provider-utils@5.0.0-beta.5
44
+ - @ai-sdk/provider@4.0.0-beta.3
45
+
46
+ ## 2.0.0-beta.4
47
+
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies [61753c3]
51
+ - @ai-sdk/provider-utils@5.0.0-beta.4
52
+
53
+ ## 2.0.0-beta.3
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies [f7d4f01]
58
+ - @ai-sdk/provider-utils@5.0.0-beta.3
59
+ - @ai-sdk/provider@4.0.0-beta.2
60
+
61
+ ## 2.0.0-beta.2
62
+
63
+ ### Patch Changes
64
+
65
+ - Updated dependencies [5c2a5a2]
66
+ - @ai-sdk/provider@4.0.0-beta.1
67
+ - @ai-sdk/provider-utils@5.0.0-beta.2
68
+
69
+ ## 2.0.0-beta.1
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies [531251e]
74
+ - @ai-sdk/provider-utils@5.0.0-beta.1
75
+
76
+ ## 2.0.0-beta.0
77
+
78
+ ### Major Changes
79
+
80
+ - 8359612: Start v7 pre-release
81
+
82
+ ### Patch Changes
83
+
84
+ - Updated dependencies [8359612]
85
+ - @ai-sdk/provider@4.0.0-beta.0
86
+ - @ai-sdk/provider-utils@5.0.0-beta.0
87
+
88
+ ## 1.0.4
89
+
90
+ ### Patch Changes
91
+
92
+ - Updated dependencies [ad4cfc2]
93
+ - @ai-sdk/provider-utils@4.0.19
94
+
95
+ ## 1.0.3
96
+
97
+ ### Patch Changes
98
+
99
+ - Updated dependencies [824b295]
100
+ - @ai-sdk/provider-utils@4.0.18
101
+
102
+ ## 1.0.2
103
+
104
+ ### Patch Changes
105
+
106
+ - Updated dependencies [08336f1]
107
+ - @ai-sdk/provider-utils@4.0.17
108
+
109
+ ## 1.0.1
110
+
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies [58bc42d]
114
+ - @ai-sdk/provider-utils@4.0.16
115
+
116
+ ## 1.0.0
117
+
118
+ ### Major Changes
119
+
120
+ - 15a9e21: feat (provider/bytedance): initial bytedance provider
package/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2023 Vercel, Inc.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,202 @@
1
+ # AI SDK - ByteDance Provider
2
+
3
+ The **ByteDance provider** for the [AI SDK](https://ai-sdk.dev/docs) contains video model support for ByteDance's Seedance family of video generation models through the [BytePlus ModelArk](https://docs.byteplus.com/en/docs/ModelArk/Video_Generation_API) platform.
4
+
5
+ ## Setup
6
+
7
+ The ByteDance provider is available in the `@ai-sdk/bytedance` module. You can install it with:
8
+
9
+ ```bash
10
+ npm i @ai-sdk/bytedance
11
+ ```
12
+
13
+ ## Skill for Coding Agents
14
+
15
+ If you use coding agents such as Claude Code or Cursor, we highly recommend adding the AI SDK skill to your repository:
16
+
17
+ ```shell
18
+ npx skills add vercel/ai
19
+ ```
20
+
21
+ ## Provider Instance
22
+
23
+ You can import the default provider instance `byteDance` from `@ai-sdk/bytedance`:
24
+
25
+ ```ts
26
+ import { byteDance } from '@ai-sdk/bytedance';
27
+ ```
28
+
29
+ ## Video Models
30
+
31
+ This provider supports text-to-video, image-to-video, audio-video sync, first-and-last frame control, and multi-reference image generation.
32
+
33
+ ### Text-to-Video
34
+
35
+ Generate video from a text prompt.
36
+
37
+ Available models: `seedance-1-5-pro-251215`, `seedance-1-0-pro-250528`, `seedance-1-0-pro-fast-251015`, `seedance-1-0-lite-t2v-250428`
38
+
39
+ ```ts
40
+ import { byteDance } from '@ai-sdk/bytedance';
41
+ import { experimental_generateVideo as generateVideo } from 'ai';
42
+
43
+ const { video } = await generateVideo({
44
+ model: byteDance.video('seedance-1-0-pro-250528'),
45
+ prompt: 'A cat playing with a ball of yarn in a sunlit room',
46
+ aspectRatio: '16:9',
47
+ duration: 5,
48
+ providerOptions: {
49
+ bytedance: {
50
+ watermark: false,
51
+ },
52
+ },
53
+ });
54
+
55
+ console.log(video.url);
56
+ ```
57
+
58
+ ### Image-to-Video
59
+
60
+ Generate video from a first-frame image with an optional text prompt.
61
+
62
+ Available models: `seedance-1-5-pro-251215`, `seedance-1-0-pro-250528`, `seedance-1-0-pro-fast-251015`, `seedance-1-0-lite-i2v-250428`
63
+
64
+ ```ts
65
+ import { byteDance } from '@ai-sdk/bytedance';
66
+ import { experimental_generateVideo as generateVideo } from 'ai';
67
+
68
+ const { video } = await generateVideo({
69
+ model: byteDance.video('seedance-1-5-pro-251215'),
70
+ prompt: {
71
+ image: 'https://example.com/first-frame.png',
72
+ text: 'The cat slowly turns its head and blinks',
73
+ },
74
+ duration: 5,
75
+ providerOptions: {
76
+ bytedance: {
77
+ watermark: false,
78
+ },
79
+ },
80
+ });
81
+ ```
82
+
83
+ ### Image-to-Video with Audio
84
+
85
+ Seedance 1.5 Pro supports generating synchronized audio alongside the video.
86
+
87
+ ```ts
88
+ import { byteDance } from '@ai-sdk/bytedance';
89
+ import { experimental_generateVideo as generateVideo } from 'ai';
90
+
91
+ const { video } = await generateVideo({
92
+ model: byteDance.video('seedance-1-5-pro-251215'),
93
+ prompt: {
94
+ image: 'https://example.com/pianist.png',
95
+ text: 'A young man sits at a piano, playing calmly. Gentle piano music plays in sync.',
96
+ },
97
+ duration: 5,
98
+ providerOptions: {
99
+ bytedance: {
100
+ generateAudio: true,
101
+ watermark: false,
102
+ },
103
+ },
104
+ });
105
+ ```
106
+
107
+ ### First-and-Last Frame Video
108
+
109
+ Generate smooth transitions between a starting and ending keyframe image.
110
+
111
+ ```ts
112
+ import { byteDance } from '@ai-sdk/bytedance';
113
+ import { experimental_generateVideo as generateVideo } from 'ai';
114
+
115
+ const { video } = await generateVideo({
116
+ model: byteDance.video('seedance-1-5-pro-251215'),
117
+ prompt: {
118
+ image: 'https://example.com/first-frame.jpg',
119
+ text: 'Create a 360-degree orbiting camera shot based on this photo',
120
+ },
121
+ duration: 5,
122
+ providerOptions: {
123
+ bytedance: {
124
+ lastFrameImage: 'https://example.com/last-frame.jpg',
125
+ generateAudio: true,
126
+ watermark: false,
127
+ },
128
+ },
129
+ });
130
+ ```
131
+
132
+ ### Multi-Reference Image-to-Video
133
+
134
+ Provide multiple reference images (1-4) that the model uses to faithfully reproduce object shapes, colors, and textures. Use `[Image 1]`, `[Image 2]`, etc. in your prompt to reference specific images.
135
+
136
+ Available models: `seedance-1-0-lite-i2v-250428`
137
+
138
+ ```ts
139
+ import { byteDance } from '@ai-sdk/bytedance';
140
+ import { experimental_generateVideo as generateVideo } from 'ai';
141
+
142
+ const { video } = await generateVideo({
143
+ model: byteDance.video('seedance-1-0-lite-i2v-250428'),
144
+ prompt:
145
+ 'A boy from [Image 1] and a corgi from [Image 2], sitting on the lawn from [Image 3]',
146
+ aspectRatio: '16:9',
147
+ duration: 5,
148
+ providerOptions: {
149
+ bytedance: {
150
+ referenceImages: [
151
+ 'https://example.com/boy.png',
152
+ 'https://example.com/corgi.png',
153
+ 'https://example.com/lawn.png',
154
+ ],
155
+ watermark: false,
156
+ },
157
+ },
158
+ });
159
+ ```
160
+
161
+ ## Provider Options
162
+
163
+ Use `providerOptions.bytedance` to configure video generation:
164
+
165
+ | Option | Description |
166
+ | ----------------- | -------------------------------------------------------------------------------------- |
167
+ | `watermark` | Whether to add a watermark to the generated video |
168
+ | `generateAudio` | Generate synchronized audio (Seedance 1.5 Pro only) |
169
+ | `cameraFixed` | Whether to fix the camera during generation |
170
+ | `returnLastFrame` | Return the last frame of the generated video (useful for chaining) |
171
+ | `serviceTier` | `'default'` for online inference, `'flex'` for offline at 50% price |
172
+ | `draft` | Enable draft mode for low-cost 480p preview generation (Seedance 1.5 Pro only) |
173
+ | `lastFrameImage` | URL of last frame image for first-and-last frame generation |
174
+ | `referenceImages` | Array of reference image URLs (1-4) for multi-reference generation (1.0 Lite I2V only) |
175
+ | `pollIntervalMs` | Poll interval for async generation (default: 3000ms) |
176
+ | `pollTimeoutMs` | Max wait time for generation (default: 300000ms) |
177
+
178
+ Supported aspect ratios: `16:9`, `4:3`, `1:1`, `3:4`, `9:16`, `21:9`, `adaptive` (image-to-video only).
179
+
180
+ ## Authentication
181
+
182
+ Set the `ARK_API_KEY` environment variable:
183
+
184
+ ```
185
+ ARK_API_KEY=your-api-key
186
+ ```
187
+
188
+ Or pass it directly:
189
+
190
+ ```ts
191
+ import { createByteDance } from '@ai-sdk/bytedance';
192
+
193
+ const byteDance = createByteDance({
194
+ apiKey: 'your-api-key',
195
+ });
196
+ ```
197
+
198
+ You can [obtain an API key](https://console.byteplus.com/ark/apiKey) from the BytePlus console.
199
+
200
+ ## Documentation
201
+
202
+ Please check out the **[ByteDance provider](https://ai-sdk.dev/providers/ai-sdk-providers/bytedance)** for more information.
@@ -0,0 +1,62 @@
1
+ import { ProviderV4, Experimental_VideoModelV4 } from '@ai-sdk/provider';
2
+ import { FetchFunction } from '@ai-sdk/provider-utils';
3
+
4
+ type ByteDanceVideoModelId = 'seedance-1-5-pro-251215' | 'seedance-1-0-pro-250528' | 'seedance-1-0-pro-fast-251015' | 'seedance-1-0-lite-t2v-250428' | 'seedance-1-0-lite-i2v-250428' | (string & {});
5
+
6
+ interface ByteDanceProviderSettings {
7
+ /**
8
+ * ByteDance Ark API key. Default value is taken from the `ARK_API_KEY`
9
+ * environment variable.
10
+ */
11
+ apiKey?: string;
12
+ /**
13
+ * Base URL for the API calls.
14
+ * Default: https://ark.ap-southeast.bytepluses.com/api/v3
15
+ */
16
+ baseURL?: string;
17
+ /**
18
+ * Custom headers to include in the requests.
19
+ */
20
+ headers?: Record<string, string>;
21
+ /**
22
+ * Custom fetch implementation. You can use it as a middleware to intercept
23
+ * requests, or to provide a custom fetch implementation for e.g. testing.
24
+ */
25
+ fetch?: FetchFunction;
26
+ }
27
+ interface ByteDanceProvider extends ProviderV4 {
28
+ /**
29
+ * Creates a model for video generation.
30
+ */
31
+ video(modelId: ByteDanceVideoModelId): Experimental_VideoModelV4;
32
+ /**
33
+ * Creates a model for video generation.
34
+ */
35
+ videoModel(modelId: ByteDanceVideoModelId): Experimental_VideoModelV4;
36
+ }
37
+ /**
38
+ * Create a ByteDance provider instance.
39
+ */
40
+ declare function createByteDance(options?: ByteDanceProviderSettings): ByteDanceProvider;
41
+ /**
42
+ * Default ByteDance provider instance.
43
+ */
44
+ declare const byteDance: ByteDanceProvider;
45
+
46
+ type ByteDanceVideoProviderOptions = {
47
+ watermark?: boolean | null;
48
+ generateAudio?: boolean | null;
49
+ cameraFixed?: boolean | null;
50
+ returnLastFrame?: boolean | null;
51
+ serviceTier?: 'default' | 'flex' | null;
52
+ draft?: boolean | null;
53
+ lastFrameImage?: string | null;
54
+ referenceImages?: string[] | null;
55
+ pollIntervalMs?: number | null;
56
+ pollTimeoutMs?: number | null;
57
+ [key: string]: unknown;
58
+ };
59
+
60
+ declare const VERSION: string;
61
+
62
+ export { type ByteDanceProvider, type ByteDanceProviderSettings, type ByteDanceVideoModelId, type ByteDanceVideoProviderOptions, VERSION, byteDance, createByteDance };
@@ -0,0 +1,62 @@
1
+ import { ProviderV4, Experimental_VideoModelV4 } from '@ai-sdk/provider';
2
+ import { FetchFunction } from '@ai-sdk/provider-utils';
3
+
4
+ type ByteDanceVideoModelId = 'seedance-1-5-pro-251215' | 'seedance-1-0-pro-250528' | 'seedance-1-0-pro-fast-251015' | 'seedance-1-0-lite-t2v-250428' | 'seedance-1-0-lite-i2v-250428' | (string & {});
5
+
6
+ interface ByteDanceProviderSettings {
7
+ /**
8
+ * ByteDance Ark API key. Default value is taken from the `ARK_API_KEY`
9
+ * environment variable.
10
+ */
11
+ apiKey?: string;
12
+ /**
13
+ * Base URL for the API calls.
14
+ * Default: https://ark.ap-southeast.bytepluses.com/api/v3
15
+ */
16
+ baseURL?: string;
17
+ /**
18
+ * Custom headers to include in the requests.
19
+ */
20
+ headers?: Record<string, string>;
21
+ /**
22
+ * Custom fetch implementation. You can use it as a middleware to intercept
23
+ * requests, or to provide a custom fetch implementation for e.g. testing.
24
+ */
25
+ fetch?: FetchFunction;
26
+ }
27
+ interface ByteDanceProvider extends ProviderV4 {
28
+ /**
29
+ * Creates a model for video generation.
30
+ */
31
+ video(modelId: ByteDanceVideoModelId): Experimental_VideoModelV4;
32
+ /**
33
+ * Creates a model for video generation.
34
+ */
35
+ videoModel(modelId: ByteDanceVideoModelId): Experimental_VideoModelV4;
36
+ }
37
+ /**
38
+ * Create a ByteDance provider instance.
39
+ */
40
+ declare function createByteDance(options?: ByteDanceProviderSettings): ByteDanceProvider;
41
+ /**
42
+ * Default ByteDance provider instance.
43
+ */
44
+ declare const byteDance: ByteDanceProvider;
45
+
46
+ type ByteDanceVideoProviderOptions = {
47
+ watermark?: boolean | null;
48
+ generateAudio?: boolean | null;
49
+ cameraFixed?: boolean | null;
50
+ returnLastFrame?: boolean | null;
51
+ serviceTier?: 'default' | 'flex' | null;
52
+ draft?: boolean | null;
53
+ lastFrameImage?: string | null;
54
+ referenceImages?: string[] | null;
55
+ pollIntervalMs?: number | null;
56
+ pollTimeoutMs?: number | null;
57
+ [key: string]: unknown;
58
+ };
59
+
60
+ declare const VERSION: string;
61
+
62
+ export { type ByteDanceProvider, type ByteDanceProviderSettings, type ByteDanceVideoModelId, type ByteDanceVideoProviderOptions, VERSION, byteDance, createByteDance };