# Seed Audio 1.0 音频生成

> 音频生成

提交音频生成请求。请求中传入提示词、可选的参考资源与音频配置，响应返回二进制音频数据。
计费以模型输出的原始音频时长 `original_duration` 为准（秒），上限 120 秒。

## 请求地址

`POST https://api.modelverse.cn/v1/audio/speech`

## 请求体

## 响应

- **200** — 二进制音频数据，格式由 `audio_config.format` 决定。
- **400** — 请求参数无效。
- **default** — 错误响应。

## OpenAPI 定义

```json
{
  "openapi": "3.1.0",
  "x-language": "zh-CN",
  "info": {
    "title": "seed-audio-1.0接口文档",
    "version": "1.0.0",
    "description": "`seed-audio-1.0` 模型支持三种生成模式，由 `references` 是否传入自动匹配：\n\n- 纯文本生成：只传 `text_prompt`，系统按提示词描述生成音频；\n- 参考音频生成：传入 `references` 中的音频参考（`speaker` / `audio_data` / `audio_url`），并在 `text_prompt` 中用 `@音频1`、`@音频2` 引用；\n- 参考图片生成：传入 `references` 中的图片参考（`image_data` / `image_url`），`text_prompt` 只传待合成文本。\n\n单次最长可生成 120 秒音频。响应为二进制音频流（不是 JSON），音频格式由 `audio_config.format` 决定，\n响应头 `Content-Type` 优先由 `audio_config.format` 推导，未传时回退到 `response_format`。\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "ModelVerse API endpoint shown in the source document."
    }
  ],
  "tags": [
    {
      "name": "Seed Audio 1.0",
      "description": "火山引擎 Seed Audio 1.0 音频生成，覆盖音效、配音与音色复刻场景。"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/audio/speech": {
      "post": {
        "tags": [
          "Seed Audio 1.0"
        ],
        "operationId": "createSeedAudioSpeech",
        "summary": "Seed Audio 1.0 音频生成",
        "description": "提交音频生成请求。请求中传入提示词、可选的参考资源与音频配置，响应返回二进制音频数据。\n计费以模型输出的原始音频时长 `original_duration` 为准（秒），上限 120 秒。\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SeedAudioSpeechRequest"
              },
              "examples": {
                "textOnly": {
                  "summary": "纯文本生成（音效 + 对白）",
                  "value": {
                    "model": "seed-audio-1.0",
                    "text_prompt": "先是一声手机震动的声音，环境中持续的鸟鸣声。音乐以马林巴为主奏乐器，加入合成器 lead、电贝斯、打击乐，整体情绪紧张悬疑。",
                    "audio_config": {
                      "format": "mp3",
                      "sample_rate": 48000
                    }
                  }
                },
                "systemSpeaker": {
                  "summary": "使用系统音色合成",
                  "value": {
                    "model": "seed-audio-1.0",
                    "text_prompt": "欢迎使用 ModelVerse 的 Seed Audio 音频生成服务。",
                    "references": [
                      {
                        "speaker": "zh_female_vv_uranus_bigtts"
                      }
                    ],
                    "audio_config": {
                      "format": "wav",
                      "sample_rate": 40000,
                      "speech_rate": 0,
                      "loudness_rate": 0,
                      "pitch_rate": 0
                    }
                  }
                },
                "referenceAudioByUrl": {
                  "summary": "参考音频生成（用 @音频N 引用）",
                  "value": {
                    "model": "seed-audio-1.0",
                    "text_prompt": "@音频1 用低沉沙哑的语气说：既然你都知道了，我也没有什么好隐瞒的。",
                    "references": [
                      {
                        "audio_url": "https://example.com/speaker.wav"
                      }
                    ],
                    "audio_config": {
                      "format": "mp3",
                      "sample_rate": 44100
                    }
                  }
                },
                "referenceImage": {
                  "summary": "参考图片生成",
                  "value": {
                    "model": "seed-audio-1.0",
                    "text_prompt": "一只小鸟在清晨的森林里清脆地鸣叫。",
                    "references": [
                      {
                        "image_url": "https://example.com/bird.png"
                      }
                    ],
                    "audio_config": {
                      "format": "wav",
                      "sample_rate": 40000
                    }
                  }
                },
                "withSubtitleAndWatermark": {
                  "summary": "开启字幕与 AIGC 水印",
                  "value": {
                    "model": "seed-audio-1.0",
                    "text_prompt": "这是一段需要返回字级时间戳的试听音频。",
                    "references": [
                      {
                        "speaker": "zh_male_m191_uranus_bigtts"
                      }
                    ],
                    "audio_config": {
                      "format": "mp3",
                      "sample_rate": 44100,
                      "enable_subtitle": true
                    },
                    "watermark": {
                      "aigc_watermark": true,
                      "aigc_metadata": {
                        "enable": true,
                        "content_producer": "modelverse",
                        "produce_id": "seed-audio-1.0",
                        "content_propagator": "modelverse",
                        "propagate_id": "seed-audio-1.0"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "二进制音频数据，格式由 `audio_config.format` 决定。",
            "content": {
              "audio/wav": {
                "schema": {
                  "$ref": "#/components/schemas/SeedAudioBinary"
                },
                "examples": {
                  "wavAudio": {
                    "summary": "wav 格式音频（默认）",
                    "value": "<binary wav audio stream>"
                  }
                }
              },
              "audio/mpeg": {
                "schema": {
                  "$ref": "#/components/schemas/SeedAudioBinary"
                },
                "examples": {
                  "mp3Audio": {
                    "summary": "mp3 格式音频",
                    "value": "<binary mp3 audio stream>"
                  }
                }
              },
              "audio/ogg": {
                "schema": {
                  "$ref": "#/components/schemas/SeedAudioBinary"
                },
                "examples": {
                  "oggOpusAudio": {
                    "summary": "ogg_opus 格式音频",
                    "value": "<binary ogg_opus audio stream>"
                  }
                }
              },
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/SeedAudioBinary"
                },
                "examples": {
                  "pcmAudio": {
                    "summary": "pcm 裸流音频",
                    "value": "<binary pcm audio stream>"
                  }
                }
              }
            }
          },
          "400": {
            "description": "请求参数无效。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeedAudioErrorResponse"
                },
                "examples": {
                  "invalidRequest": {
                    "$ref": "#/components/examples/SeedAudioError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeedAudioErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/SeedAudioError"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "ModelVerse API Key，通过 `Authorization: Bearer <MODELVERSE_API_KEY>` 传入。"
      }
    },
    "schemas": {
      "SeedAudioSpeechRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "text_prompt"
        ],
        "properties": {
          "model": {
            "type": "string",
            "const": "seed-audio-1.0",
            "description": "音频生成模型名称，此 schema 固定为 `seed-audio-1.0`。"
          },
          "text_prompt": {
            "type": "string",
            "maxLength": 3000,
            "description": "用于生成音频的提示词或待合成文本，最大 3000 字符。\n纯文本生成时直接传入描述；参考音频生成时用 `@音频1`、`@音频2` 按上传顺序引用 `references` 中的音频；\n参考图片生成时只传待合成的文本内容。\n\n为兼容 OpenAI `/v1/audio/speech` 协议，也支持用 `input` 传值；两者同时传入时以 `text_prompt` 为准。\n"
          },
          "input": {
            "type": "string",
            "maxLength": 3000,
            "description": "`text_prompt` 的 OpenAI 兼容别名。仅当 `text_prompt` 为空时生效。\n"
          },
          "response_format": {
            "type": "string",
            "enum": [
              "wav",
              "mp3",
              "pcm",
              "ogg_opus"
            ],
            "default": "wav",
            "description": "输出格式兜底字段。响应头 `Content-Type` 优先由 `audio_config.format` 推导，\n仅在未传 `audio_config.format` 时使用本字段：`wav` → `audio/wav`，`mp3` → `audio/mpeg`，\n`ogg_opus` → `audio/ogg`，`pcm` → `application/octet-stream`。\n实际音频编码格式始终以 `audio_config.format` 为准，建议两者保持一致。\n"
          },
          "references": {
            "type": "array",
            "maxItems": 4,
            "description": "参考资源列表，根据传入内容自动匹配生成模式。不传时为纯文本生成。\n\n- 参考音频：最多 3 条，单条时长 ≤ 30 秒，单条大小 ≤ 10 MB，支持 `wav` / `mp3` / `pcm` / `ogg_opus`；\n  上传顺序须与 `text_prompt` 中 `@音频N` 的编号严格对应；\n- 参考图片：最多 1 张，大小 ≤ 10 MB，支持 `jpeg` / `png` / `webp`；\n- 图片参考不能与音频参考混用（`image_data` / `image_url` 不能与 `speaker` / `audio_data` / `audio_url` 同时传入）。\n",
            "items": {
              "$ref": "#/components/schemas/SeedAudioReference"
            }
          },
          "audio_config": {
            "$ref": "#/components/schemas/SeedAudioConfig"
          },
          "watermark": {
            "$ref": "#/components/schemas/SeedAudioWatermark"
          }
        }
      },
      "SeedAudioReference": {
        "type": "object",
        "additionalProperties": false,
        "description": "单条参考资源。`speaker`、`audio_data`、`audio_url` 三者互斥；`image_data`、`image_url` 两者互斥。",
        "properties": {
          "speaker": {
            "type": "string",
            "description": "音色 ID，支持「豆包语音合成模型 2.0」的音色以及声音复刻音色。\n完整音色列表见火山引擎文档：https://docs.volcengine.com/docs/doubao-voice/tone-list-3\n\n与 `audio_data`、`audio_url` 互斥。\n",
            "examples": [
              "zh_female_vv_uranus_bigtts",
              "zh_female_xiaohe_uranus_bigtts",
              "zh_male_m191_uranus_bigtts",
              "zh_male_taocheng_uranus_bigtts",
              "en_female_dacey_uranus_bigtts",
              "en_male_tim_uranus_bigtts"
            ]
          },
          "audio_data": {
            "type": "string",
            "description": "参考音频的 Base64 编码内容。与 `speaker`、`audio_url` 互斥。"
          },
          "audio_url": {
            "type": "string",
            "format": "uri",
            "description": "参考音频的远端 URL。与 `speaker`、`audio_data` 互斥。"
          },
          "image_data": {
            "type": "string",
            "description": "参考图片的 Base64 编码内容。与 `image_url` 互斥，且不能与音频参考混用。"
          },
          "image_url": {
            "type": "string",
            "format": "uri",
            "description": "参考图片的远端 URL。与 `image_data` 互斥，且不能与音频参考混用。"
          }
        }
      },
      "SeedAudioConfig": {
        "type": "object",
        "additionalProperties": false,
        "description": "输出音频配置。",
        "properties": {
          "format": {
            "type": "string",
            "enum": [
              "wav",
              "mp3",
              "pcm",
              "ogg_opus"
            ],
            "default": "wav",
            "description": "输出音频格式，默认为 `wav`。该字段同时决定响应头 `Content-Type`（见 `response_format` 的映射表）。\n"
          },
          "sample_rate": {
            "type": "integer",
            "default": 40000,
            "description": "输出音频采样率，单位 Hz，不同格式支持范围不同：\n\n- `wav` / `pcm`：默认 40000，可选 8000、16000、24000、32000、40000、44100、48000；\n- `mp3`：默认 44100，可选 8000、16000、24000、32000、44100、48000；\n- `ogg_opus`：仅支持 48000。\n",
            "examples": [
              40000,
              44100,
              48000
            ]
          },
          "speech_rate": {
            "type": "integer",
            "minimum": -50,
            "maximum": 100,
            "default": 0,
            "description": "语速，默认 0。取值越大语速越快，-50 表示 0.5 倍速，100 表示 2.0 倍速。"
          },
          "loudness_rate": {
            "type": "integer",
            "minimum": -50,
            "maximum": 100,
            "default": 0,
            "description": "音量，默认 0。取值越大音量越大，-50 表示 0.5 倍音量，100 表示 2.0 倍音量。"
          },
          "pitch_rate": {
            "type": "integer",
            "minimum": -12,
            "maximum": 12,
            "default": 0,
            "description": "音调，默认 0。取值越大音调越高，取值范围 [-12, 12]。"
          },
          "enable_subtitle": {
            "type": "boolean",
            "default": false,
            "description": "是否启用字幕服务，默认 `false`。开启后上游会返回字级别时间戳，\n但本接口的响应为二进制音频，字幕信息不随响应体返回。\n"
          }
        }
      },
      "SeedAudioWatermark": {
        "type": "object",
        "additionalProperties": false,
        "description": "水印配置，不传时默认不添加水印。",
        "properties": {
          "aigc_watermark": {
            "type": "boolean",
            "default": false,
            "description": "显式水印开关，默认 `false`。开启后会在合成结尾增加音频节奏标识。"
          },
          "aigc_metadata": {
            "$ref": "#/components/schemas/SeedAudioWatermarkMetadata"
          }
        }
      },
      "SeedAudioWatermarkMetadata": {
        "type": "object",
        "additionalProperties": false,
        "description": "隐式水印。开启后会在合成音频 header 中加入元数据，不开启时默认不添加水印。",
        "properties": {
          "enable": {
            "type": "boolean",
            "default": false,
            "description": "是否启用隐式水印，默认 `false`。"
          },
          "content_producer": {
            "type": "string",
            "description": "合成服务提供者的名称或编码。"
          },
          "produce_id": {
            "type": "string",
            "description": "内容制作编号。"
          },
          "content_propagator": {
            "type": "string",
            "description": "内容传播服务提供者的名称或编码。"
          },
          "propagate_id": {
            "type": "string",
            "description": "内容传播编号。"
          }
        }
      },
      "SeedAudioBinary": {
        "type": "string",
        "format": "binary",
        "description": "生成的二进制音频数据，编码格式由 `audio_config.format` 决定。"
      },
      "SeedAudioErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/SeedAudioError"
          }
        }
      },
      "SeedAudioError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "message",
          "type",
          "code",
          "param"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "错误说明。"
          },
          "type": {
            "type": "string",
            "description": "错误类型。",
            "examples": [
              "invalid_request_error"
            ]
          },
          "code": {
            "type": "string",
            "description": "机器可读的错误码。",
            "examples": [
              "error_code"
            ]
          },
          "param": {
            "type": "string",
            "description": "请求 ID，用于反馈或排查错误原因。"
          }
        }
      }
    },
    "examples": {
      "SeedAudioError": {
        "summary": "标准 JSON 错误响应",
        "value": {
          "error": {
            "message": "错误描述信息",
            "type": "invalid_request_error",
            "code": "error_code",
            "param": "<请求 ID，用于反馈或排查错误原因>"
          }
        }
      }
    }
  }
}
```
