Skip to main content
POST
Python
Sử dụng endpoint này để dịch âm thanh lời nói thành văn bản tiếng Anh. Endpoint này phù hợp cho hàng đợi hỗ trợ đa ngôn ngữ, rà soát nội dung truyền thông và các quy trình cần một bản ghi tiếng Anh từ âm thanh bằng ngôn ngữ khác.

Yêu cầu đầu tiên

Gửi một tệp âm thanh được hỗ trợ với modelfile. Hãy dùng một mẫu ngắn trước để bạn có thể xác minh việc xử lý tải lên, phát hiện ngôn ngữ và phân tích đầu ra.

Đọc phản hồi

Phản hồi mặc định bao gồm text tiếng Anh đã được dịch. Nếu bạn yêu cầu một định dạng phản hồi khác, hãy phân tích phản hồi theo đúng định dạng đó.

Các bước tiếp theo

Ủy quyền

Authorization
string
header
bắt buộc

Bearer token authentication. Use your CometAPI key.

Nội dung

multipart/form-data
file
file
bắt buộc

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

model
string
mặc định:whisper-1
bắt buộc

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>
mặc định:json

The output format for the translation.

Tùy chọn có sẵn:
json,
text,
srt,
verbose_json,
vtt
temperature
number
mặc định: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.

Phạm vi bắt buộc: 0 <= x <= 1

Phản hồi

200 - application/json

The translation result in English.

text
string
bắt buộc

The translated text in English.