Skip to content
InfercomInfercomInfercom Documentation

Audio

Translate audio into English.

POST
/audio/translations
from openai import OpenAI
client = OpenAI(
base_url="https://api.infercom.ai/v1",
api_key="your-infercom-api-key",
)
with open("audio.mp3", "rb") as audio_file:
translation = client.audio.translations.create(
file=audio_file,
model="Whisper-Large-v3",
)
print(translation.text)

Translate audio to English text. Note: This endpoint requires an audio model (e.g., Whisper) to be available. Check GET /v1/models for current model availability.

Audio to translate and parameters

Media typemultipart/form-data
Translation Request

Translation request object

object
model
required
Any of:
string
file
required
file

The audio file object to transcribe or translate, in one of these formats: FLAC, MP3, MP4, MPEG, MPGA, M4A, Ogg, WAV, or WebM format. File size limit is 25MB.

string format: binary
prompt
prompt

Optional text prompt provided to influence transcription Translation style or vocabulary. Example: “Please transcribe carefully, including pauses and hesitations.”

string
nullable
language
language

Optional language of the input audio. Supplying the input language in ISO-639-1 (e.g. en) format will improve accuracy and latency.

string
nullable
Allowed values: en zh de es ru ko fr ja pt tr pl ca nl ar sv it id hi fi vi he uk el ms cs ro da hu ta no th ur hr bg lt la mi ml cy sk te fa lv bn sr az sl kn et mk br eu is hy ne mn bs kk sq sw gl mr pa si km sn yo so af oc ka be tg sd gu am yi lo uz fo ht ps tk nn mt sa lb my bo tl mg as tt haw ln ha ba jw su yue
response_format
response format

Output format. json returns an object with text and a usage object. text returns the bare transcript string. verbose_json returns an object with duration, language, task, text and segments, without usage. srt and vtt return subtitles with timestamps.

string
default: json
Allowed values: json text verbose_json srt vtt
timestamp_granularities[]
timestamp granularities

Timestamp detail for /v1/audio/transcriptions. Only segment is supported; use it with response_format verbose_json. word returns HTTP 400.

Array<string>
Allowed values: segment
stream
stream

Enables streaming responses.

boolean
Example
{
"model": "Whisper-Large-v3",
"file": "(binary audio file, e.g. \"sample.wav\")",
"prompt": "Please translate carefully, including pauses and hesitations.",
"language": "es",
"response_format": "json",
"stream": true
}

Successful Response

One of:
Translation Response

Translation response json object

object
text
required
text

Audio file english text translation

string
usage
usage

Returned with response_format json. seconds is the duration of the processed audio, in seconds.

object
type
string
Allowed values: duration
seconds
number
key
additional properties
any
Example
{
"text": "It's a sound effect of a bell chiming, specifically a church bell."
}
inference-id
string
Example
a0b08d8a-1893-45d6-a0f4-7ad6fdeb5443

Unique identifier for this inference request, useful for debugging and support.

x-ratelimit-limit-requests
integer
Example
250

Maximum requests allowed per minute.

x-ratelimit-limit-requests-day
integer
Example
50000

Maximum requests allowed per day.

x-ratelimit-remaining-requests
integer
Example
247

Remaining requests in the current minute window.

x-ratelimit-remaining-requests-day
integer
Example
49988

Remaining requests in the current day.

x-ratelimit-reset-requests
integer
Example
1776937132

Unix timestamp when the per-minute limit resets.

x-ratelimit-reset-requests-day
integer
Example
1777023472

Unix timestamp when the daily limit resets.

Bad Request - missing or invalid parameters, or a model that does not support this endpoint (error code model_not_supported). A malformed multipart body is rejected before it reaches the API and returns an HTML page, not JSON.

GeneralError

Other kind of errors

object
error
required
object
code
code

Error code

string
nullable
message
message

Error message

string
param
param

Error params

string
nullable
type
type

Error type

string
request_id
request_id

Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.

string
Example
{
"error": {
"message": "The model `qwen3-tts` does not support the audio translations API.",
"type": "invalid_request_error",
"param": "model",
"code": "model_not_supported"
},
"request_id": "dagknmqo1c26hr9qhvqg"
}

Unauthorized - the API key is missing, incorrect or revoked.

Media typeapplication/json
GeneralError

Other kind of errors

object
error
required
object
code
code

Error code

string
nullable
message
message

Error message

string
param
param

Error params

string
nullable
type
type

Error type

string
request_id
request_id

Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"param": "example",
"type": "example"
},
"request_id": "example"
}

Not found - the model ID does not exist, or the model has been retired.

Media typeapplication/json
GeneralError

Other kind of errors

object
error
required
object
code
code

Error code

string
nullable
message
message

Error message

string
param
param

Error params

string
nullable
type
type

Error type

string
request_id
request_id

Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"param": "example",
"type": "example"
},
"request_id": "example"
}

Request timeout

Media typeapplication/json
GeneralError

Other kind of errors

object
error
required
object
code
code

Error code

string
nullable
message
message

Error message

string
param
param

Error params

string
nullable
type
type

Error type

string
request_id
request_id

Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"param": "example",
"type": "example"
},
"request_id": "example"
}

Too Many Requests

Media typeapplication/json
GeneralError

Other kind of errors

object
error
required
object
code
code

Error code

string
nullable
message
message

Error message

string
param
param

Error params

string
nullable
type
type

Error type

string
request_id
request_id

Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"param": "example",
"type": "example"
},
"request_id": "example"
}
x-ratelimit-limit-requests
integer
Example
250

Maximum requests allowed per minute.

x-ratelimit-limit-requests-day
integer
Example
50000

Maximum requests allowed per day.

x-ratelimit-remaining-requests
integer
Example
247

Remaining requests in the current minute window.

x-ratelimit-remaining-requests-day
integer
Example
49988

Remaining requests in the current day.

x-ratelimit-reset-requests
integer
Example
1776937132

Unix timestamp when the per-minute limit resets.

x-ratelimit-reset-requests-day
integer
Example
1777023472

Unix timestamp when the daily limit resets.

Internal Server Error. Unexpected issue on server side.

Media typetext/plain
string

Service Temporarily Unavailable

Media typetext/plain
string
Example
Service Temporarily Unavailable