Seedance 2.0 Text to Video
Seedance 2.0 Text to Video on EggAPI: model ID, pricing, request parameters, and code samples for creating tasks, polling, and webhooks.
Model
| Field | Value |
|---|---|
| Name | Seedance 2.0 Text to Video |
| Model ID | bytedance/seedance-2.0/text-to-video |
| Kind | video |
| Capability | Text to Video |
| Task type | video_generate |
| Price | $0.160 per second of video; a task costs this price × its duration |
| Price by resolution | 480p $0.074, 720p $0.160, 1080p $0.399, 4k $0.812; the price above applies when resolution is omitted or not listed |
| Tags | video, seedance |
| Description | ByteDance Seedance |
Endpoint and Auth
- Base URL:
https://api.eggapi.ai - Create task:
POST https://api.eggapi.ai/v1/generate - Poll task:
GET https://api.eggapi.ai/v1/tasks/{id} - Auth header:
Authorization: Bearer <EGGAPI_API_KEY> - Content header:
Content-Type: application/json - Processing model: asynchronous task. The create endpoint returns a pending task; poll until
completedorfailed, or providewebhook_url.
Request Parameters
| Parameter | Requirement |
|---|---|
model | string · required |
prompt | string · required |
negative_prompt | string · optional |
aspect_ratio | 16:9 | 9:16 | 4:3 | 3:4 | 1:1 | 21:9 |
resolution | 480p | 720p | 1080p | 4k |
duration | 4-15 seconds · required |
parameters | provider fields · optional |
Example Payload
json
{
"model": "bytedance/seedance-2.0/text-to-video",
"prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
"parameters": {
"generate_audio": true,
"enable_web_search": false
},
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "720p"
}Generate Examples
Python
python
import requests
response = requests.post(
"https://api.eggapi.ai/v1/generate",
headers={"Authorization": "Bearer sk_live_..."},
json={
"model": "bytedance/seedance-2.0/text-to-video",
"prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
"parameters": {
"generate_audio": True,
"enable_web_search": False
},
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "720p"
}
)
print(response.json())TypeScript
typescript
const response = await fetch("https://api.eggapi.ai/v1/generate", {
method: "POST",
headers: {
"Authorization": "Bearer sk_live_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0/text-to-video",
"prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
"parameters": {
"generate_audio": true,
"enable_web_search": false
},
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "720p"
})
})
const result = await response.json()cURL
bash
curl https://api.eggapi.ai/v1/generate \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"model": "bytedance/seedance-2.0/text-to-video",
"prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
"parameters": {
"generate_audio": true,
"enable_web_search": false
},
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "720p"
}'Create Response Example
json
{
"data": {
"id": "gen_abc123def456",
"status": "pending",
"model": "bytedance/seedance-2.0/text-to-video",
"type": "video_generate",
"cost": "$0.00",
"created_at": "2026-05-08T10:30:00Z"
},
"error": null
}Polling
After creating a task, read data.id and poll GET /v1/tasks/{id}. Treat completed as success and failed as a terminal error.
Polling Examples
Python
python
import time
import requests
headers = {"Authorization": "Bearer sk_live_..."}
create = requests.post(
"https://api.eggapi.ai/v1/generate",
headers={**headers, "Content-Type": "application/json"},
json={
"model": "bytedance/seedance-2.0/text-to-video",
"prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
"parameters": {
"generate_audio": True,
"enable_web_search": False
},
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "720p"
}
).json()
task_id = create["data"]["id"]
while True:
task = requests.get(
f"https://api.eggapi.ai/v1/tasks/{task_id}",
headers=headers,
).json()["data"]
if task["status"] in ["completed", "failed"]:
print(task)
break
time.sleep(2)TypeScript
typescript
const headers = {
"Authorization": "Bearer sk_live_...",
"Content-Type": "application/json"
}
const create = await fetch("https://api.eggapi.ai/v1/generate", {
method: "POST",
headers,
body: JSON.stringify({
"model": "bytedance/seedance-2.0/text-to-video",
"prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
"parameters": {
"generate_audio": true,
"enable_web_search": false
},
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "720p"
})
})
const taskId = (await create.json()).data.id
while (true) {
const response = await fetch(`https://api.eggapi.ai/v1/tasks/${taskId}`, { headers })
const task = (await response.json()).data
if (["completed", "failed"].includes(task.status)) {
console.log(task)
break
}
await new Promise((resolve) => setTimeout(resolve, 2000))
}cURL
bash
CREATE=$(curl -s https://api.eggapi.ai/v1/generate \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"model": "bytedance/seedance-2.0/text-to-video",
"prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
"parameters": {
"generate_audio": true,
"enable_web_search": false
},
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "720p"
}')
TASK_ID=$(echo "$CREATE" | jq -r '.data.id')
STATUS="pending"
until [ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ]; do
TASK=$(curl -s "https://api.eggapi.ai/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer sk_live_...")
STATUS=$(echo "$TASK" | jq -r '.data.status')
sleep 2
done
echo "$TASK"Completed task example:
json
{
"data": {
"id": "gen_abc123def456",
"status": "completed",
"model": "bytedance/seedance-2.0/text-to-video",
"type": "video_generate",
"output": {
"url": "https://file.eggapi.ai/videos/gen_abc123def456/output.mp4",
"urls": [
"https://file.eggapi.ai/videos/gen_abc123def456/output.mp4"
],
"duration_seconds": 5
},
"cost": "$0.799",
"created_at": "2026-05-08T10:30:00Z",
"started_at": "2026-05-08T10:30:01Z",
"completed_at": "2026-05-08T10:30:10Z"
},
"error": null
}Webhook
Add webhook_url to the create payload to receive task.completed or task.failed callbacks when the worker finishes.
Webhook Examples
Python
python
import requests
from fastapi import FastAPI, Request
# 1. Submit the task with webhook_url
requests.post(
"https://api.eggapi.ai/v1/generate",
headers={
"Authorization": "Bearer sk_live_...",
"Content-Type": "application/json",
},
json={
"model": "bytedance/seedance-2.0/text-to-video",
"prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
"parameters": {
"generate_audio": True,
"enable_web_search": False
},
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "720p",
"webhook_url": "https://example.com/api/eggapi-webhook"
}
)
# 2. Receive EggAPI task callbacks
app = FastAPI()
@app.post("/api/eggapi-webhook")
async def eggapi_webhook(request: Request):
event = await request.json()
print(event["task_id"], event["type"], event["status"])
return {"ok": True}
# Unified callback body:
# {
# "event": "task.completed",
# "task_id": "gen_abc123def456",
# "status": "completed",
# "model": "bytedance/seedance-2.0/text-to-video",
# "type": "video_generate",
# "output": {
# "url": "https://file.eggapi.ai/videos/gen_abc123def456/output.mp4",
# "urls": [
# "https://file.eggapi.ai/videos/gen_abc123def456/output.mp4"
# ],
# "duration_seconds": 5
# },
# "cost": "0.380000",
# "timestamp": 1778217000
# }TypeScript
typescript
import express from "express"
// 1. Submit the task with webhook_url
await fetch("https://api.eggapi.ai/v1/generate", {
method: "POST",
headers: {
"Authorization": "Bearer sk_live_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0/text-to-video",
"prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
"parameters": {
"generate_audio": true,
"enable_web_search": false
},
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "720p",
"webhook_url": "https://example.com/api/eggapi-webhook"
})
})
// 2. Receive EggAPI task callbacks
const app = express()
app.use(express.json())
app.post("/api/eggapi-webhook", (req, res) => {
const event = req.body
console.log(event.task_id, event.type, event.status, event.output)
res.status(200).json({ ok: true })
})
// Unified callback body:
// {
// "event": "task.completed",
// "task_id": "gen_abc123def456",
// "status": "completed",
// "model": "bytedance/seedance-2.0/text-to-video",
// "type": "video_generate",
// "output": {
// "url": "https://file.eggapi.ai/videos/gen_abc123def456/output.mp4",
// "urls": [
// "https://file.eggapi.ai/videos/gen_abc123def456/output.mp4"
// ],
// "duration_seconds": 5
// },
// "cost": "0.380000",
// "timestamp": 1778217000
// }cURL
bash
curl https://api.eggapi.ai/v1/generate \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"model": "bytedance/seedance-2.0/text-to-video",
"prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
"parameters": {
"generate_audio": true,
"enable_web_search": false
},
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "720p",
"webhook_url": "https://example.com/api/eggapi-webhook"
}'
# EggAPI will POST this unified JSON to your webhook_url:
# {
# "event": "task.completed",
# "task_id": "gen_abc123def456",
# "status": "completed",
# "model": "bytedance/seedance-2.0/text-to-video",
# "type": "video_generate",
# "output": {
# "url": "https://file.eggapi.ai/videos/gen_abc123def456/output.mp4",
# "urls": [
# "https://file.eggapi.ai/videos/gen_abc123def456/output.mp4"
# ],
# "duration_seconds": 5
# },
# "cost": "0.380000",
# "timestamp": 1778217000
# }Webhook callback body example:
json
{
"event": "task.completed",
"task_id": "gen_abc123def456",
"status": "completed",
"model": "bytedance/seedance-2.0/text-to-video",
"type": "video_generate",
"output": {
"url": "https://file.eggapi.ai/videos/gen_abc123def456/output.mp4",
"urls": [
"https://file.eggapi.ai/videos/gen_abc123def456/output.mp4"
],
"duration_seconds": 5
},
"cost": "0.799",
"timestamp": 1778217000
}Notes for AI Assistants
- Always use the exact model ID:
bytedance/seedance-2.0/text-to-video. - Do not expose the EggAPI API key in client-side code, logs, or prompts.
- The create endpoint is asynchronous; do not expect final media output in the initial response.
- Use
image_urlsonly for image/video capabilities that require uploaded source images. - Use provider-specific optional fields under
parameterswhen needed.