> ## 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。                                    |
| `language`                | string | 否  | ISO-639-1 输入语言代码。                           |
| `prompt`                  | string | 否  | 指导风格或延续上下文。                                 |
| `response_format`         | string | 否  | 如 json、text、srt、verbose\_json、vtt；支持项依模型而定。 |
| `temperature`             | number | 否  | 采样温度。                                       |
| `timestamp_granularities` | array  | 否  | segment 或 word 时间戳。                         |

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

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

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

响应至少包含 `text`；详细格式可包含语言、时长、分段或词级时间戳。流式支持依模型和响应格式而定。
