Seedream 4.5 API Documentation

Seededit Edit Image - Request Code

POST https://gateway.pixazo.ai/byteplus/v1/getEditImage Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "prompt": "Make the cat eye blue", "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/byteplus/1757499948018-hntkjsg9kj.jpg", "guidance_scale": 6, "seed": 42 }
import requests url = "https://gateway.pixazo.ai/byteplus/v1/getEditImage" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "prompt": "Make the cat eye blue", "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/byteplus/1757499948018-hntkjsg9kj.jpg", "guidance_scale": 6, "seed": 42 } response = requests.post(url, json=data, headers=headers) print(response.json())
const url = 'https://gateway.pixazo.ai/byteplus/v1/getEditImage'; const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }; const data = { prompt: 'Make the cat eye blue', image: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/byteplus/1757499948018-hntkjsg9kj.jpg', guidance_scale: 6, seed: 42 }; fetch(url, { method: 'POST', headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/byteplus/v1/getEditImage" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ --data-raw '{ "prompt": "Make the cat eye blue", "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/byteplus/1757499948018-hntkjsg9kj.jpg", "guidance_scale": 6, "seed": 42 }'
import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class ApiExample { public static void main(String[] args) throws Exception { String json = """ { "prompt": "Make the cat eye blue", "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/byteplus/1757499948018-hntkjsg9kj.jpg", "guidance_scale": 6, "seed": 42 } """; HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) .build(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://gateway.pixazo.ai/byteplus/v1/getEditImage")) .header("Content-Type", "application/json") .header("Cache-Control", "no-cache") .header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY") .POST(HttpRequest.BodyPublishers.ofString(json)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } }
<?php $url = 'https://gateway.pixazo.ai/byteplus/v1/getEditImage'; $headers = [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]; $data = json_encode([ 'prompt' => 'Make the cat eye blue', 'image' => 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/byteplus/1757499948018-hntkjsg9kj.jpg', 'guidance_scale' => 6, 'seed' => 42 ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Output

Successful API response:

{ "created": 1757502222, "data": [{ "url": "https://pub-..../byteplus/XXXXXXXXXXX-yil9139ndj8.jpg" }], "usage": { "generated_images": 1, "output_tokens": 4096, "total_tokens": 4096 } }

Request Body - Seededit Edit Image

Parameters for /getEditImage:

ParameterRequiredTypeDescription
modelNostringThe ID of the model to call. You can activate a model service and query the model ID. An endpoint ID can also be used to call a model.
promptYesstringText description (prompt) used to edit images. Describes the desired changes to be made to the input image.
imageYesstringThe image to be edited. Accepts either Base64 encoding or an accessible URL.
**Image URL**: Ensure the URL is accessible.
**Base64**: Must be in the format data:image/<format>;base64,<content> (format in lowercase, e.g., data:image/png;base64,...).
response_formatNostringFormat of the returned image.
Options: "url" (downloadable JPEG link), "b64_json" (Base64-encoded JSON string).
sizeNo(Yes for seedream 4.5)stringDimensions of the generated image. Currently only adaptive is supported. The system compares the input image size with predefined sizes and selects the closest match, prioritizing minimal aspect ratio differences. For Model seedream-4-5-251128, Size supported 2K, 4k. Total pixel range: seedream 4.5:[2560x1440=3686400, 4096x4096=16777216]
seedNointegerRandom seed to control generation randomness. Range: [-1, 2147483647]. If -1 or not set, a random seed is generated automatically. Use the same seed for consistent results.
guidance_scaleNofloatControls how much the text prompt vs. input image influences the output. Range: [1, 10]. Higher values = stronger text prompt influence, weaker input image influence.
watermarkNobooleanWhether to add a watermark.
false: No watermark.
true: Adds "AI-generated" watermark in the bottom-right corner.

Example Request - Seededit Edit Image

JSON
{ "model": "seededit-3-0-i2i-250628", "prompt": "Make the cat eye blue", "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/byteplus/1757499948018-hntkjsg9kj.jpg", "guidance_scale": 6, "seed": 42 }

Response - Seededit Edit Image

JSON
{ "created": 1757502222, "data": [{ "url": "https://pub-..../byteplus/XXXXXXXXXXX-yil9139ndj8.jpg" }], "usage": { "generated_images": 1, "output_tokens": 4096, "total_tokens": 4096 } }

Request Headers

HeaderDescription
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYour API subscription key for authentication

Response Handling

The Bytedance Text to Image returns specific HTTP status codes and response bodies to indicate the success or failure of a request. Developers should implement error handling in their applications to manage these responses effectively.

Common Status Codes and Responses

Status CodeDescriptionResponse Body
200Success - The request was successfully processed.{ "success": true, ... }
Bad Request - The request contains invalid parameters or missing fields.{ "error": "Invalid request parameters" }
401Unauthorized - The provided subscription key is missing or invalid.{ "error": "Invalid or missing authentication" }
403Forbidden - The subscription does not have access to this API or action.{ "error": "Access denied for this operation" }
404Not Found - The requested resource or endpoint could not be found.{ "error": "Endpoint not found" }
Too Many Requests - The request rate limit has been exceeded.{ "error": "Rate limit exceeded, please retry later" }
500Internal Server Error - An unexpected error occurred on the server.{ "error": "An unexpected error occurred, please try again later" }

Example Error Response

{ "error": "Invalid parameters" }

Retrieving Image Result and URL

After submitting your request, use this endpoint to check status and retrieve results.

Endpoint

POST https://gateway.pixazo.ai/ai-model-api-polling/getGenerationResults

Request Body

{ "job_set_id": "your-job-set-id-here" }
POST https://gateway.pixazo.ai/ai-model-api-polling/getGenerationResults Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "job_set_id": "job-1234567890" }
import requests url = "https://gateway.pixazo.ai/ai-model-api-polling/getGenerationResults" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "job_set_id": "job-1234567890" } response = requests.post(url, json=data, headers=headers) print(response.json())
const url = 'https://gateway.pixazo.ai/ai-model-api-polling/getGenerationResults'; const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }; const data = { job_set_id: 'job-1234567890' }; fetch(url, { method: 'POST', headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/ai-model-api-polling/getGenerationResults" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ --data-raw '{ "job_set_id": "job-1234567890" }'
import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class PollingExample { public static void main(String[] args) throws Exception { String json = """ { "job_set_id": "job-1234567890" } """; HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) .build(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://gateway.pixazo.ai/ai-model-api-polling/getGenerationResults")) .header("Content-Type", "application/json") .header("Cache-Control", "no-cache") .header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY") .POST(HttpRequest.BodyPublishers.ofString(json)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } }
<?php $url = 'https://gateway.pixazo.ai/ai-model-api-polling/getGenerationResults'; $headers = [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]; $data = json_encode([ 'job_set_id' => 'job-1234567890' ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Example Success Response

{ "job_set_id": "job-1234567890", "status": "succeeded", "results": [ { "url": "https://pub-..../byteplus/XXXXXXXXXXX-yil9139ndj8.jpg" } ], "created_at": 1757502222, "updated_at": 1757502300 }

No model data found.