seedance Pro API Documentation
Seedance Text to Video Task - Request Code
POST https://gateway.pixazo.ai/byteplus/v1/generateVideoTask Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "model": "seedance-1-0-lite-t2v-250428", "text": "Photorealistic style: Under a clear blue sky, a vast expanse of white daisy fields stretches out. The camera gradually zooms in and finally fixates on a close-up of a single daisy, with several glistening dewdrops resting on its petals. --ratio 16:9 --resolution 720p --duration 5 --camerafixed false" } import requests url = "https://gateway.pixazo.ai/byteplus/v1/generateVideoTask" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "model": "seedance-1-0-lite-t2v-250428", "text": "Photorealistic style: Under a clear blue sky, a vast expanse of white daisy fields stretches out. The camera gradually zooms in and finally fixates on a close-up of a single daisy, with several glistening dewdrops resting on its petals. --ratio 16:9 --resolution 720p --duration 5 --camerafixed false" } response = requests.post(url, json=data, headers=headers) print(response.json()) const url = 'https://gateway.pixazo.ai/byteplus/v1/generateVideoTask'; const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }; const data = { model: 'seedance-1-0-lite-t2v-250428', text: 'Photorealistic style: Under a clear blue sky, a vast expanse of white daisy fields stretches out. The camera gradually zooms in and finally fixates on a close-up of a single daisy, with several glistening dewdrops resting on its petals. --ratio 16:9 --resolution 720p --duration 5 --camerafixed false' }; 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/generateVideoTask" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" --data-raw '{ "model": "seedance-1-0-lite-t2v-250428", "text": "Photorealistic style: Under a clear blue sky, a vast expanse of white daisy fields stretches out. The camera gradually zooms in and finally fixates on a close-up of a single daisy, with several glistening dewdrops resting on its petals. --ratio 16:9 --resolution 720p --duration 5 --camerafixed false" }' 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 VideoGeneration { public static void main(String[] args) throws Exception { String url = "https://gateway.pixazo.ai/byteplus/v1/generateVideoTask"; String json = """ { "model": "seedance-1-0-lite-t2v-250428", "text": "Photorealistic style: Under a clear blue sky, a vast expanse of white daisy fields stretches out. The camera gradually zooms in and finally fixates on a close-up of a single daisy, with several glistening dewdrops resting on its petals. --ratio 16:9 --resolution 720p --duration 5 --camerafixed false" } """; 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/generateVideoTask'; $headers = [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]; $data = json_encode([ 'model' => 'seedance-1-0-lite-t2v-250428', 'text' => 'Photorealistic style: Under a clear blue sky, a vast expanse of white daisy fields stretches out. The camera gradually zooms in and finally fixates on a close-up of a single daisy, with several glistening dewdrops resting on its petals. --ratio 16:9 --resolution 720p --duration 5 --camerafixed false' ]); $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:
{ "id": "cgt-XXXXXXXXXXXXXXXXXXXX-XXXXX" } Request Body - Seedance Text to Video Task
Parameters for /generateVideoTask:
| 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. |
| content | Yes | object[] | Input text information for video generation. An array of content objects with `type` (`"text"`) and corresponding `text` properties. |
| callback_url | No | string | Callback notification URL for the result of this generation task. When the video generation task status changes, Ark sends a callback request with the latest status. Possible values: `queued`, `running`, `succeeded`, `failed`. |
Example Request - Seedance Text to Video Task
JSON
{ "model": "seedance-1-0-lite-t2v-250428", "text": "Photorealistic style: Under a clear blue sky, a vast expanse of white daisy fields stretches out. The camera gradually zooms in and finally fixates on a close-up of a single daisy, with several glistening dewdrops resting on its petals. --ratio 16:9 --resolution 720p --duration 5 --camerafixed false" } Response - Seedance Text to Video Task
JSON
{ "id": "cgt-XXXXXXXXXXXXXXXXXXXX-XXXXX" } 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 subscription key for API 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 Video Result and URL
After submitting your request, use this endpoint to check status and retrieve results.
Endpoint
POST https://gateway.pixazo.ai/bytedance-polling/getVideoResult
Request Body
{ "task_id": "cgt-XXXXXXXXXXXXXXXXXXXX-XXXXX" } Example Request - HTTP
POST https://gateway.pixazo.ai/bytedance-polling/getVideoResult Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "task_id": "cgt-20250910201045-sqz6f" } Example Request - cURL
curl -v -X POST "https://gateway.pixazo.ai/bytedance-polling/getVideoResult" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" --data-raw '{ "task_id": "cgt-20250910201045-sqz6f" }' Example Request - Python
import requests url = "https://gateway.pixazo.ai/bytedance-polling/getVideoResult" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "task_id": "cgt-20250910201045-sqz6f" } response = requests.post(url, json=data, headers=headers) print(response.json()) Example Request - JavaScript
const url = 'https://gateway.pixazo.ai/bytedance-polling/getVideoResult'; const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }; const data = { task_id: 'cgt-20250910201045-sqz6f' }; 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)); Example Request - Java
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 VideoPolling { public static void main(String[] args) throws Exception { String url = "https://gateway.pixazo.ai/bytedance-polling/getVideoResult"; String json = """ { "task_id": "cgt-20250910201045-sqz6f" } """; 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()); } } Example Request - PHP
<?php $url = 'https://gateway.pixazo.ai/bytedance-polling/getVideoResult'; $headers = [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]; $data = json_encode([ 'task_id' => 'cgt-20250910201045-sqz6f' ]); $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
{ "id": "cgt-20250910201045-sqz6f", "model": "seedance-1-0-lite-t2v-250428", "status": "succeeded", "content": { "video_url": "https://...../byteplus-videos/XXXXXXXXXXXX-6q9sfv3ma6e.mp4" }, "usage": { "completion_tokens": 103818, "total_tokens": 103818 }, "created_at": 1757506245, "updated_at": 1757506300 } Bytedance API Pricing
| Resolution | Price (USD) |
|---|---|
| All Resolution | Free |