音频转录
POST /v1/audio/transcriptions
将音频转换为文本
基本信息
| 项目 | 内容 |
|---|---|
| Base URL | https://www.yunzhuhub.cn |
| 标签 | OpenAI音频(Audio) |
| Operation ID | createTranscription |
认证
- BearerAuth:使用 Bearer Token 认证。 格式:
Authorization: Bearer sk-xxxxxx
密钥安全
请只使用你自己的 API Key。示例中的 <YOUR_API_KEY> 必须在本地替换,不要把真实密钥提交到代码仓库或发送给他人。
参数
无额外路径或查询参数。
请求体
Content-Type: multipart/form-data
json
{
"type": "object",
"properties": {
"file": {
"type": "string",
"format": "binary",
"description": "音频文件",
"example": ""
},
"model": {
"type": "string",
"example": "<MODEL_ID>"
},
"language": {
"type": "string",
"description": "ISO-639-1 语言代码",
"example": ""
},
"prompt": {
"type": "string",
"example": ""
},
"response_format": {
"type": "string",
"enum": [
"json",
"text",
"srt",
"verbose_json",
"vtt"
],
"default": "json",
"example": "json"
},
"temperature": {
"type": "number",
"example": 0
},
"timestamp_granularities": {
"type": "array",
"items": {
"type": "string",
"enum": [
"word",
"segment"
]
},
"example": ""
}
},
"required": [
"file",
"model"
]
}请求示例
以下示例只用于复制到本地终端,不会从文档站发送请求。
bash
curl --request POST 'https://www.yunzhuhub.cn/v1/audio/transcriptions' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '<REQUEST_JSON>'响应
200 成功转录
json
{
"title": "AudioTranscriptionResponse",
"type": "object",
"properties": {
"text": {
"type": "string"
}
}
}