跳轉到主要內容
POST
Python
使用此端點將語音音訊翻譯成英文文字。此端點適用於多語言支援佇列、媒體審查,以及需要將其他語言的音訊轉換成一份英文逐字稿的工作流程。

首次請求

傳送支援的音訊檔案,並提供 model 和 file。請先使用簡短的音訊樣本,以驗證上傳處理、語言偵測和輸出解析。

解讀回應

預設回應包含翻譯成英文的 text。如果要求其他回應格式,請依照該格式解析回應。

後續步驟

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

主體

multipart/form-data
file
file
必填

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

model
string
預設值:whisper-1
必填

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>
預設值:json

The output format for the translation.

可用選項:
json,
text,
srt,
verbose_json,
vtt
temperature
number
預設值: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.

必填範圍: 0 <= x <= 1

回應

200 - application/json

The translation result in English.

text
string
必填

The translated text in English.

最後修改於 2026年11月14日