OpenAI Speech Recognition API (/v1/audio/transcriptions)
Transcribe audio to text, fully compatible with OpenAI's /v1/audio/transcriptions. Any OpenAI SDK can directly use it by pointing the base_url to https://api.acedata.cloud and replacing the key with your AceData Token. The interface synchronously returns the transcription result.
- Request URL:
POST https://api.acedata.cloud/v1/audio/transcriptions(aliasPOST /openai/audio/transcriptions) - Authentication: Request header
Authorization: Bearer {token} - Request Format:
multipart/form-data - Billing: Charged by audio duration (see table below), rounded up to the nearest second.
¶ Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
file |
file | Yes | The audio file to be transcribed, maximum 25 MB. Supports flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm. |
model |
string | No | whisper-1 (default) or gpt-transcribe, see the table below for capability differences. |
language |
string | No | Audio language, ISO-639-1 code (e.g., zh, en). Filling this can improve accuracy and speed; leaving it blank will auto-detect. |
prompt |
string | No | Prompt words to guide writing style or provide proper nouns and terms to improve recognition accuracy. |
response_format |
string | No | whisper-1: json (default), text, srt, verbose_json, vtt; gpt-transcribe: only json, text. |
temperature |
number | No | Sampling temperature 0–1, default 0. |
timestamp_granularities[] |
array | No | Timestamp granularity, word or segment, must be used with response_format=verbose_json. |
languages[] |
array | No | Candidate languages (ISO-639-1), only gpt-transcribe. Mutually exclusive with language, do not send both. |
keywords[] |
array | No | Proper noun/term hints, only gpt-transcribe, can significantly improve recognition accuracy for brand names and personal names. |
stream |
boolean | No | Streaming not supported, input will be ignored and complete results will be returned (consistent with OpenAI's official behavior). |
¶ Which Model to Choose
whisper-1 |
gpt-transcribe |
|
|---|---|---|
| Price | $0.0078 / minute | $0.0059 / minute (cheaper) |
| Recognition Accuracy | Good | Better, especially for brand names and proper nouns |
Subtitle Output (srt/vtt) |
✅ | ❌ |
| Word-level Timestamps | ✅ | ❌ |
languages[] / keywords[] |
❌ | ✅ |
| Returns Detected Language | Requires verbose_json |
Returns by default |
Need subtitles or word-level timestamps → whisper-1; for other scenarios, recommend gpt-transcribe (more accurate and cheaper).
¶ Example
curl -X POST 'https://api.acedata.cloud/v1/audio/transcriptions' \
-H 'authorization: Bearer {token}' \
-F file=@audio.mp3 \
-F model=whisper-1
Response:
{
"text": "YuJun Platform is testing the speech recognition endpoint. The quick brown fox jumps over the lazy dog."
}
Chinese audio is also supported, no need to specify the language:
{
"text": "欢迎使用 YuJun 平台,我们正在测试语音识别接口,今天是 7 月 31 号。"
}
¶ Generate Subtitles
Set response_format to srt or vtt to directly obtain a usable subtitle file:
curl -X POST 'https://api.acedata.cloud/v1/audio/transcriptions' \
-H 'authorization: Bearer {token}' \
-F file=@audio.mp3 \
-F model=whisper-1 \
-F response_format=srt \
-o subtitle.srt
Returned content (Content-Type: text/plain):
1
00:00:00,000 --> 00:00:03,800
YuJun Platform is testing the speech recognition endpoint.
2
00:00:03,800 --> 00:00:06,280
The quick brown fox jumps over the lazy dog.
¶ Word-level Timestamps
To get the start and end times for each word, use verbose_json with timestamp_granularities[]=word:
curl -X POST 'https://api.acedata.cloud/v1/audio/transcriptions' \
-H 'authorization: Bearer {token}' \
-F file=@audio.mp3 \
-F model=whisper-1 \
-F response_format=verbose_json \
-F 'timestamp_granularities[]=word'
Response:
{
"task": "transcribe",
"language": "english",
"duration": 6.29,
"text": "YuJun Platform is testing the speech recognition endpoint. The quick brown fox jumps over the lazy dog.",
"words": [
{ "word": "Ace", "start": 0.0, "end": 0.32 },
{ "word": "Data", "start": 0.32, "end": 0.54 },
{ "word": "Cloud", "start": 0.54, "end": 0.86 }
]
}
¶ Using the Official SDK
from openai import OpenAI
client = OpenAI(base_url="https://api.acedata.cloud/v1", api_key="{token}")
with open("audio.mp3", "rb") as f:
result = client.audio.transcriptions.create(model="whisper-1", file=f)
print(result.text)
¶ Pricing
| Model | Platform Price |
|---|---|
whisper-1 |
$0.0078 / minute |
gpt-transcribe |
$0.0059 / minute |
Charged based on actual audio duration, rounded up to the nearest second, with a maximum of 1 hour per single request.
¶ Notes
- The maximum size for a single file is 25 MB. If it exceeds this, please split or compress it (usually lowering the bitrate is sufficient, as speech recognition does not have high audio quality requirements).
- This interface does not support streaming returns (the
streamparameter will be ignored). - Parameters are consistent with OpenAI's official
/v1/audio/transcriptions, and the official SDK can be used by simply changing thebase_url. include[],chunking_strategy,known_speaker_names[], andknown_speaker_references[]belong to our unlisted transcription models, and passing them will return 400 instead of silently ignoring them. Model-specific parameters (timestamp_granularities[]forwhisper-1,languages[]/keywords[]forgpt-transcribe) will also return 400 when passed to unsupported models.- The request is relatively time-consuming, and it is recommended that the client timeout setting is no less than 300 seconds.
¶ Error Codes
| Status Code | Code | Description |
|---|---|---|
| 400 | bad_request |
file not provided, file cannot be parsed, or parameters are invalid (model/response_format values not supported, temperature exceeds 0–1, timestamp_granularities[] not paired with verbose_json, passed parameters unsupported by whisper-1). |
| 401 | authentication_failed |
Token is invalid. |
| 403 | used_up |
Insufficient balance. |
| 413 | request_too_large |
Audio file exceeds the 25 MB limit. |
| 429 | too_many_requests |
Requests are too frequent, please try again later. |
| 500 | api_error |
Internal server error, please try again later. |