@runapi.ai/seedream 0.2.8 → 0.2.9

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
@@ -30,6 +30,10 @@ Use `create` when you want to submit a task and return quickly, `get` when you n
30
30
 
31
31
  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.
32
32
 
33
+ ## Seedream 5 Pro
34
+
35
+ Use `seedream-5-pro-text-to-image` for generation and `seedream-5-pro-edit` for image editing. Both accept `output_quality`, optional `output_format`, and optional content safety checking; editing accepts up to 10 source image URLs.
36
+
33
37
  ## Language notes
34
38
 
35
39
  Use the TypeScript types in `src/types.ts` and the resource classes under `src/resources` when building image applications. The package exposes `textToImage` for text models and `editImage` for editing models. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
package/dist/index.d.mts CHANGED
@@ -2,18 +2,20 @@ import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient
2
2
  export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
3
 
4
4
  /** Union of all Seedream model identifiers across text-to-image and edit endpoints. */
5
- type SeedreamModel = 'seedream-4.5-text-to-image' | 'seedream-4.5-edit' | 'seedream-5-lite-text-to-image' | 'seedream-5-lite-edit' | 'seedream-v4-text-to-image' | 'seedream-v4-edit';
5
+ type SeedreamModel = 'seedream-4.5-text-to-image' | 'seedream-4.5-edit' | 'seedream-5-lite-text-to-image' | 'seedream-5-lite-edit' | 'seedream-5-pro-text-to-image' | 'seedream-5-pro-edit' | 'seedream-v4-text-to-image' | 'seedream-v4-edit';
6
6
  /** Models accepted by the text-to-image endpoint. */
7
- type TextToImageModel = 'seedream-4.5-text-to-image' | 'seedream-5-lite-text-to-image' | 'seedream-v4-text-to-image';
7
+ type TextToImageModel = 'seedream-4.5-text-to-image' | 'seedream-5-lite-text-to-image' | 'seedream-5-pro-text-to-image' | 'seedream-v4-text-to-image';
8
8
  /** Models accepted by the edit-image endpoint. */
9
- type EditImageModel = 'seedream-4.5-edit' | 'seedream-5-lite-edit' | 'seedream-v4-edit';
9
+ type EditImageModel = 'seedream-4.5-edit' | 'seedream-5-lite-edit' | 'seedream-5-pro-edit' | 'seedream-v4-edit';
10
10
  type AspectRatio = '1:1' | '4:3' | '3:4' | '16:9' | '9:16' | '2:3' | '3:2' | '21:9';
11
- /** Quality preset for 4.5 and 5-lite models. */
11
+ /** Quality preset for 4.5, 5-Lite, and 5 Pro models. */
12
12
  type OutputQuality = 'basic' | 'high';
13
+ /** Output image format for 5-Lite and 5 Pro models. */
14
+ type OutputFormat = 'png' | 'jpeg';
13
15
  /** Pixel resolution tier for V4 models. */
14
16
  type V4OutputResolution = '1k' | '2k' | '4k';
15
17
  /**
16
- * Shared parameters for 4.5 and 5-lite models.
18
+ * Shared parameters for 4.5, 5-Lite, and 5 Pro models.
17
19
  * Both `aspect_ratio` and `output_quality` are required for these model families.
18
20
  */
