OpenAI 创建音色授权录音

2026-11-10 17:20 更新

创建音色授权录音

post /audio/voice_consents

上传音色授权录音。

请求体参数

媒体类型为 multipart/form-data。

  • language: string:同意语句的 BCP 47 语言标签,例如 en-US。
  • name: string:授权录音的标签。
  • recording: string:同意录音文件,最大 10 MiB。支持 audio/mpeg、audio/wav、audio/x-wav、audio/ogg、audio/aac、audio/flac、audio/webm 和 audio/mp4。

返回值

  • VoiceConsent object { id, created_at, language, 2 more }

用于授权创建自定义音色的同意录音。

  • id: string

授权录音标识。

  • created_at: integer(Unix 时间戳)

授权录音创建时的Unix时间戳,单位为秒。

  • language: string

授权语句的BCP 47语言标签,例如en-US。

  • name: string

上传授权录音时提供的标签。

  • object: "audio.voice_consent"

对象类型,固定为audio.voice_consent。

  • "audio.voice_consent"

示例

## [中文] 发送POST请求;将示例API凭证及呼叫标识替换为应用使用的值。
curl https://api.openai.com/v1/audio/voice_consents \
    -H 'Content-Type: multipart/form-data' \
    -H "Authorization: Bearer $OPENAI_API_KEY" \
    -F language=language \
    -F name=name \
    -F 'recording=@/path/to/recording'

响应

中文说明:以下为原文配置、命令或事件示例,字段名、枚举、标识符及数值保留。

{
  "id": "cons_1234",
  "created_at": 0,
  "language": "language",
  "name": "name",
  "object": "audio.voice_consent"
}

示例

## [中文] 发送POST请求;将示例API凭证及呼叫标识替换为应用使用的值。
curl https://api.openai.com/v1/audio/voice_consents \
  -X POST \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -F "name=John Doe" \
  -F "language=en-US" \
  -F "recording=@$HOME/consent_recording.wav;type=audio/x-wav"
以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号