音频接口

POST /v1/audio/speech

文本转语音

原生标准同步语音合成,接收 JSON 并返回音频二进制字节或供应商支持的 SSE。与异步音乐任务 /v1/tasks/kie 不同,不能将 KIE Suno 模型传给此接口,也不提供旧 /v1/audio/generations 别名。

POST/v1/audio/speech

身份验证

Authorizationstring必填

使用 OneAster 推理 API Key(Bearer sk-…)。

Authorization: Bearer $ONEASTER_API_KEY

请求正文 · application/json

modelstring必填
inputstring必填

要转换的文本

voicestring必填
response_formatstring
speednumber
JSON Schema
{
  "type": "object",
  "required": [
    "model",
    "input",
    "voice"
  ],
  "properties": {
    "model": {
      "type": "string",
      "example": "tts-1"
    },
    "input": {
      "type": "string",
      "description": "要转换的文本",
      "maxLength": 4096
    },
    "voice": {
      "type": "string",
      "enum": [
        "alloy",
        "echo",
        "fable",
        "onyx",
        "nova",
        "shimmer"
      ]
    },
    "response_format": {
      "type": "string",
      "enum": [
        "mp3",
        "opus",
        "aac",
        "flac",
        "wav",
        "pcm"
      ],
      "default": "mp3"
    },
    "speed": {
      "type": "number",
      "minimum": 0.25,
      "maximum": 4,
      "default": 1
    }
  }
}