跳轉到主要內容
POST
Python
使用此端點將音訊轉錄為原始語言的文字。它適用於需要可搜尋文字的會議記錄、語音訊息、媒體索引、字幕及支援工作流程。

首次請求

傳送支援的音訊檔案,並提供 model 和 file。驗證上傳處理、身分驗證和回應解析時,請先使用較短的檔案。

讀取回應

預設回應包含轉錄後的 text。如果要求其他回應格式,請確保用戶端解析該格式,而不是假設回應採用預設的 JSON 結構。

後續步驟

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

主體

multipart/form-data
file
file
必填

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

model
string
預設值:whisper-1
必填

The speech-to-text model to use. Choose a current speech model from the Models page.

language
string

The language of the input audio in ISO-639-1 format (e.g., en, zh, ja). Supplying the language improves accuracy and latency.

prompt
string

Optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.

response_format
enum<string>
預設值:json

The output format for the transcription.

可用選項:
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 transcription result.

text
string
必填

The transcribed text.

最後修改於 2026年11月14日