{
  "openapi": "3.1.0",
  "info": {
    "title": "Seedance Video Generation API",
    "version": "1.0.0",
    "description": "Create an asynchronous ByteDance Seedance video task through CometAPI. Use one of the six documented model IDs exactly. Seedance 2.5 accepts text prompts or reference images with the documented 480p and 720p WxH values. Save the returned id and poll GET /v1/videos/{id} until the status reaches completed."
  },
  "servers": [
    {
      "url": "https://api.cometapi.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/videos": {
      "post": {
        "summary": "Create a Seedance video task",
        "operationId": "seedance_create_video",
        "description": "Submit a Seedance video task as multipart/form-data. Use text prompts or reference images. For multiple images, repeat input_reference with one HTTPS image URL or uploaded file per field. Use only URLs or only files within input_reference. Seedance 2.0, Fast, Mini, and 2.5 also accept reference video and audio. Pair audio with at least one image or video. The endpoint returns a task ID; use GET /v1/videos/{id} to read the final result.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "prompt",
                  "model"
                ],
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "Text prompt that describes the video. Required. When using reference images, describe what each image should control, such as the subject from @Image1, the secondary object from @Image2, and the background or style from @Image3. Also state the action, camera motion, visual style, and scene.",
                    "example": "A slow cinematic camera push across a coastal landscape at sunrise."
                  },
                  "model": {
                    "type": "string",
                    "description": "Seedance model ID. Use one of the exact values below. Aliases such as seedance-mini are not accepted.",
                    "enum": [
                      "seedance-2-5",
                      "doubao-seedance-2-0",
                      "doubao-seedance-2-0-fast",
                      "doubao-seedance-2-0-mini",
                      "doubao-seedance-1-5-pro",
                      "doubao-seedance-1-0-pro"
                    ],
                    "example": "doubao-seedance-2-0-mini"
                  },
                  "seconds": {
                    "type": "integer",
                    "description": "Video duration in seconds. Seedance 2.5 accepts 4 to 30. Seedance 2.0, Seedance 2.0 Fast, and Seedance 2.0 Mini accept 4 to 15. Seedance 1.5 Pro accepts 4 to 12, and Seedance 1.0 Pro accepts 2 to 10. The default is 5.",
                    "minimum": 2,
                    "maximum": 30,
                    "default": 5,
                    "example": 5
                  },
                  "size": {
                    "type": "string",
                    "description": "Output size as an exact WxH value. For Seedance 2.5 text-to-video and image-to-video, use 854x480, 752x560, 640x640, 560x752, 480x854, or 992x432 for 480p; use 1280x720, 1112x834, 960x960, 834x1112, 720x1280, or 1470x630 for 720p. For Seedance 2.0 Mini, use 864x496, 752x560, 640x640, 560x752, 496x864, or 992x432 for 480p; use the same documented 720p values. The standard Seedance 2.0 model also accepts its documented 4K values.",
                    "pattern": "^[1-9]\\d{2,3}x[1-9]\\d{2,3}$",
                    "examples": [
                      "854x480",
                      "480x854",
                      "864x496",
                      "752x560",
                      "640x640",
                      "560x752",
                      "496x864",
                      "992x432",
                      "1280x720",
                      "1112x834",
                      "960x960",
                      "834x1112",
                      "720x1280",
                      "1470x630",
                      "1920x1080",
                      "1080x1920",
                      "3840x2160",
                      "3326x2494",
                      "2880x2880",
                      "2494x3326",
                      "2160x3840",
                      "4398x1886"
                    ],
                    "example": "1280x720"
                  },
                  "input_reference": {
                    "description": "Reference images: repeat input_reference with one publicly accessible HTTPS image URL or one uploaded image file per field. Use only URLs or only files within this field; do not join URLs with commas. Keep each uploaded image at or below 20 MiB. Seedance 2.0, Fast, and Mini allow up to nine image URLs or files and 12 reference inputs in total. Seedance 2.5 allows up to 30 image URLs or files and 50 reference inputs in total. For Seedance 1.0 Pro and 1.5 Pro, send one URL or one file. Submit images in the order you want to reference them in the prompt.",
                    "anyOf": [
                      {
                        "title": "Single image URL",
                        "type": "string",
                        "format": "uri",
                        "pattern": "^https://",
                        "description": "One publicly accessible HTTPS image URL."
                      },
                      {
                        "title": "Image URLs",
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 30,
                        "items": {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https://",
                          "description": "One publicly accessible HTTPS image URL."
                        }
                      },
                      {
                        "title": "Image files",
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 30,
                        "items": {
                          "type": "string",
                          "format": "binary",
                          "description": "One uploaded reference image file."
                        }
                      }
                    ]
                  },
                  "reference_videos": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https://",
                          "example": "https://your-media-host/reference.mp4"
                        },
                        {
                          "type": "string",
                          "format": "binary"
                        }
                      ]
                    },
                    "description": "Reference video inputs for Seedance 2.0, Fast, Mini, and 2.5. Repeat reference_videos with a publicly accessible HTTPS MP4 URL or an uploaded MP4 file. Use only URLs or only files within this field. Each file can be up to 50 MiB. Seedance 2.0, Fast, and Mini allow up to three video inputs and 12 reference inputs in total. Seedance 2.5 allows up to ten video URLs or five uploaded video files, with 50 reference inputs in total. For standard Seedance 2.0 (doubao-seedance-2-0), URL and uploaded references must have a combined video duration of 2 to 15 seconds and a total video size under 50 MB. Each reference video must have a resolution of approximately 480p (640x640) to 720p (834x1112). These media limits apply in addition to the 50 MiB per-file upload limit."
                  },
                  "reference_audios": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https://",
                          "example": "https://your-media-host/reference.mp3"
                        },
                        {
                          "type": "string",
                          "format": "binary"
                        }
                      ]
                    },
                    "description": "Reference audio inputs for Seedance 2.0, Fast, Mini, and 2.5. Repeat reference_audios with a publicly accessible HTTPS MP3 URL or an uploaded MP3 file. Use only URLs or only files within this field. Each file can be up to 15 MiB. Seedance 2.0, Fast, and Mini allow up to three audio inputs and 12 reference inputs in total. Seedance 2.5 allows up to ten audio URLs or five uploaded audio files, with 50 reference inputs in total. Pair audio with at least one reference image or video. For standard Seedance 2.0 (doubao-seedance-2-0), URL and uploaded audio references must have a combined duration at or below 15 seconds, with each audio file at or below 15 MB. These media limits apply in addition to the 15 MiB per-file upload limit."
                  }
                }
              },
              "encoding": {
                "input_reference": {
                  "contentType": "text/plain, image/jpeg, image/png, image/webp",
                  "style": "form",
                  "explode": true
                },
                "reference_videos": {
                  "contentType": "text/plain, video/mp4",
                  "style": "form",
                  "explode": true
                },
                "reference_audios": {
                  "contentType": "text/plain, audio/mpeg",
                  "style": "form",
                  "explode": true
                }
              },
              "examples": {
                "seedance_2_5_text_to_video": {
                  "summary": "Seedance 2.5 text-to-video",
                  "value": {
                    "prompt": "A matte magenta cube rotates slowly above a cyan studio floor while a small yellow sphere circles it.",
                    "model": "seedance-2-5",
                    "seconds": 4,
                    "size": "1280x720"
                  }
                },
                "seedance_2_5_single_reference_image": {
                  "summary": "Seedance 2.5 single-reference image-to-video",
                  "value": {
                    "prompt": "Animate the uploaded reference image with a gentle camera push-in and subtle object motion. Preserve its colors, shapes, and overall layout.",
                    "model": "seedance-2-5",
                    "seconds": 4,
                    "size": "720x1280",
                    "input_reference": [
                      "<binary image file>"
                    ]
                  }
                },
                "seedance_2_0_multiple_reference_images": {
                  "summary": "Multiple reference images (Seedance 2.0)",
                  "value": {
                    "prompt": "Use the uploaded images in order: keep the boy wearing glasses and a blue T-shirt from [Image 1], add the corgi puppy from [Image 2], and use the lawn from [Image 3] as the setting. Create a 4-second 3D cartoon video with the boy and puppy sitting together, a slow camera push-in, soft daylight, and no extra characters.",
                    "model": "doubao-seedance-2-0",
                    "seconds": 4,
                    "size": "720x1280",
                    "input_reference": [
                      "@/path/to/seelite_ref_1.png",
                      "@/path/to/seelite_ref_2.png",
                      "@/path/to/seelite_ref_3.png"
                    ]
                  }
                },
                "seedance_2_0_mini_text_to_video": {
                  "summary": "Seedance 2.0 Mini text-to-video",
                  "value": {
                    "prompt": "A matte red cube rotates slowly on a clean white studio floor. The camera remains fixed. Soft daylight and a short shadow.",
                    "model": "doubao-seedance-2-0-mini",
                    "seconds": 15,
                    "size": "1280x720"
                  }
                },
                "seedance_2_0_url_reference_image": {
                  "summary": "HTTPS reference image URLs (Seedance 2.0)",
                  "value": {
                    "model": "doubao-seedance-2-0",
                    "prompt": "Use the subject in @Image1 and the setting in @Image2. Use a slow camera push-in and natural motion.",
                    "seconds": 5,
                    "size": "1280x720",
                    "input_reference": [
                      "https://your-image-host/subject.png",
                      "https://your-image-host/setting.png"
                    ]
                  }
                },
                "seedance_2_0_reference_video_url": {
                  "summary": "HTTPS reference video (Seedance 2.0)",
                  "value": {
                    "model": "doubao-seedance-2-0",
                    "prompt": "Follow the camera movement and action in @Video1. Preserve the direction and pace of the motion.",
                    "seconds": 5,
                    "size": "1280x720",
                    "reference_videos": [
                      "https://your-media-host/reference.mp4"
                    ]
                  }
                },
                "seedance_2_0_image_audio_urls": {
                  "summary": "HTTPS reference audio with an image (Seedance 2.0)",
                  "value": {
                    "model": "doubao-seedance-2-0",
                    "prompt": "Animate the subject in @Image1 to the rhythm of @Audio1. Preserve the subject appearance and use a fixed camera.",
                    "seconds": 5,
                    "size": "1280x720",
                    "reference_audios": [
                      "https://your-media-host/reference.mp3"
                    ],
                    "input_reference": "https://your-image-host/subject.png"
                  }
                },
                "seedance_2_5_uploaded_reference_media": {
                  "summary": "Uploaded reference media (Seedance 2.5)",
                  "value": {
                    "model": "seedance-2-5",
                    "prompt": "Use the subject in @Image1 and the setting in @Image2. Follow the motion in @Video1 and the rhythm of @Audio1.",
                    "seconds": 5,
                    "size": "1280x720",
                    "input_reference": [
                      "@/path/to/subject.png",
                      "@/path/to/setting.png"
                    ],
                    "reference_videos": [
                      "@/path/to/reference.mp4"
                    ],
                    "reference_audios": [
                      "@/path/to/reference.mp3"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task created. Save the returned id and poll GET /v1/videos/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVideoResponse"
                },
                "example": {
                  "id": "task_abc123",
                  "task_id": "task_abc123",
                  "object": "video",
                  "model": "doubao-seedance-2-0-mini",
                  "status": "queued",
                  "progress": 0,
                  "created_at": 1776681149
                }
              }
            }
          },
          "400": {
            "description": "The request is missing a required field or contains an out-of-range value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "missing_prompt": {
                    "summary": "prompt field missing",
                    "value": {
                      "code": "invalid_request",
                      "message": "prompt is required"
                    }
                  },
                  "missing_model": {
                    "summary": "model field missing",
                    "value": {
                      "error": {
                        "code": "",
                        "message": "model name is required",
                        "type": "comet_api_error"
                      }
                    }
                  },
                  "invalid_duration": {
                    "summary": "seconds outside the per-model range",
                    "value": {
                      "code": "InvalidParameter",
                      "message": "the parameter duration specified in the request is not valid"
                    }
                  },
                  "i2v_not_supported": {
                    "summary": "input_reference sent with a 1.0 Pro or 1.5 Pro model",
                    "value": {
                      "code": "InvalidParameter",
                      "message": "The parameter task_type specified in the request is not valid: the specified task_type r2v does not support model seedance-1-5-pro"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_token": {
                    "summary": "Bearer token rejected",
                    "value": {
                      "error": {
                        "code": "",
                        "message": "invalid token",
                        "type": "comet_api_error"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "Text-to-video (Seedance 2.5, exact 1280x720)",
            "source": "curl https://api.cometapi.com/v1/videos \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -F 'prompt=\"A matte magenta cube rotates slowly above a cyan studio floor while a small yellow sphere circles it.\"' \\\n  -F 'model=\"seedance-2-5\"' \\\n  -F 'seconds=\"4\"' \\\n  -F 'size=\"1280x720\"'"
          },
          {
            "lang": "Python",
            "label": "Text-to-video (Seedance 2.5, exact 1280x720)",
            "source": "import os\nimport requests\n\nresponse = requests.post(\n    \"https://api.cometapi.com/v1/videos\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"COMETAPI_KEY\"]},\n    data={\n        \"prompt\": \"A matte magenta cube rotates slowly above a cyan studio floor while a small yellow sphere circles it.\",\n        \"model\": \"seedance-2-5\",\n        \"seconds\": \"4\",\n        \"size\": \"1280x720\",\n    },\n    timeout=30,\n)\n\nresponse.raise_for_status()\nprint(response.json())\n"
          },
          {
            "lang": "JavaScript",
            "label": "Text-to-video (Seedance 2.5, exact 1280x720)",
            "source": "const form = new FormData();\nform.append(\"prompt\", \"A matte magenta cube rotates slowly above a cyan studio floor while a small yellow sphere circles it.\");\nform.append(\"model\", \"seedance-2-5\");\nform.append(\"seconds\", \"4\");\nform.append(\"size\", \"1280x720\");\n\nconst response = await fetch(\"https://api.cometapi.com/v1/videos\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },\n  body: form,\n});\n\nconst result = await response.json();\nconsole.log(result);\n"
          },
          {
            "lang": "Shell",
            "label": "Single reference image (Seedance 2.5)",
            "source": "curl https://api.cometapi.com/v1/videos \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -F 'prompt=\"Animate the uploaded reference image with a gentle camera push-in and subtle object motion. Preserve its colors, shapes, and overall layout.\"' \\\n  -F 'model=\"seedance-2-5\"' \\\n  -F 'seconds=\"4\"' \\\n  -F 'size=\"720x1280\"' \\\n  -F 'input_reference=@\"/path/to/reference.png\"'"
          },
          {
            "lang": "Python",
            "label": "Single reference image (Seedance 2.5)",
            "source": "import os\nimport requests\n\nprompt = \"Animate the uploaded reference image with a gentle camera push-in and subtle object motion. Preserve its colors, shapes, and overall layout.\"\n\nwith open(\"/path/to/reference.png\", \"rb\") as image:\n    response = requests.post(\n        \"https://api.cometapi.com/v1/videos\",\n        headers={\"Authorization\": \"Bearer \" + os.environ[\"COMETAPI_KEY\"]},\n        data={\n            \"prompt\": prompt,\n            \"model\": \"seedance-2-5\",\n            \"seconds\": \"4\",\n            \"size\": \"720x1280\",\n        },\n        files={\"input_reference\": (\"reference.png\", image, \"image/png\")},\n        timeout=30,\n    )\n\nresponse.raise_for_status()\nprint(response.json())\n"
          },
          {
            "lang": "JavaScript",
            "label": "Single reference image (Seedance 2.5)",
            "source": "import { readFile } from \"node:fs/promises\";\n\nconst image = await readFile(\"/path/to/reference.png\");\nconst form = new FormData();\nform.append(\"prompt\", \"Animate the uploaded reference image with a gentle camera push-in and subtle object motion. Preserve its colors, shapes, and overall layout.\");\nform.append(\"model\", \"seedance-2-5\");\nform.append(\"seconds\", \"4\");\nform.append(\"size\", \"720x1280\");\nform.append(\"input_reference\", new Blob([image], { type: \"image/png\" }), \"reference.png\");\n\nconst response = await fetch(\"https://api.cometapi.com/v1/videos\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },\n  body: form,\n});\n\nconst result = await response.json();\nconsole.log(result);\n"
          },
          {
            "lang": "Shell",
            "label": "Text-to-video (Seedance 2.0 Mini, exact 1280x720)",
            "source": "curl https://api.cometapi.com/v1/videos \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -F 'prompt=\"A matte red cube rotates slowly on a clean white studio floor. The camera remains fixed. Soft daylight and a short shadow.\"' \\\n  -F 'model=\"doubao-seedance-2-0-mini\"' \\\n  -F 'seconds=\"15\"' \\\n  -F 'size=\"1280x720\"'"
          },
          {
            "lang": "Python",
            "label": "Text-to-video (Seedance 2.0 Mini, exact 1280x720)",
            "source": "import os\nimport requests\n\nresponse = requests.post(\n    \"https://api.cometapi.com/v1/videos\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"COMETAPI_KEY\"]},\n    data={\n        \"prompt\": \"A matte red cube rotates slowly on a clean white studio floor. The camera remains fixed. Soft daylight and a short shadow.\",\n        \"model\": \"doubao-seedance-2-0-mini\",\n        \"seconds\": \"15\",\n        \"size\": \"1280x720\",\n    },\n    timeout=30,\n)\n\nresponse.raise_for_status()\nprint(response.json())\n"
          },
          {
            "lang": "JavaScript",
            "label": "Text-to-video (Seedance 2.0 Mini, exact 1280x720)",
            "source": "const form = new FormData();\nform.append(\"prompt\", \"A matte red cube rotates slowly on a clean white studio floor. The camera remains fixed. Soft daylight and a short shadow.\");\nform.append(\"model\", \"doubao-seedance-2-0-mini\");\nform.append(\"seconds\", \"15\");\nform.append(\"size\", \"1280x720\");\n\nconst response = await fetch(\"https://api.cometapi.com/v1/videos\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },\n  body: form,\n});\n\nconst result = await response.json();\nconsole.log(result);\n"
          },
          {
            "lang": "Shell",
            "label": "Single reference image (Seedance 2.0)",
            "source": "curl https://api.cometapi.com/v1/videos \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -F 'prompt=\"Use [Image 1] as the main visual reference. Preserve the subject identity, clothing colors, and overall composition from [Image 1]. Create a 4-second video with a gentle camera push-in, subtle natural motion, warm daylight, and a realistic cinematic style.\"' \\\n  -F 'model=\"doubao-seedance-2-0\"' \\\n  -F 'seconds=\"4\"' \\\n  -F 'size=\"720x1280\"' \\\n  -F 'input_reference=@\"/path/to/reference.png\"'"
          },
          {
            "lang": "Python",
            "label": "Single reference image (Seedance 2.0)",
            "source": "import os\nimport requests\n\nprompt = \"Use [Image 1] as the main visual reference. Preserve the subject identity, clothing colors, and overall composition from [Image 1]. Create a 4-second video with a gentle camera push-in, subtle natural motion, warm daylight, and a realistic cinematic style.\"\n\nwith open(\"/path/to/reference.png\", \"rb\") as image:\n    response = requests.post(\n        \"https://api.cometapi.com/v1/videos\",\n        headers={\"Authorization\": \"Bearer \" + os.environ[\"COMETAPI_KEY\"]},\n        data={\n            \"prompt\": prompt,\n            \"model\": \"doubao-seedance-2-0\",\n            \"seconds\": \"4\",\n            \"size\": \"720x1280\",\n        },\n        files=[(\"input_reference\", (\"reference.png\", image, \"image/png\"))],\n        timeout=30,\n    )\n\nresponse.raise_for_status()\nprint(response.json())\n"
          },
          {
            "lang": "JavaScript",
            "label": "Single reference image (Seedance 2.0)",
            "source": "import { readFile } from \"node:fs/promises\";\n\nconst prompt = \"Use [Image 1] as the main visual reference. Preserve the subject identity, clothing colors, and overall composition from [Image 1]. Create a 4-second video with a gentle camera push-in, subtle natural motion, warm daylight, and a realistic cinematic style.\";\nconst image = await readFile(\"/path/to/reference.png\");\n\nconst form = new FormData();\nform.append(\"prompt\", prompt);\nform.append(\"model\", \"doubao-seedance-2-0\");\nform.append(\"seconds\", \"4\");\nform.append(\"size\", \"720x1280\");\nform.append(\"input_reference\", new Blob([image], { type: \"image/png\" }), \"reference.png\");\n\nconst response = await fetch(\"https://api.cometapi.com/v1/videos\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },\n  body: form,\n});\n\nconst result = await response.json();\nconsole.log(result);\n"
          },
          {
            "lang": "Shell",
            "label": "Multiple reference images (Seedance 2.0)",
            "source": "curl https://api.cometapi.com/v1/videos \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -F 'prompt=\"Use the uploaded images in order: keep the boy wearing glasses and a blue T-shirt from [Image 1], add the corgi puppy from [Image 2], and use the lawn from [Image 3] as the setting. Create a 4-second 3D cartoon video with the boy and puppy sitting together, a slow camera push-in, soft daylight, and no extra characters.\"' \\\n  -F 'model=\"doubao-seedance-2-0\"' \\\n  -F 'seconds=\"4\"' \\\n  -F 'size=\"720x1280\"' \\\n  -F 'input_reference=@\"/path/to/seelite_ref_1.png\"' \\\n  -F 'input_reference=@\"/path/to/seelite_ref_2.png\"' \\\n  -F 'input_reference=@\"/path/to/seelite_ref_3.png\"'"
          },
          {
            "lang": "Python",
            "label": "Multiple reference images (Seedance 2.0)",
            "source": "import os\nimport requests\n\nprompt = \"Use the uploaded images in order: keep the boy wearing glasses and a blue T-shirt from [Image 1], add the corgi puppy from [Image 2], and use the lawn from [Image 3] as the setting. Create a 4-second 3D cartoon video with the boy and puppy sitting together, a slow camera push-in, soft daylight, and no extra characters.\"\n\nwith open(\"/path/to/seelite_ref_1.png\", \"rb\") as image_1, open(\"/path/to/seelite_ref_2.png\", \"rb\") as image_2, open(\"/path/to/seelite_ref_3.png\", \"rb\") as image_3:\n    response = requests.post(\n        \"https://api.cometapi.com/v1/videos\",\n        headers={\"Authorization\": \"Bearer \" + os.environ[\"COMETAPI_KEY\"]},\n        data={\n            \"prompt\": prompt,\n            \"model\": \"doubao-seedance-2-0\",\n            \"seconds\": \"4\",\n            \"size\": \"720x1280\",\n        },\n        files=[\n            (\"input_reference\", (\"seelite_ref_1.png\", image_1, \"image/png\")),\n            (\"input_reference\", (\"seelite_ref_2.png\", image_2, \"image/png\")),\n            (\"input_reference\", (\"seelite_ref_3.png\", image_3, \"image/png\")),\n        ],\n        timeout=30,\n    )\n\nresponse.raise_for_status()\nprint(response.json())\n"
          },
          {
            "lang": "JavaScript",
            "label": "Multiple reference images (Seedance 2.0)",
            "source": "import { readFile } from \"node:fs/promises\";\n\nconst prompt = \"Use the uploaded images in order: keep the boy wearing glasses and a blue T-shirt from [Image 1], add the corgi puppy from [Image 2], and use the lawn from [Image 3] as the setting. Create a 4-second 3D cartoon video with the boy and puppy sitting together, a slow camera push-in, soft daylight, and no extra characters.\";\nconst image1 = await readFile(\"/path/to/seelite_ref_1.png\");\nconst image2 = await readFile(\"/path/to/seelite_ref_2.png\");\nconst image3 = await readFile(\"/path/to/seelite_ref_3.png\");\n\nconst form = new FormData();\nform.append(\"prompt\", prompt);\nform.append(\"model\", \"doubao-seedance-2-0\");\nform.append(\"seconds\", \"4\");\nform.append(\"size\", \"720x1280\");\nform.append(\"input_reference\", new Blob([image1], { type: \"image/png\" }), \"seelite_ref_1.png\");\nform.append(\"input_reference\", new Blob([image2], { type: \"image/png\" }), \"seelite_ref_2.png\");\nform.append(\"input_reference\", new Blob([image3], { type: \"image/png\" }), \"seelite_ref_3.png\");\n\nconst response = await fetch(\"https://api.cometapi.com/v1/videos\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },\n  body: form,\n});\n\nconst result = await response.json();\nconsole.log(result);\n"
          },
          {
            "lang": "Shell",
            "label": "Text-to-video (exact 1920x1080)",
            "source": "curl https://api.cometapi.com/v1/videos \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -F 'prompt=\"A slow cinematic camera push across a coastal landscape at sunrise\"' \\\n  -F 'model=\"doubao-seedance-1-5-pro\"' \\\n  -F 'seconds=\"4\"' \\\n  -F 'size=\"1920x1080\"'"
          },
          {
            "lang": "Python",
            "label": "Text-to-video (exact 1920x1080)",
            "source": "import os\nimport requests\n\nresponse = requests.post(\n    \"https://api.cometapi.com/v1/videos\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"COMETAPI_KEY\"]},\n    data={\n        \"prompt\": \"A slow cinematic camera push across a coastal landscape at sunrise\",\n        \"model\": \"doubao-seedance-2-0\",\n        \"seconds\": \"4\",\n        \"size\": \"1920x1080\",\n    },\n    timeout=30,\n)\n\nresponse.raise_for_status()\nprint(response.json())\n"
          },
          {
            "lang": "JavaScript",
            "label": "Text-to-video (exact 1920x1080)",
            "source": "const form = new FormData();\nform.append(\"prompt\", \"A slow cinematic camera push across a coastal landscape at sunrise\");\nform.append(\"model\", \"doubao-seedance-1-5-pro\");\nform.append(\"seconds\", \"4\");\nform.append(\"size\", \"1920x1080\");\n\nconst response = await fetch(\"https://api.cometapi.com/v1/videos\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },\n  body: form,\n});\n\nconst result = await response.json();\nconsole.log(result);\n"
          },
          {
            "lang": "Shell",
            "label": "HTTPS reference image URLs (Seedance 2.0)",
            "source": "curl \\\n  https://api.cometapi.com/v1/videos \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  --form-string model=doubao-seedance-2-0 \\\n  --form-string 'prompt=Use the subject in @Image1 and the setting in @Image2. Use a slow camera push-in and natural motion.' \\\n  --form-string seconds=5 \\\n  --form-string size=1280x720 \\\n  --form-string input_reference=https://your-image-host/subject.png \\\n  --form-string input_reference=https://your-image-host/setting.png\n"
          },
          {
            "lang": "Python",
            "label": "HTTPS reference image URLs (Seedance 2.0)",
            "source": "import os\n\nimport requests\n\nfields = [\n    (\"model\", (None, \"doubao-seedance-2-0\")),\n    (\n        \"prompt\",\n        (\n            None,\n            \"Use the subject in @Image1 and the setting in @Image2. Use a \"\n            \"slow camera push-in and natural motion.\"\n        ),\n    ),\n    (\"seconds\", (None, \"5\")),\n    (\"size\", (None, \"1280x720\")),\n    (\"input_reference\", (None, \"https://your-image-host/subject.png\")),\n    (\"input_reference\", (None, \"https://your-image-host/setting.png\")),\n]\n\nresponse = requests.post(\n    \"https://api.cometapi.com/v1/videos\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"COMETAPI_KEY\"]\n    },\n    files=fields,\n    timeout=120,\n)\n\nresponse.raise_for_status()\nprint(response.json())\n"
          },
          {
            "lang": "JavaScript",
            "label": "HTTPS reference image URLs (Seedance 2.0)",
            "source": "const form = new FormData();\nform.append(\"model\", \"doubao-seedance-2-0\");\nform.append(\n  \"prompt\",\n  \"Use the subject in @Image1 and the setting in @Image2. Use a slow \" +\n  \"camera push-in and natural motion.\",\n);\nform.append(\"seconds\", \"5\");\nform.append(\"size\", \"1280x720\");\nform.append(\"input_reference\", \"https://your-image-host/subject.png\");\nform.append(\"input_reference\", \"https://your-image-host/setting.png\");\n\nconst response = await fetch(\"https://api.cometapi.com/v1/videos\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },\n  body: form,\n});\n\nif (!response.ok) {\n  throw new Error(await response.text());\n}\n\nconsole.log(await response.json());\n"
          },
          {
            "lang": "Shell",
            "label": "HTTPS reference video (Seedance 2.0)",
            "source": "curl \\\n  https://api.cometapi.com/v1/videos \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  --form-string 'model=doubao-seedance-2-0' \\\n  --form-string 'prompt=Follow the camera movement and action in @Video1. Preserve the direction and pace of the motion.' \\\n  --form-string 'seconds=5' \\\n  --form-string 'size=1280x720' \\\n  --form-string 'reference_videos=https://your-media-host/reference.mp4'\n"
          },
          {
            "lang": "Python",
            "label": "HTTPS reference video (Seedance 2.0)",
            "source": "import os\n\nimport requests\n\nprompt = (\n    \"Follow the camera movement and action in @Video1. Preserve the \"\n    \"direction and pace of the motion.\"\n)\n\nfields = [\n    (\"model\", (None, \"doubao-seedance-2-0\")),\n    (\"prompt\", (None, prompt)),\n    (\"seconds\", (None, \"5\")),\n    (\"size\", (None, \"1280x720\")),\n    (\"reference_videos\", (None, \"https://your-media-host/reference.mp4\")),\n]\n\nresponse = requests.post(\n    \"https://api.cometapi.com/v1/videos\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"COMETAPI_KEY\"]\n    },\n    files=fields,\n    timeout=120,\n)\n\nresponse.raise_for_status()\nprint(response.json())\n"
          },
          {
            "lang": "JavaScript",
            "label": "HTTPS reference video (Seedance 2.0)",
            "source": "const form = new FormData();\nform.append(\"model\", \"doubao-seedance-2-0\");\nform.append(\n  \"prompt\",\n  \"Follow the camera movement and action in @Video1. Preserve the \" +\n  \"direction and pace of the motion.\",\n);\nform.append(\"seconds\", \"5\");\nform.append(\"size\", \"1280x720\");\nform.append(\"reference_videos\", \"https://your-media-host/reference.mp4\");\n\nconst response = await fetch(\"https://api.cometapi.com/v1/videos\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },\n  body: form,\n});\n\nif (!response.ok) {\n  throw new Error(await response.text());\n}\n\nconsole.log(await response.json());\n"
          },
          {
            "lang": "Shell",
            "label": "HTTPS reference audio with an image (Seedance 2.0)",
            "source": "curl \\\n  https://api.cometapi.com/v1/videos \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  --form-string model=doubao-seedance-2-0 \\\n  --form-string 'prompt=Animate the subject in @Image1 to the rhythm of @Audio1. Preserve the subject appearance and use a fixed camera.' \\\n  --form-string seconds=5 \\\n  --form-string size=1280x720 \\\n  --form-string reference_audios=https://your-media-host/reference.mp3 \\\n  --form-string input_reference=https://your-image-host/subject.png\n"
          },
          {
            "lang": "Python",
            "label": "HTTPS reference audio with an image (Seedance 2.0)",
            "source": "import os\n\nimport requests\n\nfields = [\n    (\"model\", (None, \"doubao-seedance-2-0\")),\n    (\n        \"prompt\",\n        (\n            None,\n            \"Animate the subject in @Image1 to the rhythm of @Audio1. \"\n            \"Preserve the subject appearance and use a fixed camera.\"\n        ),\n    ),\n    (\"seconds\", (None, \"5\")),\n    (\"size\", (None, \"1280x720\")),\n    (\"reference_audios\", (None, \"https://your-media-host/reference.mp3\")),\n    (\"input_reference\", (None, \"https://your-image-host/subject.png\")),\n]\n\nresponse = requests.post(\n    \"https://api.cometapi.com/v1/videos\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"COMETAPI_KEY\"]\n    },\n    files=fields,\n    timeout=120,\n)\n\nresponse.raise_for_status()\nprint(response.json())\n"
          },
          {
            "lang": "JavaScript",
            "label": "HTTPS reference audio with an image (Seedance 2.0)",
            "source": "const form = new FormData();\nform.append(\"model\", \"doubao-seedance-2-0\");\nform.append(\n  \"prompt\",\n  \"Animate the subject in @Image1 to the rhythm of @Audio1. Preserve the \" +\n  \"subject appearance and use a fixed camera.\",\n);\nform.append(\"seconds\", \"5\");\nform.append(\"size\", \"1280x720\");\nform.append(\"reference_audios\", \"https://your-media-host/reference.mp3\");\nform.append(\"input_reference\", \"https://your-image-host/subject.png\");\n\nconst response = await fetch(\"https://api.cometapi.com/v1/videos\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },\n  body: form,\n});\n\nif (!response.ok) {\n  throw new Error(await response.text());\n}\n\nconsole.log(await response.json());\n"
          },
          {
            "lang": "Shell",
            "label": "Uploaded reference media (Seedance 2.5)",
            "source": "curl \\\n  https://api.cometapi.com/v1/videos \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  --form-string 'model=seedance-2-5' \\\n  --form-string 'prompt=Use the subject in @Image1 and the setting in @Image2. Follow the motion in @Video1 and the rhythm of @Audio1.' \\\n  --form-string 'seconds=5' \\\n  --form-string 'size=1280x720' \\\n  --form 'input_reference=@/path/to/subject.png;type=image/png' \\\n  --form 'input_reference=@/path/to/setting.png;type=image/png' \\\n  --form 'reference_videos=@/path/to/reference.mp4;type=video/mp4' \\\n  --form 'reference_audios=@/path/to/reference.mp3;type=audio/mpeg'\n"
          },
          {
            "lang": "Python",
            "label": "Uploaded reference media (Seedance 2.5)",
            "source": "import os\nfrom contextlib import ExitStack\n\nimport requests\n\nprompt = (\n    \"Use the subject in @Image1 and the setting in @Image2. Follow the \"\n    \"motion in @Video1 and the rhythm of @Audio1.\"\n)\n\nwith ExitStack() as stack:\n    fields = [\n        (\"model\", (None, \"seedance-2-5\")),\n        (\"prompt\", (None, prompt)),\n        (\"seconds\", (None, \"5\")),\n        (\"size\", (None, \"1280x720\")),\n        (\n            \"input_reference\",\n            (\n                \"subject.png\",\n                stack.enter_context(\n                    open(\"/path/to/subject.png\", \"rb\")\n                ),\n                \"image/png\",\n            ),\n        ),\n        (\n            \"input_reference\",\n            (\n                \"setting.png\",\n                stack.enter_context(\n                    open(\"/path/to/setting.png\", \"rb\")\n                ),\n                \"image/png\",\n            ),\n        ),\n        (\n            \"reference_videos\",\n            (\n                \"reference.mp4\",\n                stack.enter_context(\n                    open(\"/path/to/reference.mp4\", \"rb\")\n                ),\n                \"video/mp4\",\n            ),\n        ),\n        (\n            \"reference_audios\",\n            (\n                \"reference.mp3\",\n                stack.enter_context(\n                    open(\"/path/to/reference.mp3\", \"rb\")\n                ),\n                \"audio/mpeg\",\n            ),\n        ),\n    ]\n\n    response = requests.post(\n        \"https://api.cometapi.com/v1/videos\",\n        headers={\n            \"Authorization\": \"Bearer \" + os.environ[\"COMETAPI_KEY\"]\n        },\n        files=fields,\n        timeout=120,\n    )\n\nresponse.raise_for_status()\nprint(response.json())\n"
          },
          {
            "lang": "JavaScript",
            "label": "Uploaded reference media (Seedance 2.5)",
            "source": "import { readFile } from \"node:fs/promises\";\n\nconst form = new FormData();\nform.append(\"model\", \"seedance-2-5\");\nform.append(\n  \"prompt\",\n  \"Use the subject in @Image1 and the setting in @Image2. Follow the \" +\n  \"motion in @Video1 and the rhythm of @Audio1.\",\n);\nform.append(\"seconds\", \"5\");\nform.append(\"size\", \"1280x720\");\nform.append(\n  \"input_reference\",\n  new Blob([await readFile(\"/path/to/subject.png\")], {\n    type: \"image/png\",\n  }),\n  \"subject.png\",\n);\nform.append(\n  \"input_reference\",\n  new Blob([await readFile(\"/path/to/setting.png\")], {\n    type: \"image/png\",\n  }),\n  \"setting.png\",\n);\nform.append(\n  \"reference_videos\",\n  new Blob([await readFile(\"/path/to/reference.mp4\")], {\n    type: \"video/mp4\",\n  }),\n  \"reference.mp4\",\n);\nform.append(\n  \"reference_audios\",\n  new Blob([await readFile(\"/path/to/reference.mp3\")], {\n    type: \"audio/mpeg\",\n  }),\n  \"reference.mp3\",\n);\n\nconst response = await fetch(\"https://api.cometapi.com/v1/videos\", {\n  method: \"POST\",\n  headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },\n  body: form,\n});\n\nif (!response.ok) {\n  throw new Error(await response.text());\n}\n\nconsole.log(await response.json());\n"
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token authentication. Use your CometAPI key."
      }
    },
    "schemas": {
      "CreateVideoResponse": {
        "type": "object",
        "required": [
          "id",
          "object",
          "model",
          "status",
          "progress",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Task id. Use it as the path parameter for GET /v1/videos/{id}."
          },
          "task_id": {
            "type": "string",
            "description": "Alias of id returned for compatibility. The value matches id."
          },
          "object": {
            "type": "string",
            "description": "Object type, always video."
          },
          "model": {
            "type": "string",
            "description": "Echo of the requested model id."
          },
          "status": {
            "type": "string",
            "description": "Initial task status. Newly created tasks are returned as queued.",
            "enum": [
              "queued",
              "in_progress",
              "completed",
              "failed",
              "error"
            ]
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "Completion percentage. 0 at creation."
          },
          "created_at": {
            "type": "integer",
            "description": "Task creation time as a Unix timestamp in seconds."
          }
        },
        "additionalProperties": true
      },
      "ErrorResponse": {
        "description": "Error body. The endpoint returns one of two shapes depending on where the validation fails.",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Short error code such as invalid_request or InvalidParameter."
              },
              "message": {
                "type": "string",
                "description": "Human-readable error message."
              }
            },
            "required": [
              "message"
            ],
            "additionalProperties": true
          },
          {
            "type": "object",
            "properties": {
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Error code that identifies the request failure."
                  },
                  "message": {
                    "type": "string",
                    "description": "Description of the request failure."
                  },
                  "type": {
                    "type": "string",
                    "description": "Error category, for example comet_api_error."
                  }
                },
                "required": [
                  "message",
                  "type"
                ],
                "additionalProperties": true,
                "description": "Error details for a request that could not be processed."
              }
            },
            "required": [
              "error"
            ],
            "additionalProperties": true
          }
        ]
      }
    }
  }
}
