词元无忧文档
    • 概况
    • 注册与登录
    • 个人设置
    • API 密钥创建
    • CC Switch 教程
    • Codex 全教程
    • Claude Code 全教程
    • GPT-Image-2 生图
    • Banana 生图
    • Seedance生视频

    Seedance生视频

    火山方舟视频生成接入指南#

    推荐模型:Seedance 2.5(doubao-seedance-2-5)
    OpenAI 兼容端点:POST /v1/video/generations
    官方 content 走:/api/v3/contents/generations/tasks

    核心参数速览#

    时长:4–30 秒,或 -1(模型自选)
    分辨率:480p / 720p / 1080p
    参考素材:最多 50 个(图 30 + 视频 10 + 音频 10)

    场景与 Body 约束(2.5 版本)#

    场景请求参数Seedance 2.5 约束
    文生视频仅需 prompt无特殊限制
    首帧/首尾帧images,支持 first_frame、last_frameratio 建议使用 adaptive
    参考生视频reference_*、omni_reference_task_type=auto参考视频建议 4-30 秒
    视频编辑reference_video、omni_reference_task_type=editratio=adaptive,duration=-1
    视频延长reference_video、omni_reference_task_type=extendratio=adaptive,时长 4-30 秒或 -1

    1. 基础请求信息#

    鉴权方式
    POST https://api.token5u.cn/v1/videos
    Authorization: Bearer <你的apikey>
    Content-Type: application/json

    2. 各场景请求示例#

    2.1 文生视频#

    curl -X POST "https://api.token5u.cn/v1/videos" 
      -H "Authorization: Bearer <你的apikey>" 
      -H "Content-Type: application/json" 
      -d '{
        "model": "Doubao-Seedance-2.0",
        "prompt": "一只穿红大衣的小猫在雪地里抓雪花,电影微距",
        "seconds": "5",
        "metadata": {
          "resolution": "480p",
          "ratio": "9:16",
          "generate_audio": true
        }
      }'
    seconds: 视频时长 可改为 30 或 -1(模型自选)
    resolution:分辨率 480p / 720p / 1080p

    2.2 图生视频(首帧 / 首尾帧)#

    curl -X POST "https://api.token5u.cn/v1/videos" \
      -H "Authorization: Bearer <你的apikey>" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "Doubao-Seedance-2.0",
        "prompt": "一只穿红大衣的小猫在雪地里抓雪花,电影微距",
        "seconds": "5",
        "metadata": {
          "content": [
            {
              "type": "image_url",
              "image_url": {
                "url": "https://example.com/first.png"
              },
              "role": "first_frame"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://example.com/last.png"
              },
              "role": "last_frame"
            }
          ],
          "resolution": "480p",
          "ratio": "16:9",
          "generate_audio": true
        }
      }'
    只要首帧时,去掉 last_frame 那一项。
    两张纯 URL 也会按首/尾帧推断。

    2.3 参考生(图/视频/音频)#

    curl -X POST "https://api.token5u.cn/v1/videos" \
      -H "Authorization: Bearer <你的apikey>" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "Doubao-Seedance-2.0",
        "prompt": "角色跟参考图一致,动作跟参考视频,节奏贴合参考音频",
        "seconds": "5",
        "metadata": {
          "content": [
            {
              "type": "image_url",
              "image_url": {
                "url": "https://example.com/char.png"
              },
              "role": "reference_image"
            },
            {
              "type": "video_url",
              "video_url": {
                "url": "https://example.com/motion.mp4"
              },
              "role": "reference_video"
            },
            {
              "type": "audio_url",
              "audio_url": {
                "url": "https://example.com/bgm.mp3"
              },
              "role": "reference_audio"
            }
          ],
          "ratio": "16:9",
    	  "resolution": "480p",
          "generate_audio": true
        }
      }'

    2.4 视频编辑#

    curl -X POST "https://api.token5u.cn/v1/videos" \
      -H "Authorization: Bearer <你的apikey>" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "Doubao-Seedance-2.0",
        "prompt": "将外套改为红色,构图与运镜不变",
        "metadata": {
          "content": [
            {
              "type": "video_url",
              "video_url": {
                "url": "https://example.com/motion.mp4"
              },
              "role": "reference_video"
            }
          ],
          "ratio": "adaptive",
    	  "resolution": "480p",
          "duration": -1,
          "generate_audio": true,
          "omni_reference_task_type": "edit",
          "output_format": "mov"
        }
      }'

    2.5 视频延长#

    curl -X POST "https://api.token5u.cn/v1/videos" \
      -H "Authorization: Bearer <你的apikey>" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "Doubao-Seedance-2.0",
        "prompt": "延续故事,人物继续走入街道",
        "seconds": "5",
        "metadata": {
          "content": [
            {
              "type": "video_url",
              "video_url": {
                "url": "https://example.com/clip.mp4"
              },
              "role": "reference_video"
            }
          ],
          "ratio": "adaptive",
    	  "resolution": "480p",
          "generate_audio": true,
          "omni_reference_task_type": "extend",
          "output_format": "mov"
        }
      }'
      
    关于 omni_reference_task_type:
    auto:按提示词自动判断,不符限制时异步报错。
    edit / extend:提交时前置校验。
    提示词需与类型一致:
    编辑:修改/替换/加上/去掉
    延长:延长/延续/续写
    关于 output_format:
    mp4(默认,兼容性好)
    mov(编辑、延长推荐,后期调色用)
    其他常用可选参数:
    web_search、watermark、return_last_frame、seed、camera_fixed
    若已有官方 content,则整包透传,不要再叠加 prompt/images。

    请求成功,返回 HTTP 200 OK。视频任务已进入队列:#

    {
      "id": "task_gwU1eA************bQAvDzRrL",
      "task_id": "task_gwU1eA************bQAvDzRrL",
      "object": "video",
      "model": "Doubao-Seedance-2.0",
      "status": "queued",
      "progress": 0,
      "created_at": 1787145328
    }

    查询任务状态:#

    curl "https://api.token5u.cn/v1/videos/task_gwU1eA************bQAvDzRrL" \
      -H "Authorization: Bearer YOUR_API_KEY"

    完整参数字典#

    参数类型必填说明
    modelstring是推荐 doubao-seedance-2-5
    promptstring是画面 / 编辑 / 延长意图
    images / image_urlsarray否URL 或 {url, role}:first_frame / last_frame / reference_image
    videosarray否{url, role: "reference_video"}
    audiosarray否{url, role: "reference_audio"};2.5 可仅音频
    resolutionstring否2.5:480p / 720p / 1080p
    ratiostring否21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 / adaptive
    durationinteger否2.5:4–30 或 -1(模型自选)
    omni_reference_task_typestring否全模态任务类型:auto / edit / extend。edit/extend 提交时校验;auto 不符限制则异步报错
    output_formatstring否mp4(默认)/ mov(编辑、延长推荐)
    generate_audioboolean否是否出音轨
    watermarkboolean否水印
    return_last_frameboolean否结果带回尾帧图
    web_searchboolean否联网搜索
    seedinteger否随机种子
    camera_fixedboolean否锁定镜头
    contentarray否官方多模态数组,有则直通
    说明:role 与 type 等价。

    错误响应#

    400 Bad Request#

    参数错误、模型不存在、模型名称拼写错误、JSON 格式错误或缺少必填字段时返回。
    {
      "error": {
        "message": "The model does not exist or you do not have access to it.",
        "type": "invalid_request_error",
        "param": "model",
        "code": "model_not_found"
      }
    }
    排查建议:
    1.
    检查 model 参数是否正确。
    2.
    确认当前账号有权访问该模型。
    3.
    检查 JSON 格式是否正确。
    4.
    确认必填参数是否完整。

    401 Unauthorized#

    API Key 无效、过期、缺失或授权格式错误时返回。
    {
      "error": {
        "message": "Invalid API Key or authorization header. Please check your credentials.",
        "type": "invalid_request_error",
        "param": null,
        "code": "invalid_api_key"
      }
    }
    排查建议:
    1.
    确认请求头包含以下内容:
    json Authorization: Bearer sk-xxx
    2.
    确认 Bearer 和 API Key 之间只有一个空格。
    3.
    确认 Token 未过期、未禁用或删除。

    429 Too Many Requests#

    余额不足或超过 RPM/TPM 频率限制时返回。
    {
      "error": {
        "message": "Your credit balance is insufficient. Please recharge your account.",
        "type": "insufficient_quota",
        "param": null,
        "code": "insufficient_quota"
      }
    }
    排查建议:
    1.
    检查账户余额是否充足。
    2.
    检查当前请求频率是否超过限制。
    3.
    客户端可以实现指数退避重试。
    4.
    如需提高并发限制,请联系平台管理员。
    修改于 2026-08-20 14:45:03
    上一页
    Banana 生图
    Built with