Seededit 3.0 API Documentation
Seededit Edit Image - Request Code
POST /getEditImage HTTP/1.1 Host: gateway.pixazo.ai 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" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --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 url = "https://gateway.pixazo.ai/byteplus/v1/getEditImage"; 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(url)) .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_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo "HTTP Code: " . $httpCode . "\n"; echo "Response: " . $response . "\n"; ?> Output
Successful API response:
{ "created": 1757499942, "data": [{ "url": "https://..../byteplus/XXXXXXXXXXXXXXX-hntkjsg9kj.jpg" }], "usage": { "generated_images": 1, "output_tokens": 4096, "total_tokens": 4096 } } Request Body - Seededit Edit Image
Parameters for /getEditImage:
| Parameter | Required | Type | Description |
|---|---|---|---|
| model | No | string | The 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. |
| prompt | Yes | string | Text description (prompt) used to edit images. Describes the desired changes to be made to the input image. |
| image | Yes | string | The 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_format | No | string | Format of the returned image. Options: "url" (downloadable JPEG link), "b64_json" (Base64-encoded JSON string). |
| size | No | string | Dimensions 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. |
| seed | No | integer | Random 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_scale | No | float | Controls how much the text prompt vs. input image influences the output. Range: [1, 10]. Higher values = stronger text prompt influence, weaker input image influence. |
| watermark | No | boolean | Whether 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
| Header | Description |
|---|---|
| Content-Type | Must be set to application/json |
| Cache-Control | Must be set to no-cache |
| Ocp-Apim-Subscription-Key | Your 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 Code | Description | Response Body |
|---|---|---|
| 200 | Success - The request was successfully processed. | { "success": true, ... } |
| 400 | Bad Request - The request contains invalid parameters or missing fields. | { "error": "Invalid request parameters" } |
| 401 | Unauthorized - The provided subscription key is missing or invalid. | { "error": "Invalid or missing authentication" } |
| 403 | Forbidden - The subscription does not have access to this API or action. | { "error": "Access denied for this operation" } |
| 404 | Not Found - The requested resource or endpoint could not be found. | { "error": "Endpoint not found" } |
| 429 | Too Many Requests - The request rate limit has been exceeded. | { "error": "Rate limit exceeded, please retry later" } |
| 500 | Internal 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/bytedance-polling/getImageResult
Request Body
{ "job_set_id": "job-12345-abcde" } HTTP Example
POST /bytedance-polling/getImageResult HTTP/1.1 Host: gateway.pixazo.ai Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "job_set_id": "job-12345-abcde" } Python Example
import requests url = "https://gateway.pixazo.ai/bytedance-polling/getImageResult" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "job_set_id": "job-12345-abcde" } response = requests.post(url, json=data, headers=headers) print(response.json()) JavaScript Example
const url = 'https://gateway.pixazo.ai/bytedance-polling/getImageResult'; const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }; const data = { job_set_id: 'job-12345-abcde' }; 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 Example
curl -v -X POST "https://gateway.pixazo.ai/bytedance-polling/getImageResult" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "job_set_id": "job-12345-abcde" }' Java Example
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 url = "https://gateway.pixazo.ai/bytedance-polling/getImageResult"; String json = """ { "job_set_id": "job-12345-abcde" } """; HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) .build(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .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 Example
<?php $url = 'https://gateway.pixazo.ai/bytedance-polling/getImageResult'; $headers = [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]; $data = json_encode([ 'job_set_id' => 'job-12345-abcde' ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo "HTTP Code: " . $httpCode . "\n"; echo "Response: " . $response . "\n"; ?> Example Response
{ "job_set_id": "job-12345-abcde", "status": "succeeded", "result": { "url": "https://pub-..../byteplus/XXXXXXXXXXX-yil9139ndj8.jpg" }, "created_at": 1757502222, "updated_at": 1757502300 } Bytedance API Pricing
| Resolution | Price (USD) |
|---|---|
| All Resolution | Free |