> ## Documentation Index
> Fetch the complete documentation index at: https://bianxieai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 音频翻译

> 将音频转写并翻译为英文

请求使用 `multipart/form-data`。

| 字段                | 类型     | 必填 | 说明                                       |
| ----------------- | ------ | -- | ---------------------------------------- |
| `file`            | file   | 是  | 待翻译音频。                                   |
| `model`           | string | 是  | 支持翻译的音频模型 ID。                            |
| `prompt`          | string | 否  | 指导风格或提供上下文。                              |
| `response_format` | string | 否  | json、text、srt、verbose\_json 或 vtt，依模型而定。 |
| `temperature`     | number | 否  | 采样温度。                                    |

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.bianxie.ai/v1/audio/translations \
    -H "Authorization: Bearer API_KEY" \
    -F "model=your-model" \
    -F "file=@speech.mp3"
  ```

  ```python Python theme={null}
  client.audio.translations.create(model="your-model", file=open("speech.mp3", "rb"))
  ```

  ```javascript Node.js theme={null}
  await client.audio.translations.create({ model: "your-model", file: fs.createReadStream("speech.mp3") });
  ```
</CodeGroup>

响应包含英文 `text`，详细格式还可能包含分段与时间信息。默认按非流式处理。