19
21
  interface ImageGenerationBaseParams {
@@ -52,11 +54,27 @@ interface Generation45EditImageParams extends ImageGenerationBaseParams {
52
54
  }
53
55
  interface Generation5LiteTextParams extends ImageGenerationBaseParams {
54
56
  model: 'seedream-5-lite-text-to-image';
57
+ /** Output image format (default: "png"). */
58
+ output_format?: OutputFormat;
55
59
  }
56
60
  interface Generation5LiteEditParams extends ImageGenerationBaseParams {
57
61
  model: 'seedream-5-lite-edit';
58
62
  /** Source image URLs to edit (up to 14 for 5-lite models). */
59
63
  source_image_urls: string[];
64
+ /** Output image format (default: "png"). */
65
+ output_format?: OutputFormat;
66
+ }
67
+ interface Generation5ProTextParams extends ImageGenerationBaseParams {
68
+ model: 'seedream-5-pro-text-to-image';
69
+ /** Output image format (default: "png"). */
70
+ output_format?: OutputFormat;
71
+ }
72
+ interface Generation5ProEditParams extends ImageGenerationBaseParams {
73
+ model: 'seedream-5-pro-edit';
74
+ /** Source image URLs to edit (up to 10 for 5 Pro models). */
75
+ source_image_urls: string[];
76
+ /** Output image format (default: "png"). */
77
+ output_format?: OutputFormat;
60
78
  }
61
79
  interface GenerationV4TextParams extends V4GenerationBaseParams {
62
80
  model: 'seedream-v4-text-to-image';
@@ -66,8 +84,8 @@ interface GenerationV4EditParams extends V4GenerationBaseParams {
66
84
  /** Source image URLs to edit (up to 10 for V4 models). */
67
85
  source_image_urls: string[];
68
86
  }
69
- type TextToImageParams = Generation45TextParams | Generation5LiteTextParams | GenerationV4TextParams;
70
- type EditImageParams = Generation45EditImageParams | Generation5LiteEditParams | GenerationV4EditParams;
87
+ type TextToImageParams = Generation45TextParams | Generation5LiteTextParams | Generation5ProTextParams | GenerationV4TextParams;
88
+ type EditImageParams = Generation45EditImageParams | Generation5LiteEditParams | Generation5ProEditParams | GenerationV4EditParams;
71
89
  interface TaskCreateResponse {
72
90
  id: string;
73
91
  }
@@ -99,8 +117,9 @@ type CompletedEditImageResponse = EditImageResponse & {
99
117
 
100
118
  /**
101
119
  * Generates images from text prompts across Seedream model versions.
102
- * Field requirements vary by model family: 4.5/5-lite require `aspect_ratio`
103
- * and `output_quality`; V4 uses `output_resolution` and supports `seed`/`output_count`.
120
+ * Field requirements vary by model family: 4.5/5-Lite/5 Pro require
121
+ * `aspect_ratio` and `output_quality`; V4 uses `output_resolution` and supports
122
+ * `seed`/`output_count`.
104
123
  */
105
124
  declare class TextToImage {
106
125
  private readonly http;
@@ -130,7 +149,7 @@ declare class TextToImage {
130
149
 
131
150
  /**
132
151
  * Modifies source images according to a text prompt.
133
- * V4 models accept up to 10 source images; 4.5 and 5-lite accept up to 14.
152
+ * 5 Pro and V4 accept up to 10 source images; 4.5 and 5-Lite accept up to 14.
134
153
  */
135
154
  declare class EditImage {
136
155
  private readonly http;
@@ -194,4 +213,4 @@ declare class SeedreamClient extends BaseClient {
194
213
  constructor(options?: ClientOptions);
195
214
  }
196
215
 
197
- export { type AspectRatio, type CompletedEditImageResponse, type CompletedTextToImageResponse, type EditImageModel, type EditImageParams, type EditImageResponse, type Generation45EditImageParams, type Generation45TextParams, type Generation5LiteEditParams, type Generation5LiteTextParams, type GenerationV4EditParams, type GenerationV4TextParams, type Image, type OutputQuality, SeedreamClient, type SeedreamModel, type TaskCreateResponse, type TextToImageModel, type TextToImageParams, type TextToImageResponse, type V4OutputResolution };
216
+ export { type AspectRatio, type CompletedEditImageResponse, type CompletedTextToImageResponse, type EditImageModel, type EditImageParams, type EditImageResponse, type Generation45EditImageParams, type Generation45TextParams, type Generation5LiteEditParams, type Generation5LiteTextParams, type Generation5ProEditParams, type Generation5ProTextParams, type GenerationV4EditParams, type GenerationV4TextParams, type Image, type OutputFormat, type OutputQuality, SeedreamClient, type SeedreamModel, type TaskCreateResponse, type TextToImageModel, type TextToImageParams, type TextToImageResponse, type V4OutputResolution };
package/dist/index.d.ts CHANGED
@@ -2,18 +2,20 @@ import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient
2
2
  export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
3
 
4
4
  /** Union of all Seedream model identifiers across text-to-image and edit endpoints. */
5
- type SeedreamModel = 'seedream-4.5-text-to-image' | 'seedream-4.5-edit' | 'seedream-5-lite-text-to-image' | 'seedream-5-lite-edit' | 'seedream-v4-text-to-image' | 'seedream-v4-edit';
5
+ type SeedreamModel = 'seedream-4.5-text-to-image' | 'seedream-4.5-edit' | 'seedream-5-lite-text-to-image' | 'seedream-5-lite-edit' | 'seedream-5-pro-text-to-image' | 'seedream-5-pro-edit' | 'seedream-v4-text-to-image' | 'seedream-v4-edit';
6
6
  /** Models accepted by the text-to-image endpoint. */
7
- type TextToImageModel = 'seedream-4.5-text-to-image' | 'seedream-5-lite-text-to-image' | 'seedream-v4-text-to-image';
7
+ type TextToImageModel = 'seedream-4.5-text-to-image' | 'seedream-5-lite-text-to-image' | 'seedream-5-pro-text-to-image' | 'seedream-v4-text-to-image';
8
8
  /** Models accepted by the edit-image endpoint. */
9
- type EditImageModel = 'seedream-4.5-edit' | 'seedream-5-lite-edit' | 'seedream-v4-edit';
9
+ type EditImageModel = 'seedream-4.5-edit' | 'seedream-5-lite-edit' | 'seedream-5-pro-edit' | 'seedream-v4-edit';
10
10
  type AspectRatio = '1:1' | '4:3' | '3:4' | '16:9' | '9:16' | '2:3' | '3:2' | '21:9';
11
- /** Quality preset for 4.5 and 5-lite models. */
11
+ /** Quality preset for 4.5, 5-Lite, and 5 Pro models. */
12
12
  type OutputQuality = 'basic' | 'high';
13
+ /** Output image format for 5-Lite and 5 Pro models. */
14
+ type OutputFormat = 'png' | 'jpeg';
13
15
  /** Pixel resolution tier for V4 models. */
14
16
  type V4OutputResolution = '1k' | '2k' | '4k';
15
17
  /**
16
- * Shared parameters for 4.5 and 5-lite models.
18
+ * Shared parameters for 4.5, 5-Lite, and 5 Pro models.
17
19
  * Both `aspect_ratio` and `output_quality` are required for these model families.
18
20
  */
19
21
  interface ImageGenerationBaseParams {
@@ -52,11 +54,27 @@ interface Generation45EditImageParams extends ImageGenerationBaseParams {
52
54
  }
53
55
  interface Generation5LiteTextParams extends ImageGenerationBaseParams {
54
56
  model: 'seedream-5-lite-text-to-image';
57
+ /** Output image format (default: "png"). */
58
+ output_format?: OutputFormat;
55
59
  }
56
60
  interface Generation5LiteEditParams extends ImageGenerationBaseParams {
57
61
  model: 'seedream-5-lite-edit';
58
62
  /** Source image URLs to edit (up to 14 for 5-lite models). */
59
63
  source_image_urls: string[];
64
+ /** Output image format (default: "png"). */
65
+ output_format?: OutputFormat;
66
+ }
67
+ interface Generation5ProTextParams extends ImageGenerationBaseParams {
68
+ model: 'seedream-5-pro-text-to-image';
69
+ /** Output image format (default: "png"). */
70
+ output_format?: OutputFormat;
71
+ }
72
+ interface Generation5ProEditParams extends ImageGenerationBaseParams {
73
+ model: 'seedream-5-pro-edit';
74
+ /** Source image URLs to edit (up to 10 for 5 Pro models). */
75
+ source_image_urls: string[];
76
+ /** Output image format (default: "png"). */
77
+ output_format?: OutputFormat;
60
78
  }
61
79
  interface GenerationV4TextParams extends V4GenerationBaseParams {
62
80
  model: 'seedream-v4-text-to-image';
@@ -66,8 +84,8 @@ interface GenerationV4EditParams extends V4GenerationBaseParams {
66
84
  /** Source image URLs to edit (up to 10 for V4 models). */
67
85
  source_image_urls: string[];
68
86
  }
69
- type TextToImageParams = Generation45TextParams | Generation5LiteTextParams | GenerationV4TextParams;
70
- type EditImageParams = Generation45EditImageParams | Generation5LiteEditParams | GenerationV4EditParams;
87
+ type TextToImageParams = Generation45TextParams | Generation5LiteTextParams | Generation5ProTextParams | GenerationV4TextParams;
88
+ type EditImageParams = Generation45EditImageParams | Generation5LiteEditParams | Generation5ProEditParams | GenerationV4EditParams;
71
89
  interface TaskCreateResponse {
72
90
  id: string;
73
91
  }
@@ -99,8 +117,9 @@ type CompletedEditImageResponse = EditImageResponse & {
99
117
 
100
118
  /**
101
119
  * Generates images from text prompts across Seedream model versions.
102
- * Field requirements vary by model family: 4.5/5-lite require `aspect_ratio`
103
- * and `output_quality`; V4 uses `output_resolution` and supports `seed`/`output_count`.
120
+ * Field requirements vary by model family: 4.5/5-Lite/5 Pro require
121
+ * `aspect_ratio` and `output_quality`; V4 uses `output_resolution` and supports
122
+ * `seed`/`output_count`.
104
123
  */
105
124
  declare class TextToImage {
106
125
  private readonly http;
@@ -130,7 +149,7 @@ declare class TextToImage {
130
149
 
131
150
  /**
132
151
  * Modifies source images according to a text prompt.
133
- * V4 models accept up to 10 source images; 4.5 and 5-lite accept up to 14.
152
+ * 5 Pro and V4 accept up to 10 source images; 4.5 and 5-Lite accept up to 14.
134
153
  */
135
154
  declare class EditImage {
136
155
  private readonly http;
@@ -194,4 +213,4 @@ declare class SeedreamClient extends BaseClient {
194
213
  constructor(options?: ClientOptions);
195
214
  }
196
215
 
197
- export { type AspectRatio, type CompletedEditImageResponse, type CompletedTextToImageResponse, type EditImageModel, type EditImageParams, type EditImageResponse, type Generation45EditImageParams, type Generation45TextParams, type Generation5LiteEditParams, type Generation5LiteTextParams, type GenerationV4EditParams, type GenerationV4TextParams, type Image, type OutputQuality, SeedreamClient, type SeedreamModel, type TaskCreateResponse, type TextToImageModel, type TextToImageParams, type TextToImageResponse, type V4OutputResolution };
216
+ export { type AspectRatio, type CompletedEditImageResponse, type CompletedTextToImageResponse, type EditImageModel, type EditImageParams, type EditImageResponse, type Generation45EditImageParams, type Generation45TextParams, type Generation5LiteEditParams, type Generation5LiteTextParams, type Generation5ProEditParams, type Generation5ProTextParams, type GenerationV4EditParams, type GenerationV4TextParams, type Image, type OutputFormat, type OutputQuality, SeedreamClient, type SeedreamModel, type TaskCreateResponse, type TextToImageModel, type TextToImageParams, type TextToImageResponse, type V4OutputResolution };
package/dist/index.js CHANGED
@@ -48,6 +48,7 @@ var contract = {
48
48
  "models": [
49
49
  "seedream-4.5-edit",
50
50
  "seedream-5-lite-edit",
51
+ "seedream-5-pro-edit",
51
52
  "seedream-v4-edit"
52
53
  ],
53
54
  "fields_by_model": {
@@ -99,6 +100,12 @@ var contract = {
99
100
  "output_count": {
100
101
  "type": "integer"
101
102
  },
103
+ "output_format": {
104
+ "enum": [
105
+ "png",
106
+ "jpeg"
107
+ ]
108
+ },
102
109
  "output_quality": {
103
110
  "enum": [
104
111
  "basic",
@@ -113,6 +120,43 @@ var contract = {
113
120
  "required": true
114
121
  }
115
122
  },
123
+ "seedream-5-pro-edit": {
124
+ "aspect_ratio": {
125
+ "enum": [
126
+ "1:1",
127
+ "4:3",
128
+ "3:4",
129
+ "16:9",
130
+ "9:16",
131
+ "2:3",
132
+ "3:2",
133
+ "21:9"
134
+ ],
135
+ "required": true
136
+ },
137
+ "output_format": {
138
+ "enum": [
139
+ "png",
140
+ "jpeg"
141
+ ]
142
+ },
143
+ "output_quality": {
144
+ "enum": [
145
+ "basic",
146
+ "high"
147
+ ],
148
+ "required": true
149
+ },
150
+ "prompt": {
151
+ "required": true,
152
+ "min": 3,
153
+ "max": 5e3,
154
+ "length": true
155
+ },
156
+ "source_image_urls": {
157
+ "required": true
158
+ }
159
+ },
116
160
  "seedream-v4-edit": {
117
161
  "aspect_ratio": {
118
162
  "enum": [
@@ -151,12 +195,41 @@ var contract = {
151
195
  "required": true
152
196
  }
153
197
  }
154
- }
198
+ },
199
+ "rules": [
200
+ {
201
+ "when": {
202
+ "model": "seedream-4.5-edit"
203
+ },
204
+ "forbidden": [
205
+ "output_format"
206
+ ]
207
+ },
208
+ {
209
+ "when": {
210
+ "model": "seedream-5-pro-edit"
211
+ },
212
+ "forbidden": [
213
+ "output_resolution",
214
+ "output_count",
215
+ "seed"
216
+ ]
217
+ },
218
+ {
219
+ "when": {
220
+ "model": "seedream-v4-edit"
221
+ },
222
+ "forbidden": [
223
+ "output_format"
224
+ ]
225
+ }
226
+ ]
155
227
  },
156
228
  "text-to-image": {
157
229
  "models": [
158
230
  "seedream-4.5-text-to-image",
159
231
  "seedream-5-lite-text-to-image",
232
+ "seedream-5-pro-text-to-image",
160
233
  "seedream-v4-text-to-image"
161
234
  ],
162
235
  "fields_by_model": {
@@ -205,6 +278,12 @@ var contract = {
205
278
  "output_count": {
206
279
  "type": "integer"
207
280
  },
281
+ "output_format": {
282
+ "enum": [
283
+ "png",
284
+ "jpeg"
285
+ ]
286
+ },
208
287
  "output_quality": {
209
288
  "enum": [
210
289
  "basic",
@@ -216,6 +295,40 @@ var contract = {
216
295
  "type": "integer"
217
296
  }
218
297
  },
298
+ "seedream-5-pro-text-to-image": {
299
+ "aspect_ratio": {
300
+ "enum": [
301
+ "1:1",
302
+ "4:3",
303
+ "3:4",
304
+ "16:9",
305
+ "9:16",
306
+ "2:3",
307
+ "3:2",
308
+ "21:9"
309
+ ],
310
+ "required": true
311
+ },
312
+ "output_format": {
313
+ "enum": [
314
+ "png",
315
+ "jpeg"
316
+ ]
317
+ },
318
+ "output_quality": {
319
+ "enum": [
320
+ "basic",
321
+ "high"
322
+ ],
323
+ "required": true
324
+ },
325
+ "prompt": {
326
+ "required": true,
327
+ "min": 3,
328
+ "max": 5e3,
329
+ "length": true
330
+ }
331
+ },
219
332
  "seedream-v4-text-to-image": {
220
333
  "aspect_ratio": {
221
334
  "enum": [
@@ -251,7 +364,35 @@ var contract = {
251
364
  "type": "integer"
252
365
  }
253
366
  }
254
- }
367
+ },
368
+ "rules": [
369
+ {
370
+ "when": {
371
+ "model": "seedream-4.5-text-to-image"
372
+ },
373
+ "forbidden": [
374
+ "output_format"
375
+ ]
376
+ },
377
+ {
378
+ "when": {
379
+ "model": "seedream-5-pro-text-to-image"
380
+ },
381
+ "forbidden": [
382
+ "output_resolution",
383
+ "output_count",
384
+ "seed"
385
+ ]
386
+ },
387
+ {
388
+ "when": {
389
+ "model": "seedream-v4-text-to-image"
390
+ },
391
+ "forbidden": [
392
+ "output_format"
393
+ ]
394
+ }
395
+ ]
255
396
  }
256
397
  };
257
398
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/text-to-image.ts","../src/contract_gen.ts","../src/resources/edit-image.ts"],"sourcesContent":["export { SeedreamClient } 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 { TextToImage } from './resources/text-to-image';\nimport { EditImage } from './resources/edit-image';\n\n/**\n * Seedream image generation and editing API client.\n *\n * Three model families with different field requirements:\n * - **4.5**: requires `aspect_ratio` and `output_quality`\n * - **5-lite**: same required fields as 4.5, faster generation\n * - **V4**: uses `output_resolution` instead; supports `seed` and batch `output_count`\n *\n * @example\n * ```typescript\n * const client = new SeedreamClient({ apiKey: 'your-api-key' });\n *\n * // Seedream 4.5\n * const result = await client.textToImage.run({\n * model: 'seedream-4.5-text-to-image',\n * prompt: 'A beautiful product render',\n * aspect_ratio: '16:9',\n * output_quality: 'high',\n * });\n *\n * // Seedream V4 with batch output\n * const batch = await client.textToImage.run({\n * model: 'seedream-v4-text-to-image',\n * prompt: 'Minimalist logo design',\n * output_count: 4,\n * });\n * ```\n */\nexport class SeedreamClient extends BaseClient {\n /** Text-to-image generation across Seedream model versions. */\n public readonly textToImage: TextToImage;\n /** Edit source images according to a text prompt. */\n public readonly editImage: EditImage;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToImage = new TextToImage(this.http);\n this.editImage = new EditImage(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 CompletedTextToImageResponse,\n TextToImageParams,\n TextToImageResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/seedream/text_to_image';\n\n/**\n * Generates images from text prompts across Seedream model versions.\n * Field requirements vary by model family: 4.5/5-lite require `aspect_ratio`\n * and `output_quality`; V4 uses `output_resolution` and supports `seed`/`output_count`.\n */\nexport class TextToImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create a text to image task and wait until complete.\n * @param params Text to image parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed text to image response.\n */\n async run(params: TextToImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToImageResponse;\n }\n\n /**\n * Create a text to image task; returns immediately with a task id.\n * @param params Text to image parameters.\n * @param options Per-request overrides.\n * @returns The task creation result.\n */\n async create(params: TextToImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['text-to-image'] 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 image task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text to image task status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToImageResponse> {\n return this.http.request<TextToImageResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export const contract = {\n \"edit-image\": {\n \"models\": [\n \"seedream-4.5-edit\",\n \"seedream-5-lite-edit\",\n \"seedream-v4-edit\"\n ],\n \"fields_by_model\": {\n \"seedream-4.5-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_image_urls\": {\n \"required\": true\n }\n },\n \"seedream-5-lite-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_image_urls\": {\n \"required\": true\n }\n },\n \"seedream-v4-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"3:2\",\n \"2:3\",\n \"16:9\",\n \"9:16\",\n \"21:9\"\n ]\n },\n \"output_count\": {\n \"enum\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6\n ],\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_image_urls\": {\n \"required\": true\n }\n }\n }\n },\n \"text-to-image\": {\n \"models\": [\n \"seedream-4.5-text-to-image\",\n \"seedream-5-lite-text-to-image\",\n \"seedream-v4-text-to-image\"\n ],\n \"fields_by_model\": {\n \"seedream-4.5-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"seedream-5-lite-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"seedream-v4-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"3:2\",\n \"2:3\",\n \"16:9\",\n \"9:16\",\n \"21:9\"\n ]\n },\n \"output_count\": {\n \"enum\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6\n ],\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n }\n }\n }\n} as const;\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 CompletedEditImageResponse,\n EditImageParams,\n EditImageResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/seedream/edit_image';\n\n/**\n * Modifies source images according to a text prompt.\n * V4 models accept up to 10 source images; 4.5 and 5-lite accept up to 14.\n */\nexport class EditImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create an edit image task and wait until complete.\n * @param params Edit image parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed edit image response.\n */\n async run(params: EditImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedEditImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<EditImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedEditImageResponse;\n }\n\n /**\n * Create an edit image task; returns immediately with a task id.\n * @param params Edit image parameters.\n * @param options Per-request overrides.\n * @returns The task creation result.\n */\n async create(params: EditImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['edit-image'] 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 an edit image task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current edit image task status.\n */\n async get(id: string, options?: RequestOptions): Promise<EditImageResponse> {\n return this.http.request<EditImageResponse>('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,eAA+C;;;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_internal","ENDPOINT","import_core"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/text-to-image.ts","../src/contract_gen.ts","../src/resources/edit-image.ts"],"sourcesContent":["export { SeedreamClient } 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 { TextToImage } from './resources/text-to-image';\nimport { EditImage } from './resources/edit-image';\n\n/**\n * Seedream image generation and editing API client.\n *\n * Three model families with different field requirements:\n * - **4.5**: requires `aspect_ratio` and `output_quality`\n * - **5-lite**: same required fields as 4.5, faster generation\n * - **V4**: uses `output_resolution` instead; supports `seed` and batch `output_count`\n *\n * @example\n * ```typescript\n * const client = new SeedreamClient({ apiKey: 'your-api-key' });\n *\n * // Seedream 4.5\n * const result = await client.textToImage.run({\n * model: 'seedream-4.5-text-to-image',\n * prompt: 'A beautiful product render',\n * aspect_ratio: '16:9',\n * output_quality: 'high',\n * });\n *\n * // Seedream V4 with batch output\n * const batch = await client.textToImage.run({\n * model: 'seedream-v4-text-to-image',\n * prompt: 'Minimalist logo design',\n * output_count: 4,\n * });\n * ```\n */\nexport class SeedreamClient extends BaseClient {\n /** Text-to-image generation across Seedream model versions. */\n public readonly textToImage: TextToImage;\n /** Edit source images according to a text prompt. */\n public readonly editImage: EditImage;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToImage = new TextToImage(this.http);\n this.editImage = new EditImage(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 CompletedTextToImageResponse,\n TextToImageParams,\n TextToImageResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/seedream/text_to_image';\n\n/**\n * Generates images from text prompts across Seedream model versions.\n * Field requirements vary by model family: 4.5/5-Lite/5 Pro require\n * `aspect_ratio` and `output_quality`; V4 uses `output_resolution` and supports\n * `seed`/`output_count`.\n */\nexport class TextToImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create a text to image task and wait until complete.\n * @param params Text to image parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed text to image response.\n */\n async run(params: TextToImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToImageResponse;\n }\n\n /**\n * Create a text to image task; returns immediately with a task id.\n * @param params Text to image parameters.\n * @param options Per-request overrides.\n * @returns The task creation result.\n */\n async create(params: TextToImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['text-to-image'] 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 image task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text to image task status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToImageResponse> {\n return this.http.request<TextToImageResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export const contract = {\n \"edit-image\": {\n \"models\": [\n \"seedream-4.5-edit\",\n \"seedream-5-lite-edit\",\n \"seedream-5-pro-edit\",\n \"seedream-v4-edit\"\n ],\n \"fields_by_model\": {\n \"seedream-4.5-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_image_urls\": {\n \"required\": true\n }\n },\n \"seedream-5-lite-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\"\n ]\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_image_urls\": {\n \"required\": true\n }\n },\n \"seedream-5-pro-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\"\n ]\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"prompt\": {\n \"required\": true,\n \"min\": 3,\n \"max\": 5000,\n \"length\": true\n },\n \"source_image_urls\": {\n \"required\": true\n }\n },\n \"seedream-v4-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"3:2\",\n \"2:3\",\n \"16:9\",\n \"9:16\",\n \"21:9\"\n ]\n },\n \"output_count\": {\n \"enum\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6\n ],\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_image_urls\": {\n \"required\": true\n }\n }\n },\n \"rules\": [\n {\n \"when\": {\n \"model\": \"seedream-4.5-edit\"\n },\n \"forbidden\": [\n \"output_format\"\n ]\n },\n {\n \"when\": {\n \"model\": \"seedream-5-pro-edit\"\n },\n \"forbidden\": [\n \"output_resolution\",\n \"output_count\",\n \"seed\"\n ]\n },\n {\n \"when\": {\n \"model\": \"seedream-v4-edit\"\n },\n \"forbidden\": [\n \"output_format\"\n ]\n }\n ]\n },\n \"text-to-image\": {\n \"models\": [\n \"seedream-4.5-text-to-image\",\n \"seedream-5-lite-text-to-image\",\n \"seedream-5-pro-text-to-image\",\n \"seedream-v4-text-to-image\"\n ],\n \"fields_by_model\": {\n \"seedream-4.5-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"seedream-5-lite-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\"\n ]\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"seedream-5-pro-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\"\n ]\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"prompt\": {\n \"required\": true,\n \"min\": 3,\n \"max\": 5000,\n \"length\": true\n }\n },\n \"seedream-v4-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"3:2\",\n \"2:3\",\n \"16:9\",\n \"9:16\",\n \"21:9\"\n ]\n },\n \"output_count\": {\n \"enum\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6\n ],\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n }\n },\n \"rules\": [\n {\n \"when\": {\n \"model\": \"seedream-4.5-text-to-image\"\n },\n \"forbidden\": [\n \"output_format\"\n ]\n },\n {\n \"when\": {\n \"model\": \"seedream-5-pro-text-to-image\"\n },\n \"forbidden\": [\n \"output_resolution\",\n \"output_count\",\n \"seed\"\n ]\n },\n {\n \"when\": {\n \"model\": \"seedream-v4-text-to-image\"\n },\n \"forbidden\": [\n \"output_format\"\n ]\n }\n ]\n }\n} as const;\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 CompletedEditImageResponse,\n EditImageParams,\n EditImageResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/seedream/edit_image';\n\n/**\n * Modifies source images according to a text prompt.\n * 5 Pro and V4 accept up to 10 source images; 4.5 and 5-Lite accept up to 14.\n */\nexport class EditImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create an edit image task and wait until complete.\n * @param params Edit image parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed edit image response.\n */\n async run(params: EditImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedEditImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<EditImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedEditImageResponse;\n }\n\n /**\n * Create an edit image task; returns immediately with a task id.\n * @param params Edit image parameters.\n * @param options Per-request overrides.\n * @returns The task creation result.\n */\n async create(params: EditImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['edit-image'] 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 an edit image task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current edit image task status.\n */\n async get(id: string, options?: RequestOptions): Promise<EditImageResponse> {\n return this.http.request<EditImageResponse>('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,eAA+C;;;ACC/C,kBAA8C;AAC9C,sBAAkC;;;ACF3B,IAAM,WAAW;AAAA,EACtB,cAAc;AAAA,IACZ,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,qBAAqB;AAAA,QACnB,gBAAgB;AAAA,UACd,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACA,YAAY;AAAA,QACd;AAAA,QACA,gBAAgB;AAAA,UACd,QAAQ;AAAA,QACV;AAAA,QACA,kBAAkB;AAAA,UAChB,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,UACA,YAAY;AAAA,QACd;AAAA,QACA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B,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAC5C,SAAK,YAAY,IAAI,UAAU,KAAK,IAAI;AAAA,EAC1C;AACF;;;ADxCA,IAAAC,eAYO;","names":["import_core","import_core","import_internal","ENDPOINT","import_core"]}
package/dist/index.mjs CHANGED
@@ -11,6 +11,7 @@ var contract = {
11
11
  "models": [
12
12
  "seedream-4.5-edit",
13
13
  "seedream-5-lite-edit",
14
+ "seedream-5-pro-edit",
14
15
  "seedream-v4-edit"
15
16
  ],
16
17
  "fields_by_model": {
@@ -62,6 +63,12 @@ var contract = {
62
63
  "output_count": {
63
64
  "type": "integer"
64
65
  },
66
+ "output_format": {
67
+ "enum": [
68
+ "png",
69
+ "jpeg"
70
+ ]
71
+ },
65
72
  "output_quality": {
66
73
  "enum": [
67
74
  "basic",
@@ -76,6 +83,43 @@ var contract = {
76
83
  "required": true
77
84
  }
78
85
  },
86
+ "seedream-5-pro-edit": {
87
+ "aspect_ratio": {
88
+ "enum": [
89
+ "1:1",
90
+ "4:3",
91
+ "3:4",
92
+ "16:9",
93
+ "9:16",
94
+ "2:3",
95
+ "3:2",
96
+ "21:9"
97
+ ],
98
+ "required": true
99
+ },
100
+ "output_format": {
101
+ "enum": [
102
+ "png",
103
+ "jpeg"
104
+ ]
105
+ },
106
+ "output_quality": {
107
+ "enum": [
108
+ "basic",
109
+ "high"
110
+ ],
111
+ "required": true
112
+ },
113
+ "prompt": {
114
+ "required": true,
115
+ "min": 3,
116
+ "max": 5e3,
117
+ "length": true
118
+ },
119
+ "source_image_urls": {
120
+ "required": true
121
+ }
122
+ },
79
123
  "seedream-v4-edit": {
80
124
  "aspect_ratio": {
81
125
  "enum": [
@@ -114,12 +158,41 @@ var contract = {
114
158
  "required": true
115
159
  }
116
160
  }
117
- }
161
+ },
162
+ "rules": [
163
+ {
164
+ "when": {
165
+ "model": "seedream-4.5-edit"
166
+ },
167
+ "forbidden": [
168
+ "output_format"
169
+ ]
170
+ },
171
+ {
172
+ "when": {
173
+ "model": "seedream-5-pro-edit"
174
+ },
175
+ "forbidden": [
176
+ "output_resolution",
177
+ "output_count",
178
+ "seed"
179
+ ]
180
+ },
181
+ {
182
+ "when": {
183
+ "model": "seedream-v4-edit"
184
+ },
185
+ "forbidden": [
186
+ "output_format"
187
+ ]
188
+ }
189
+ ]
118
190
  },
119
191
  "text-to-image": {
120
192
  "models": [
121
193
  "seedream-4.5-text-to-image",
122
194
  "seedream-5-lite-text-to-image",
195
+ "seedream-5-pro-text-to-image",
123
196
  "seedream-v4-text-to-image"
124
197
  ],
125
198
  "fields_by_model": {
@@ -168,6 +241,12 @@ var contract = {
168
241
  "output_count": {
169
242
  "type": "integer"
170
243
  },
244
+ "output_format": {
245
+ "enum": [
246
+ "png",
247
+ "jpeg"
248
+ ]
249
+ },
171
250
  "output_quality": {
172
251
  "enum": [
173
252
  "basic",
@@ -179,6 +258,40 @@ var contract = {
179
258
  "type": "integer"
180
259
  }
181
260
  },
261
+ "seedream-5-pro-text-to-image": {
262
+ "aspect_ratio": {
263
+ "enum": [
264
+ "1:1",
265
+ "4:3",
266
+ "3:4",
267
+ "16:9",
268
+ "9:16",
269
+ "2:3",
270
+ "3:2",
271
+ "21:9"
272
+ ],
273
+ "required": true
274
+ },
275
+ "output_format": {
276
+ "enum": [
277
+ "png",
278
+ "jpeg"
279
+ ]
280
+ },
281
+ "output_quality": {
282
+ "enum": [
283
+ "basic",
284
+ "high"
285
+ ],
286
+ "required": true
287
+ },
288
+ "prompt": {
289
+ "required": true,
290
+ "min": 3,
291
+ "max": 5e3,
292
+ "length": true
293
+ }
294
+ },
182
295
  "seedream-v4-text-to-image": {
183
296
  "aspect_ratio": {
184
297
  "enum": [
@@ -214,7 +327,35 @@ var contract = {
214
327
  "type": "integer"
215
328
  }
216
329
  }
217
- }
330
+ },
331
+ "rules": [
332
+ {
333
+ "when": {
334
+ "model": "seedream-4.5-text-to-image"
335
+ },
336
+ "forbidden": [
337
+ "output_format"
338
+ ]
339
+ },
340
+ {
341
+ "when": {
342
+ "model": "seedream-5-pro-text-to-image"
343
+ },
344
+ "forbidden": [
345
+ "output_resolution",
346
+ "output_count",
347
+ "seed"
348
+ ]
349
+ },
350
+ {
351
+ "when": {
352
+ "model": "seedream-v4-text-to-image"
353
+ },
354
+ "forbidden": [
355
+ "output_format"
356
+ ]
357
+ }
358
+ ]
218
359
  }
219
360
  };
220
361
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client.ts","../src/resources/text-to-image.ts","../src/contract_gen.ts","../src/resources/edit-image.ts","../src/index.ts"],"sourcesContent":["import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToImage } from './resources/text-to-image';\nimport { EditImage } from './resources/edit-image';\n\n/**\n * Seedream image generation and editing API client.\n *\n * Three model families with different field requirements:\n * - **4.5**: requires `aspect_ratio` and `output_quality`\n * - **5-lite**: same required fields as 4.5, faster generation\n * - **V4**: uses `output_resolution` instead; supports `seed` and batch `output_count`\n *\n * @example\n * ```typescript\n * const client = new SeedreamClient({ apiKey: 'your-api-key' });\n *\n * // Seedream 4.5\n * const result = await client.textToImage.run({\n * model: 'seedream-4.5-text-to-image',\n * prompt: 'A beautiful product render',\n * aspect_ratio: '16:9',\n * output_quality: 'high',\n * });\n *\n * // Seedream V4 with batch output\n * const batch = await client.textToImage.run({\n * model: 'seedream-v4-text-to-image',\n * prompt: 'Minimalist logo design',\n * output_count: 4,\n * });\n * ```\n */\nexport class SeedreamClient extends BaseClient {\n /** Text-to-image generation across Seedream model versions. */\n public readonly textToImage: TextToImage;\n /** Edit source images according to a text prompt. */\n public readonly editImage: EditImage;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToImage = new TextToImage(this.http);\n this.editImage = new EditImage(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 CompletedTextToImageResponse,\n TextToImageParams,\n TextToImageResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/seedream/text_to_image';\n\n/**\n * Generates images from text prompts across Seedream model versions.\n * Field requirements vary by model family: 4.5/5-lite require `aspect_ratio`\n * and `output_quality`; V4 uses `output_resolution` and supports `seed`/`output_count`.\n */\nexport class TextToImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create a text to image task and wait until complete.\n * @param params Text to image parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed text to image response.\n */\n async run(params: TextToImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToImageResponse;\n }\n\n /**\n * Create a text to image task; returns immediately with a task id.\n * @param params Text to image parameters.\n * @param options Per-request overrides.\n * @returns The task creation result.\n */\n async create(params: TextToImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['text-to-image'] 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 image task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text to image task status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToImageResponse> {\n return this.http.request<TextToImageResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export const contract = {\n \"edit-image\": {\n \"models\": [\n \"seedream-4.5-edit\",\n \"seedream-5-lite-edit\",\n \"seedream-v4-edit\"\n ],\n \"fields_by_model\": {\n \"seedream-4.5-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_image_urls\": {\n \"required\": true\n }\n },\n \"seedream-5-lite-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_image_urls\": {\n \"required\": true\n }\n },\n \"seedream-v4-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"3:2\",\n \"2:3\",\n \"16:9\",\n \"9:16\",\n \"21:9\"\n ]\n },\n \"output_count\": {\n \"enum\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6\n ],\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_image_urls\": {\n \"required\": true\n }\n }\n }\n },\n \"text-to-image\": {\n \"models\": [\n \"seedream-4.5-text-to-image\",\n \"seedream-5-lite-text-to-image\",\n \"seedream-v4-text-to-image\"\n ],\n \"fields_by_model\": {\n \"seedream-4.5-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"seedream-5-lite-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"seedream-v4-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"3:2\",\n \"2:3\",\n \"16:9\",\n \"9:16\",\n \"21:9\"\n ]\n },\n \"output_count\": {\n \"enum\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6\n ],\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n }\n }\n }\n} as const;\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 CompletedEditImageResponse,\n EditImageParams,\n EditImageResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/seedream/edit_image';\n\n/**\n * Modifies source images according to a text prompt.\n * V4 models accept up to 10 source images; 4.5 and 5-lite accept up to 14.\n */\nexport class EditImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create an edit image task and wait until complete.\n * @param params Edit image parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed edit image response.\n */\n async run(params: EditImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedEditImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<EditImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedEditImageResponse;\n }\n\n /**\n * Create an edit image task; returns immediately with a task id.\n * @param params Edit image parameters.\n * @param options Per-request overrides.\n * @returns The task creation result.\n */\n async create(params: EditImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['edit-image'] 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 an edit image task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current edit image task status.\n */\n async get(id: string, options?: RequestOptions): Promise<EditImageResponse> {\n return this.http.request<EditImageResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export { SeedreamClient } 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,cAAc;AAAA,IACZ,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,qBAAqB;AAAA,QACnB,gBAAgB;AAAA,UACd,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACA,YAAY;AAAA,QACd;AAAA,QACA,gBAAgB;AAAA,UACd,QAAQ;AAAA,QACV;AAAA,QACA,kBAAkB;AAAA,UAChB,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,UACA,YAAY;AAAA,QACd;AAAA,QACA,QAAQ;AAAA,U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AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,OAAO,QAAyB,SAAuD;AAC3F,UAAM,OAAOC,eAAc,MAAM;AACjC,IAAAC,gBAAe,SAAS,YAAY,GAAmB,IAA+B;AACtF,WAAO,KAAK,KAAK,QAA4B,QAAQH,WAAU;AAAA,MAC7D;AAAA,MACA,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,IAAI,IAAY,SAAsD;AAC1E,WAAO,KAAK,KAAK,QAA2B,OAAO,GAAGA,SAAQ,IAAI,EAAE,IAAI;AAAA,MACtE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;AH7BO,IAAM,iBAAN,cAA6B,WAAW;AAAA;AAAA,EAE7B;AAAA;AAAA,EAEA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAC5C,SAAK,YAAY,IAAI,UAAU,KAAK,IAAI;AAAA,EAC1C;AACF;;;AIxCA;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":["compactParams","validateParams","pollUntilComplete","ENDPOINT","pollUntilComplete","compactParams","validateParams"]}
1
+ {"version":3,"sources":["../src/client.ts","../src/resources/text-to-image.ts","../src/contract_gen.ts","../src/resources/edit-image.ts","../src/index.ts"],"sourcesContent":["import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToImage } from './resources/text-to-image';\nimport { EditImage } from './resources/edit-image';\n\n/**\n * Seedream image generation and editing API client.\n *\n * Three model families with different field requirements:\n * - **4.5**: requires `aspect_ratio` and `output_quality`\n * - **5-lite**: same required fields as 4.5, faster generation\n * - **V4**: uses `output_resolution` instead; supports `seed` and batch `output_count`\n *\n * @example\n * ```typescript\n * const client = new SeedreamClient({ apiKey: 'your-api-key' });\n *\n * // Seedream 4.5\n * const result = await client.textToImage.run({\n * model: 'seedream-4.5-text-to-image',\n * prompt: 'A beautiful product render',\n * aspect_ratio: '16:9',\n * output_quality: 'high',\n * });\n *\n * // Seedream V4 with batch output\n * const batch = await client.textToImage.run({\n * model: 'seedream-v4-text-to-image',\n * prompt: 'Minimalist logo design',\n * output_count: 4,\n * });\n * ```\n */\nexport class SeedreamClient extends BaseClient {\n /** Text-to-image generation across Seedream model versions. */\n public readonly textToImage: TextToImage;\n /** Edit source images according to a text prompt. */\n public readonly editImage: EditImage;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToImage = new TextToImage(this.http);\n this.editImage = new EditImage(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 CompletedTextToImageResponse,\n TextToImageParams,\n TextToImageResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/seedream/text_to_image';\n\n/**\n * Generates images from text prompts across Seedream model versions.\n * Field requirements vary by model family: 4.5/5-Lite/5 Pro require\n * `aspect_ratio` and `output_quality`; V4 uses `output_resolution` and supports\n * `seed`/`output_count`.\n */\nexport class TextToImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create a text to image task and wait until complete.\n * @param params Text to image parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed text to image response.\n */\n async run(params: TextToImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToImageResponse;\n }\n\n /**\n * Create a text to image task; returns immediately with a task id.\n * @param params Text to image parameters.\n * @param options Per-request overrides.\n * @returns The task creation result.\n */\n async create(params: TextToImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['text-to-image'] 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 image task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text to image task status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToImageResponse> {\n return this.http.request<TextToImageResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export const contract = {\n \"edit-image\": {\n \"models\": [\n \"seedream-4.5-edit\",\n \"seedream-5-lite-edit\",\n \"seedream-5-pro-edit\",\n \"seedream-v4-edit\"\n ],\n \"fields_by_model\": {\n \"seedream-4.5-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_image_urls\": {\n \"required\": true\n }\n },\n \"seedream-5-lite-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\"\n ]\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_image_urls\": {\n \"required\": true\n }\n },\n \"seedream-5-pro-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\"\n ]\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"prompt\": {\n \"required\": true,\n \"min\": 3,\n \"max\": 5000,\n \"length\": true\n },\n \"source_image_urls\": {\n \"required\": true\n }\n },\n \"seedream-v4-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"3:2\",\n \"2:3\",\n \"16:9\",\n \"9:16\",\n \"21:9\"\n ]\n },\n \"output_count\": {\n \"enum\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6\n ],\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_image_urls\": {\n \"required\": true\n }\n }\n },\n \"rules\": [\n {\n \"when\": {\n \"model\": \"seedream-4.5-edit\"\n },\n \"forbidden\": [\n \"output_format\"\n ]\n },\n {\n \"when\": {\n \"model\": \"seedream-5-pro-edit\"\n },\n \"forbidden\": [\n \"output_resolution\",\n \"output_count\",\n \"seed\"\n ]\n },\n {\n \"when\": {\n \"model\": \"seedream-v4-edit\"\n },\n \"forbidden\": [\n \"output_format\"\n ]\n }\n ]\n },\n \"text-to-image\": {\n \"models\": [\n \"seedream-4.5-text-to-image\",\n \"seedream-5-lite-text-to-image\",\n \"seedream-5-pro-text-to-image\",\n \"seedream-v4-text-to-image\"\n ],\n \"fields_by_model\": {\n \"seedream-4.5-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"seedream-5-lite-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_count\": {\n \"type\": \"integer\"\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\"\n ]\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"seedream-5-pro-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"16:9\",\n \"9:16\",\n \"2:3\",\n \"3:2\",\n \"21:9\"\n ],\n \"required\": true\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\"\n ]\n },\n \"output_quality\": {\n \"enum\": [\n \"basic\",\n \"high\"\n ],\n \"required\": true\n },\n \"prompt\": {\n \"required\": true,\n \"min\": 3,\n \"max\": 5000,\n \"length\": true\n }\n },\n \"seedream-v4-text-to-image\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"4:3\",\n \"3:4\",\n \"3:2\",\n \"2:3\",\n \"16:9\",\n \"9:16\",\n \"21:9\"\n ]\n },\n \"output_count\": {\n \"enum\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6\n ],\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n }\n },\n \"rules\": [\n {\n \"when\": {\n \"model\": \"seedream-4.5-text-to-image\"\n },\n \"forbidden\": [\n \"output_format\"\n ]\n },\n {\n \"when\": {\n \"model\": \"seedream-5-pro-text-to-image\"\n },\n \"forbidden\": [\n \"output_resolution\",\n \"output_count\",\n \"seed\"\n ]\n },\n {\n \"when\": {\n \"model\": \"seedream-v4-text-to-image\"\n },\n \"forbidden\": [\n \"output_format\"\n ]\n }\n ]\n }\n} as const;\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 CompletedEditImageResponse,\n EditImageParams,\n EditImageResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/seedream/edit_image';\n\n/**\n * Modifies source images according to a text prompt.\n * 5 Pro and V4 accept up to 10 source images; 4.5 and 5-Lite accept up to 14.\n */\nexport class EditImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create an edit image task and wait until complete.\n * @param params Edit image parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed edit image response.\n */\n async run(params: EditImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedEditImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<EditImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedEditImageResponse;\n }\n\n /**\n * Create an edit image task; returns immediately with a task id.\n * @param params Edit image parameters.\n * @param options Per-request overrides.\n * @returns The task creation result.\n */\n async create(params: EditImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['edit-image'] 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 an edit image task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current edit image task status.\n */\n async get(id: string, options?: RequestOptions): Promise<EditImageResponse> {\n return this.http.request<EditImageResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export { SeedreamClient } 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,cAAc;AAAA,IACZ,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,qBAAqB;AAAA,QACnB,gBAAgB;AAAA,UACd,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACA,YAAY;AAAA,QACd;AAAA,QACA,gBAAgB;AAAA,UACd,QAAQ;AAAA,QACV;AAAA,QACA,kBAAkB;AAAA,UAChB,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,UACA,YAAY;AAAA,QACd;AAAA,QACA,QAAQ;AAAA,UACN,QAAQ;AAAA,QACV;AAAA,QACA,qBAAqB;AAAA,UACnB,YAAY;AAAA,QACd;AAAA,MACF;AAAA,MACA,wBAAwB;AAAA,QACtB,gBAAgB;AAAA,UACd,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACA,YAAY;AAAA,QACd;AAAA,QACA,gBAAgB;AAAA,UACd,QAAQ;AAAA,QACV;AAAA,QACA,iBAAiB;AAAA,UACf,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,kBAAkB;AAA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A;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7B,MAAM,IAAI,QAAyB,SAAgF;AACjH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,MAAMC,mBAAqC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACvF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,OAAO,QAAyB,SAAuD;AAC3F,UAAM,OAAOC,eAAc,MAAM;AACjC,IAAAC,gBAAe,SAAS,YAAY,GAAmB,IAA+B;AACtF,WAAO,KAAK,KAAK,QAA4B,QAAQH,WAAU;AAAA,MAC7D;AAAA,MACA,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,IAAI,IAAY,SAAsD;AAC1E,WAAO,KAAK,KAAK,QAA2B,OAAO,GAAGA,SAAQ,IAAI,EAAE,IAAI;AAAA,MACtE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;AH7BO,IAAM,iBAAN,cAA6B,WAAW;AAAA;AAAA,EAE7B;AAAA;AAAA,EAEA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAC5C,SAAK,YAAY,IAAI,UAAU,KAAK,IAAI;AAAA,EAC1C;AACF;;;AIxCA;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":["compactParams","validateParams","pollUntilComplete","ENDPOINT","pollUntilComplete","compactParams","validateParams"]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "runapi": {
4
4
  "slug": "seedream"
5
5
  },
6
- "version": "0.2.8",
6
+ "version": "0.2.9",
7
7
  "description": "RunAPI Seedream SDK for text-to-image and edit-image workflows in JavaScript, Python, Ruby, Go, Java, and PHP",
8
8
  "main": "./dist/index.js",
9
9
  "module": "./dist/index.mjs",
@@ -31,7 +31,7 @@
31
31
  "clean": "rm -rf dist"
32
32
  },
33
33
  "dependencies": {
34
- "@runapi.ai/core": "^0.2.11"
34
+ "@runapi.ai/core": "^0.2.13"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^20.0.0",
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
  <br/>
23
23
 
24
- Generate and edit images with Seedream v4, 4.5, and 5-lite text-to-image and image editing. This skill helps Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents integrate Seedream through RunAPI.
24
+ Generate and edit images with Seedream v4, 4.5, 5 Lite, and 5 Pro text-to-image and image editing. This skill helps Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents integrate Seedream through RunAPI.
25
25
 
26
26
  The canonical agent file is `skills/seedream/SKILL.md`.
27
27
 
@@ -75,6 +75,8 @@ const url = result.images[0].url;
75
75
  - [4.5 edit](https://runapi.ai/models/seedream/4.5-edit)
76
76
  - [5 lite text to image](https://runapi.ai/models/seedream/5-lite-text-to-image)
77
77
  - [5 lite edit](https://runapi.ai/models/seedream/5-lite-edit)
78
+ - [5 pro text to image](https://runapi.ai/models/seedream/5-pro-text-to-image)
79
+ - [5 pro edit](https://runapi.ai/models/seedream/5-pro-edit)
78
80
  - [v4 text to image](https://runapi.ai/models/seedream/v4-text-to-image)
79
81
  - [v4 edit](https://runapi.ai/models/seedream/v4-edit)
80
82
 
@@ -106,5 +106,7 @@ RunAPI-generated file URLs are temporary. Download and store generated images, v
106
106
  - [4.5 edit](https://runapi.ai/models/seedream/4.5-edit.md)
107
107
  - [5 lite text to image](https://runapi.ai/models/seedream/5-lite-text-to-image.md)
108
108
  - [5 lite edit](https://runapi.ai/models/seedream/5-lite-edit.md)
109
+ - [5 pro text to image](https://runapi.ai/models/seedream/5-pro-text-to-image.md)
110
+ - [5 pro edit](https://runapi.ai/models/seedream/5-pro-edit.md)
109
111
  - [v4 text to image](https://runapi.ai/models/seedream/v4-text-to-image.md)
110
112
  - [v4 edit](https://runapi.ai/models/seedream/v4-edit.md)