Skip to main content
POST
/
v1
/
audio
/
translations
Python (OpenAI SDK)
from openai import OpenAI

client = OpenAI(
    api_key="<COMETAPI_KEY>",
    base_url="https://api.cometapi.com/v1"
)

audio_file = open("audio.mp3", "rb")
translation = client.audio.translations.create(
    model="whisper-1",
    file=audio_file
)
print(translation.text)
{
  "text": "Hello, welcome to CometAPI."
}

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

Use this endpoint to translate spoken audio into English text. It fits multilingual support queues, media review, and workflows that need one English transcript from audio in another language.

First request

Send a supported audio file with model and file. Use a short sample first so you can verify upload handling, language detection, and output parsing.

Read the response

The default response includes translated English text. If you request a different response format, parse the response according to that format.

Next steps

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your CometAPI key.

Body

multipart/form-data
file
file
required

The audio file to translate. Supported formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm.

model
string
default:whisper-1
required

The audio translation model to use. Choose a current speech model from the Models page.

prompt
string

Optional text to guide the model's style or continue a previous audio segment. The prompt should be in English.

response_format
enum<string>
default:json

The output format for the translation.

Available options:
json,
text,
srt,
verbose_json,
vtt
temperature
number
default:0

Sampling temperature between 0 and 1. Higher values produce more random output; lower values are more focused. When set to 0, the model auto-adjusts temperature using log probability.

Required range: 0 <= x <= 1

Response

200 - application/json

The translation result in English.

text
string
required

The translated text in English.