使用原生登录 access_token 调用原生标准语音合成(JSON 输入 model、input、voice 等),返回音频二进制字节或供应商支持的 SSE。<=4 MiB 且 24 小时内的二进制语音可在 /pg/requests/by-intent 中通过 response.encoding="base64" 恢复。不可将 KIE Suno 异步模型用于此接口。
POST
/pg/audio/speech身份验证
Authorizationstring必填使用登录取得的 native access_token(身份要求:登录 access_token),按路由校验本人归属与受信任浏览器 Origin;生成写入按钱包规则扣费,只读查询不重新预扣;不得使用推理 API Key(sk-…)或 PAT(nap_…)。
Authorization: Bearer $ONEASTER_ACCESS_TOKEN
参数
Idempotency-Keystringheader · 每次新发起的 /pg 生成提交建议由前端生成并持久化稳定的 1–100 位无空格可打印 ASCII 标识(推荐 UUID),断线重试保持原标识与原请求字节。同账号跨所有 /pg POST 协议共用一个命名空间;省略时后端兼容生成并通过 X-OneAster-Intent-ID 返回,但若响应头丢失将无法按意图恢复。
请求正文 · application/json
modelstring必填inputstring必填voicestring必填response_formatstringinstructionsstringstream_formatstringspeednumberJSON Schema
{
"type": "object",
"required": [
"model",
"input",
"voice"
],
"properties": {
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string"
},
"response_format": {
"type": "string"
},
"instructions": {
"type": "string"
},
"stream_format": {
"type": "string"
},
"speed": {
"type": "number"
}
},
"additionalProperties": true
}