{"openapi":"3.1.0","info":{"title":"Seedance 2.0 Public API","version":"1.0.0","description":"Asynchronous Seedance video generation funded by paid personal credits. Credits are atomically reserved before remote media is downloaded. Successful outputs are copied to Seedance-managed storage before a task is marked completed.","termsOfService":"https://seedancetovideo.com/terms-of-service","contact":{"name":"Seedance API Support","url":"https://seedancetovideo.com/contact","email":"support@seedancetovideo.com"}},"servers":[{"url":"https://seedancetovideo.com/api/v1"}],"tags":[{"name":"Video","description":"Submit and query video generations."},{"name":"Credits","description":"Read the paid API credit balance."}],"paths":{"/video/generations":{"post":{"operationId":"createVideoGeneration","tags":["Video"],"summary":"Create a video generation task","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique key for this logical request. Reuse only with the identical body.","schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[a-zA-Z0-9._:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoGenerationRequest"}}}},"responses":{"200":{"description":"An identical idempotent request returned its existing task.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTask"}}}},"202":{"description":"A new asynchronous task was accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTask"}}}},"400":{"description":"Invalid request or media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Insufficient paid credits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The idempotency key belongs to another body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"The JSON body exceeds 64 KiB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Per-key rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Generation is temporarily unavailable or provider acceptance is uncertain. Retry only with the same Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/tasks/{id}":{"get":{"operationId":"getVideoGeneration","tags":["Video"],"summary":"Get a public API video task","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","maxLength":120}}],"responses":{"200":{"description":"Current durable task state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTask"}}}},"400":{"description":"Invalid task id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task not found for this account or API surface.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Per-key rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Task refresh is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/credits":{"get":{"operationId":"getPaidCreditBalance","tags":["Credits"],"summary":"Get paid personal credits available to the API","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Paid balance.","content":{"application/json":{"schema":{"type":"object","required":["available_credits","balance_type"],"properties":{"available_credits":{"type":"integer","minimum":0},"balance_type":{"type":"string","const":"paid"}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Per-key rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"sk_live_"}},"schemas":{"VideoGenerationRequest":{"type":"object","additionalProperties":false,"required":["prompt"],"description":"All input media combined must not exceed 256 MB. The API atomically reserves paid credits before downloading remote media. Failures confirmed before provider acceptance refund the reservation and delete inputs uploaded during that attempt. If provider acceptance is uncertain, the task, credits, and managed inputs are held for reconciliation; retry only with the same Idempotency-Key and never create a new key for that request. Reference videos are fully decoded so the server can verify their duration and dimensions; billing uses the measured duration and requested output resolution.","dependentRequired":{"reference_video_urls":["reference_video_durations"]},"properties":{"mode":{"type":"string","enum":["text-to-video","image-to-video","media-to-video"],"default":"text-to-video"},"model":{"type":"string","enum":["seedance-2.0","seedance-2.0-fast","seedance-2.0-mini"],"default":"seedance-2.0-fast"},"prompt":{"type":"string","minLength":3,"maxLength":4000},"aspect_ratio":{"type":"string","enum":["1:1","21:9","4:3","3:4","16:9","9:16","adaptive"],"default":"16:9"},"duration":{"type":"integer","minimum":4,"maximum":15,"default":5},"resolution":{"type":"string","enum":["480p","720p","1080p","4k"],"default":"720p"},"image_url":{"type":"string","format":"uri","maxLength":2048},"end_image_url":{"type":"string","format":"uri","maxLength":2048},"reference_image_urls":{"type":"array","maxItems":8,"items":{"type":"string","format":"uri","maxLength":2048}},"reference_video_urls":{"type":"array","maxItems":3,"description":"Up to 3 public HTTPS videos. Each video must be 2-15 seconds, use a 480p-720p short side, and all reference videos combined must be no longer than 15 seconds.","items":{"type":"string","format":"uri","maxLength":2048}},"reference_video_durations":{"type":"array","minItems":1,"maxItems":3,"description":"Required when reference_video_urls is present. Supply one whole-second duration for each URL so paid credits can be reserved before download. The server fully decodes every video, requires each value to match its measured duration, and bills using the measured duration.","items":{"type":"integer","minimum":2,"maximum":15}},"generate_audio":{"type":"boolean","default":true},"seed":{"type":"integer","minimum":-1,"maximum":4294967295}}},"VideoTask":{"type":"object","required":["id","status","model","mode","credits_used","credits_refunded","output","error","created_at","updated_at"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["processing","completed","failed"]},"model":{"type":"string","enum":["seedance-2.0","seedance-2.0-fast","seedance-2.0-mini"]},"mode":{"type":"string","enum":["text-to-video","image-to-video","media-to-video"]},"credits_used":{"type":"integer","minimum":0},"credits_refunded":{"type":"integer","minimum":0},"output":{"oneOf":[{"type":"null"},{"type":"object","required":["video_url"],"properties":{"video_url":{"type":"string","format":"uri","description":"A Seedance-managed delivery URL. A task is not marked completed until the provider output has been copied to managed storage."}}}]},"error":{"oneOf":[{"type":"null"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}