Skip to main content
POST
Python
使用此端點可將語音音訊翻譯為英文文字。它適用於多語言支援佇列、媒體審查,以及需要將其他語言音訊統一轉成英文逐字稿的工作流程。

First request

傳送支援的音訊檔案,並提供 modelfile。建議先使用簡短樣本,以便驗證上傳處理、語言偵測與輸出剖析。

Read the response

預設回應會包含翻譯後的英文 text。如果你要求不同的回應格式,請依照該格式解析回應。

Next steps

  • 當你需要原始語言的文字時,請使用 建立轉錄
  • 當你需要從文字產生音訊時,請使用 建立語音

授權

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.