Create transcription
Use this interface to transcribe audio into text. The interface format is compatible with the OpenAI audio/transcriptions protocol.
Request Address
| Method | URL |
|---|---|
POST | https://api.ant-ling.com/v1/audio/transcriptions |
Authorization
Authorization
- Type:
HTTP Bearer Auth, value typestring - Required
- Description: Used to verify account information. Go to API Console , click Create Token to obtain.
Authorization: Bearer <YOUR_API_KEY>Request Headers
Content-Type
- Type:
enum<string> - Required, fixed value
multipart/form-data - Description: The media type of the request body. Must be
multipart/form-databecause the audio file is uploaded as form data.
Request Body
Overview
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | ASR model ID |
file | file | Yes | — | The audio file to transcribe |
language | string | No | — | Primary language hint |
prompt | string | No | — | Context from previous transcription results |
response_format | string | No | json | The format of the transcription result |
temperature | number | No | 0 | Sampling temperature, range [0, 1] |
model
- Type:
string - Required
- Description: The ID of the ASR model to use.
- Options:
Ming-3.0-asr-tiny
file
- Type:
file - Required
- Description: The audio file to transcribe.
- Supported formats:
.wav,.mp3 - Limits: file size ≤
10 MB, audio duration ≤30 seconds
language
- Type:
string - Optional
- Description: A hint for the primary language spoken in the audio. If omitted, mixed-language recognition is enabled.
prompt
- Type:
string - Optional
- Description: In long-text scenarios, provide the previous transcription result as context to improve continuity. Recommended length is less than 60 characters.
response_format
- Type:
string - Optional, default
json - Description: The format of the transcription result.
- Options:
json
Only the json response format is currently supported.
temperature
- Type:
number - Optional
- Description: The sampling temperature, between 0 and 1. Lower values produce more deterministic transcriptions.
Unsupported Parameters
The following OpenAI audio/transcriptions parameters are not supported by this interface:
chunking_strategyincludekeywordsknown_speaker_namesknown_speaker_referenceslanguagestimestamp_granularitiesstream
Response Body
The response follows the OpenAI audio/transcriptions protocol Transcription object.
text
- Type:
string - Description: The complete transcribed text.
usage
- Type:
object - Description: Token usage statistics for the request.
usage.input_tokens
- Type:
integer - Description: Number of input tokens consumed, including audio and text tokens.
usage.output_tokens
- Type:
integer - Description: Number of output tokens generated.
usage.total_tokens
- Type:
integer - Description: Total number of tokens consumed (
input_tokens+output_tokens).
usage.input_token_details
- Type:
object - Description: Breakdown of input tokens.
- Fields:
audio_tokens— Number of tokens consumed by the audio input.text_tokens— Number of tokens consumed by the text input (such asprompt).
model
- Type:
string - Description: The ID of the model used for this request.
id
- Type:
string - Description: The unique identifier of this transcription request.
Example
Request Example
cURL
curl --request POST \
--url https://api.ant-ling.com/v1/audio/transcriptions \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--form 'model="Ming-3.0-asr-tiny"' \
--form 'file=@"/path/to/hellow.wav"'Response Example
{
"text": "Our vision is to build the digital infrastructure of the future service industry and bring more small and beautiful changes to the world",
"usage": {
"input_tokens": 223,
"output_tokens": 20,
"total_tokens": 243,
"type": "tokens",
"input_token_details": {
"audio_tokens": 218,
"text_tokens": 5
}
},
"model": "Ming-3.0-asr-tiny",
"id": "1eef022e1790004326841103485411"
}Was this page helpful?
Last updated on