> ## Documentation Index
> Fetch the complete documentation index at: https://docs.token.poryf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 千问语音识别

> 千问语音识别 Qwen-Audio-ASR：把音频转成文字，OpenAI 兼容的 /v1/audio/transcriptions 接口，支持字幕与时间戳。

阿里通义千问语音识别模型，把一段音频转成文字，支持中英文及多种方言、标点和文本规范化，可输出带时间戳的结果或 srt / vtt 字幕。接口与 OpenAI 的转写接口兼容。

* 模型 ID：`qwen-audio-3.1-asr-flash`
* 接口：`POST https://token.poryf.com/v1/audio/transcriptions`（`multipart/form-data`，同步返回）
* [价格](https://token.poryf.com/pricing/qwen-audio-3.1-asr-flash)

## 请求参数

请求头带上 `Authorization: Bearer YOUR_API_KEY`，请求体用 `multipart/form-data`。

**model** `string` *required*

`qwen-audio-3.1-asr-flash`

**file** `file` *required*

音频文件，最大 10 MB、最长 5 分钟。支持 mp3、wav、m4a、aac、flac、ogg、opus、webm、amr、mp4、mov 等常见格式，按文件扩展名识别格式。

**response\_format** `string` (default: json)

返回格式：`json`（`{"text": "..."}`）、`text`（纯文字）、`verbose_json`（含整句和逐词时间戳）、`srt`、`vtt`（字幕）。

**language** `string`

音频语言提示，如 `zh`、`en`、`ja`。不传时自动识别。

## 示例

```bash theme={null}
curl https://token.poryf.com/v1/audio/transcriptions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F model="qwen-audio-3.1-asr-flash" \
  -F file="@meeting.mp3" \
  -F response_format="json"
```

返回：

```json theme={null}
{"text": "你好，欢迎使用千问语音合成。"}
```

用 OpenAI Python SDK：

```python theme={null}
from openai import OpenAI

client = OpenAI(api_key="YOUR_API_KEY", base_url="https://token.poryf.com/v1")
with open("meeting.mp3", "rb") as audio:
    transcript = client.audio.transcriptions.create(
        model="qwen-audio-3.1-asr-flash",
        file=audio,
        response_format="srt",
    )
print(transcript)
```

## 计费

* 按 token 计费：音频输入 token（每秒音频约 12 个）和识别文字输出 token 分别计价，实时单价见 [模型广场](https://token.poryf.com/pricing/qwen-audio-3.1-asr-flash)。
* 请求时按 5 分钟音频的上限预扣，完成后按实际用量结算，识别失败不扣费。

> [!WARNING]
>
> * 暂不支持 `prompt` 和流式输出（`stream`）。
> * 超过 5 分钟的音频请先切分再识别。

通用错误码见 [错误码](https://docs.token.poryf.com/errors.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.