Translate input speech into English text.
Request
| Item | Description |
|---|---|
| Method | POST |
| Path | /v1/audio/translations |
| Gateway URL | https://ailink.nativex.com |
| Authentication | Authorization: Bearer sk-xxxx; replace the placeholder with your API Key |
| Request format | multipart/form-data |
Replace MODEL_ID with a model from the Model Marketplace that supports this endpoint. Available models, parameters, and permissions depend on your account.
Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
file |
Body | file | Yes | Local audio file |
model |
Body | string | Yes | A speech model that supports this operation |
prompt |
Body | string | No | Context to assist recognition |
response_format |
Body | string | No | Legacy endpoints support json, text, srt, verbose_json, and vtt. Available formats depend on the model. |
temperature |
Body | number | No | Sampling parameter; supported values depend on the model |
Upload files with -F so the client generates the multipart boundary automatically. Do not manually set Content-Type: application/json.
Example
curl -X POST 'https://ailink.nativex.com/v1/audio/translations' \
-H 'Authorization: Bearer sk-xxxx' \
-F 'file=@audio.mp3' \
-F 'model=MODEL_ID' \
-F 'response_format=json'
Response
The following is a simplified response for readability. IDs, URLs, text, and usage values are illustrative.
{
"text": "Hello, welcome to AiLink."
}
| Field or result | Description |
|---|---|
| text | Recognized or translated text. Non-JSON formats return plain text or subtitles directly. |
Error handling
For unsuccessful responses, check the HTTP status and error body first. Verify the API Key, model name, account balance, and parameters. If rate limited, reduce concurrency and retry later.