Audio
Translate audio into English.
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)curl -X POST https://api.infercom.ai/v1/audio/translations \ -H "Authorization: Bearer $INFERCOM_API_KEY" \ -F file="@audio.mp3" \ -F model="Whisper-Large-v3"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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Audio to translate and parameters
Translation request object
object
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.
Optional text prompt provided to influence transcription Translation style or vocabulary. Example: “Please transcribe carefully, including pauses and hesitations.”
Optional language of the input audio. Supplying the input language in ISO-639-1 (e.g. en) format will improve accuracy and latency.
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.
Timestamp detail for /v1/audio/transcriptions. Only segment is supported; use it with response_format verbose_json. word returns HTTP 400.
Enables streaming responses.
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}Responses
Section titled “Responses”Successful Response
Translation response json object
object
Audio file english text translation
Returned with response_format json. seconds is the duration of the processed audio, in seconds.
object
Streamed chunk of a translation response returned by the model
object
A list of transcription or translation choices.
Transcription or translation chunk choice generated by streamed model responses.
object
Transcription or translation response delta chunk generated by streamed model responses.
object
The role of the messages author
The content delta of the transcription or translation.
The reason the model stopped generating tokens
The index of the choice in the list of choices
Completion Log Probs object
object
object
object
The Unix timestamp (in seconds) of when the chat completion was created.
A unique identifier for the chat completion.
The model used for the chat completion.
The object type, always chat.completion.chunk.
Backend configuration that the model runs with.
Usage metrics for the completion, embeddings,transcription or translation request
object
Acceptance rate
Number of tokens generated in completion
Completion tokens per second after first token generation
Completion tokens per second after first token generation first ten
Completion tokens per second after first token generation
Completion tokens per second
Breakdown of the generated tokens. Returned by every model. Use it to budget and bill reasoning separately from the visible answer.
object
Number of tokens spent on the chain of thought. Counts towards completion_tokens and therefore towards max_tokens. Returns 0 when the model did not reason, for example gemma-4-31B-it without chat_template_kwargs: {"enable_thinking": true}.
The Unix timestamp (in seconds) of when the generation finished.
Whether or not is last response, always true for non streaming response
Extra prompt token details. Not returned by /chat/completions. Prompt caching is reported on /responses as usage.input_tokens_details.cached_tokens instead.
object
Amount of cached tokens
Number of tokens used in the prompt sent
The Unix timestamp (in seconds) of when the generation started.
Also TTF, time (in seconds) taken to generate the first token
Time to first token measurement for graphing/monitoring purposes
The reason generation stopped. Values include stop (natural end or stop sequence), length (max_tokens reached), tool_calls (model invoked a tool).
Total time (in seconds) taken to generate the full generation
Prompt tokens + completion tokens
Tokens per second including prompt and completion
Example
{ "text": "It's a sound effect of a bell chiming, specifically a church bell."}Example
It's a sound effect of a bell chiming, specifically a church bell.Headers
Section titled “Headers”Example
a0b08d8a-1893-45d6-a0f4-7ad6fdeb5443Unique identifier for this inference request, useful for debugging and support.
Example
250Maximum requests allowed per minute.
Example
50000Maximum requests allowed per day.
Example
247Remaining requests in the current minute window.
Example
49988Remaining requests in the current day.
Example
1776937132Unix timestamp when the per-minute limit resets.
Example
1777023472Unix 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.
Other kind of errors
object
object
Error code
Error message
Error params
Error type
Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.
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"}Returned when the multipart body itself is malformed.
Unauthorized - the API key is missing, incorrect or revoked.
Other kind of errors
object
object
Error code
Error message
Error params
Error type
Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.
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.
Other kind of errors
object
object
Error code
Error message
Error params
Error type
Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.
Examplegenerated
{ "error": { "code": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}Request timeout
Other kind of errors
object
object
Error code
Error message
Error params
Error type
Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.
Examplegenerated
{ "error": { "code": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}Too Many Requests
Other kind of errors
object
object
Error code
Error message
Error params
Error type
Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.
Examplegenerated
{ "error": { "code": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}Headers
Section titled “Headers”Example
250Maximum requests allowed per minute.
Example
50000Maximum requests allowed per day.
Example
247Remaining requests in the current minute window.
Example
49988Remaining requests in the current day.
Example
1776937132Unix timestamp when the per-minute limit resets.
Example
1777023472Unix timestamp when the daily limit resets.
Internal Server Error. Unexpected issue on server side.
Service Temporarily Unavailable
Example
Service Temporarily Unavailable