Skip to main content
POST
Python
Użyj tego endpointu, aby transkrybować audio na tekst w języku źródłowym. Sprawdza się to w notatkach ze spotkań, wiadomościach głosowych, indeksowaniu mediów, napisach oraz procesach wsparcia, które wymagają tekstu z możliwością wyszukiwania.

Pierwsze żądanie

Wyślij obsługiwany plik audio wraz z model i file. Na początku użyj krótkiego pliku, gdy weryfikujesz obsługę uploadu, uwierzytelnianie i parsowanie odpowiedzi.

Odczyt odpowiedzi

Domyślna odpowiedź zawiera przetranskrybowany text. Jeśli żądasz innego formatu odpowiedzi, upewnij się, że klient parsuje ten format, zamiast zakładać domyślną strukturę JSON.

Kolejne kroki

Autoryzacje

Authorization
string
header
wymagane

Bearer token authentication. Use your CometAPI key.

Treść

multipart/form-data
file
file
wymagane

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

model
string
domyślnie:whisper-1
wymagane

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>
domyślnie:json

The output format for the transcription.

Dostępne opcje:
json,
text,
srt,
verbose_json,
vtt
temperature
number
domyślnie: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.

Wymagany zakres: 0 <= x <= 1

Odpowiedź

200 - application/json

The transcription result.

text
string
wymagane

The transcribed text.