Seedance 2.0 API Documentation - Context & Notes
This file records architecture findings, correct API parameters, and test results for future reference when reloading context.
API Architecture (Critical)
Model Naming - Two-Level Structure
The API uses a two-level model naming system:- Top-level
model: The workflow name →wan22-video-generation inputs.model: The sub-model within the workflow →seedance-20
Why NOT seedance20-video-generation as top-level model?
seedance20-video-generation exists in WORKFLOW_MAPPINGS (workflow-config.ts:185) but the
task submission handler (task-submission.ts) does NOT have a case for it in the main switch
statement. Using it causes: "Unsupported NewAPI workflow: seedance20-video-generation"
The correct flow is:
model: "wan22-video-generation"→ switch case at task-submission.ts:35inputs.model: "seedance-20"→ sub-routing at task-submission.ts:105- This sets
triggerTaskId = "seedance20-video-generation"internally
Response Model Field
TherecordInfo endpoint returns model: order.toolId. For seedance-20 tasks,
toolId is set to "seedance20-video-generation" (submit-task.ts:82-83).
So:
- Request:
model: "wan22-video-generation",inputs.model: "seedance-20" - Response (recordInfo/webhook):
model: "seedance20-video-generation"
Key Source Files
| File | Purpose |
|---|---|
packages/shared/client/workflow-config.ts | WORKFLOW_MAPPINGS, params schemas |
packages/workflow/services/newapi/task-submission.ts | Task routing switch + sub-model handling |
packages/api/modules/workflow/services/submit-task.ts | Order creation, toolId assignment |
apps/web/app/api/v1/jobs/createTask/route.ts | API endpoint, validation, auth |
apps/web/app/api/v1/jobs/recordInfo/route.ts | Task status query endpoint |
apps/web/lib/auth/api-key-auth.ts | API key authentication (SHA-256 hash) |
Valid Parameters
Resolution (wan22-video-generation)
From workflow-config.ts params schema:720x720(1:1)720x960(3:4)960x720(4:3)1280x720(16:9)720x1280(9:16)
inputs.model (wan22-video-generation sub-models)
z video(default)sora2sora2 proseedance-20grok-imagine-video
videoInputMode (seedance-20 specific)
keyframe(40 credits/sec)reference(90 credits/sec)
Duration
4sto15s
Task States
waiting→generating→success|fail
Credit Calculation
- Text-to-video (seedance-20): 40 credits/sec
- Image-to-video keyframe: 40 credits/sec
- Image-to-video reference: 90 credits/sec
- Formula:
duration_seconds * rate - Credits are deducted at task creation, refunded on server error
Test Database
- API Key:
zimg_eQVFicFOpYTUOIJWhSPQq7hKZEPnnmLy - User:
yixotieq@gmail.com(userId:cmk2ll9d400009wag8ncntbcq) - DB URL:
postgresql://neondb_owner:npg_WKpk7hXH4san@ep-little-haze-adtefm8g-pooler.c-2.us-east-1.aws.neon.tech/neondb?sslmode=require&channel_binding=require - Key Hash:
de00dff96908fc102a6d6a6e10ae9f0a1fc23bf91f9bcc0259957ed4db674efa
Testing
Test Scripts
test-api.sh- Bash script for parameter validation (9 tests)examples/text_to_video.py- Python text-to-video exampleexamples/image_to_video.py- Python image-to-video example
Running Tests
Known Issue
Local dev server (localhost:3000) may return 500 HTML for all requests due to environment/database configuration issues. Production endpoint works correctly for auth validation.Documentation Status (2026-02-16)
- All model names corrected to
wan22-video-generation+inputs.model: "seedance-20" - Response examples correctly show
model: "seedance20-video-generation"(toolId) - Branding updated: indigo theme (#6366f1), gradient text SVG logo, neon “S” favicon
- All code examples (cURL, Node.js, Python) updated across all pages
- Deployed via Cloudflare Worker proxy at
seedance2-pro.com/docs- Worker Route:
seedance2-pro.com/docs*(no slash before wildcard) - Proxies to:
zimagevip.mintlify.dev
- Worker Route:
Cloudflare Worker
Route pattern must bedocs* (not docs/*) to match both /docs and /docs/....
The Worker handles reverse proxy to Mintlify with redirect: "manual" to prevent
308 redirect loops.