Create transcription
Transcribe Base64 audio into text.
POST /api/v1/audio/transcriptions
Use Qwen3 ASR Flash FileTrans. GlobalRouter securely stages the audio, then returns normalized transcription JSON.
Back to Audio endpoint listRequest parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Always qwen3-asr-flash-filetrans. |
input_audio.data | string | Yes | Raw Base64 audio content; omit the data: URI prefix. |
input_audio.format | string | Yes | Input format, such as mp3, wav, m4a, ogg, opus, or webm; supported formats are determined by endpoint validation. |
language | string | No | Audio language, such as zh, en, or ja; detected upstream when omitted. |
response_format | string | No | Response format: json or verbose_json; defaults to json. |
temperature | number | No | Sampling temperature, from 0 to 1. |
timestamp_granularities | string[] | No | With verbose_json, segment and word timestamps may be requested. |
provider.provider_id | string | No | Only ali is supported; omitted values also route to ali. |
provider.options.ali.enable_itn | boolean | No | Whether to enable inverse text normalization; defaults to false. |
provider.options.ali.channel_id | integer[] | No | Currently only [0] is supported; defaults to [0]. |
Request examples
curl -X POST "https://api.globalrouter.com/api/v1/audio/transcriptions" \
-H "Authorization: Bearer $GR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-asr-flash-filetrans",
"input_audio": {
"data": "<BASE64_AUDIO>",
"format": "wav"
},
"language": "zh",
"response_format": "verbose_json",
"timestamp_granularities": ["segment", "word"],
"provider": {
"provider_id": "ali",
"options": {
"ali": {
"enable_itn": false,
"channel_id": [0]
}
}
}
}'Response fields
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Complete transcription text. |
usage.seconds | number | Yes | Billable audio duration in seconds. |
usage.cost | number | Yes | Cost of this transcription. |
task | string | No | Task type, set to transcribe. |
language | string | No | Detected language. |
duration | number | No | Audio duration in seconds. |
segments | object[] | No | Segment text and time ranges returned with verbose_json when segment is requested. |
words | object[] | No | Word-level time ranges returned with verbose_json when word is requested. |
X-Generation-Id | header | Yes | GlobalRouter generation record ID for troubleshooting. |
Response example
{
"text": "你好,欢迎使用 GlobalRouter。",
"usage": {
"seconds": 2.4,
"cost": 0.000528
},
"task": "transcribe",
"language": "zh",
"duration": 2.4,
"segments": [
{ "id": 0, "start": 0, "end": 2.4, "text": "你好,欢迎使用 GlobalRouter。" }
],
"words": [
{ "word": "你好", "start": 0, "end": 0.6 }
]
}Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | ROUTER_AUDIO_MODEL_UNSUPPORTED | model is not a currently supported ASR model. |
| 400 | ROUTER_AUDIO_PROVIDER_UNSUPPORTED | provider_id is not ali. |
| 422 | validation_error | Base64, audio format, or provider options violate request constraints. |
Notes
- The endpoint requires an API key with tasks scope and permission to use the requested model.
- timestamp_granularities applies only when response_format is verbose_json.