Skip to main content
POST
Python
使用此端點可將音訊以來源語言轉錄為文字。適用於會議記錄、語音訊息、媒體索引、字幕,以及需要可搜尋文字的支援工作流程。

First request

傳送受支援的音訊檔案,並附上 modelfile。在驗證上傳處理、驗證機制與回應剖析之前,請先使用較短的第一個檔案。

Read the response

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

Next steps

  • 當你需要文字轉語音輸出時,請使用 建立語音
  • 當目標輸出應為英文時,請使用 建立翻譯

授權

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.