BazaarLinkBazaarLink
Đăng nhập
Tài liệuTham chiếu APITham chiếu SDKSử dụng AgentKỹ năng AI
Tổng hợp giọng nói

Chép lời âm thanh

Gửi multipart/form-data model và file hoặc JSON model và input_audio:{data,format} (base64 thuần). Định dạng: wav, mp3, mp4, m4a, ogg, flac, webm, aac. Âm thanh tối đa 25 MiB; thân yêu cầu 50 MiB cho base64. audio.transcription_max_seconds_by_model đặt giới hạn theo mô hình; nếu thiếu, dùng audio.transcription_max_seconds rồi mặc định 60 giây. Âm thanh dài hơn bị từ chối trước khi xử lý với 413 audio_too_long và không bị tính phí. response_format chỉ json hoặc verbose_json; timestamp_granularities word/segment cần verbose_json. Không hỗ trợ stream (400 unsupported_parameter); quá lớn: 413 audio_too_large. Bỏ qua provider. Giá cơ sở dữ liệu theo usage.seconds hoặc token đầu vào/đầu ra; giá phút = 60 × giá giây. usage.cost là phí khách hàng bằng USD.

POST/v1/audio/transcriptions

Xác thực

Authorizationbắt buộc
string · header

API key dưới dạng bearer token trong header Authorization.

Body

modelbắt buộc
string

ID mô hình chuyển lời nói, ví dụ elevenlabs/scribe-v2.

GET /v1/models?output_modalities=transcription
file
file

Tệp âm thanh (multipart). Hỗ trợ wav, mp3, mp4, m4a, ogg, flac, webm, aac, tối đa 25 MiB. Khách JSON có thể gửi input_audio: {data: base64, format} thay thế.

multipart/form-data: required; decoded <= 25 MiB
input_audio
object

Dữ liệu âm thanh JSON thay cho file: data là âm thanh base64 thuần, format là kiểu như wav hoặc mp3. Thân yêu cầu tối đa 50 MiB; âm thanh giải mã tối đa 25 MiB.

application/json: required; data: raw base64; format: wav | mp3 | mp4 | m4a | ogg | flac | webm | aac
response_format
string

json (mặc định) trả về {text}; verbose_json thêm ngôn ngữ, thời lượng và segments/words.

default: json
jsonverbose_json
timestamp_granularities
string[]

word và/hoặc segment. Chỉ áp dụng với response_format=verbose_json; định dạng khác sẽ bỏ qua. Hiện chưa trả về mốc thời gian theo từng từ; segments thì có.

response_format=verbose_json; multipart: timestamp_granularities[]
wordsegment
language
string

Gợi ý ngôn ngữ tùy chọn như en hoặc zh. Để trống để tự nhận diện.

ISO-639-1
prompt
string

Văn bản ngữ cảnh tùy chọn giúp nhận diện tên và thuật ngữ. Không phải mô hình nào cũng áp dụng.

temperature
number

Nhiệt độ lấy mẫu tùy chọn; không phải mô hình nào cũng áp dụng.

0 <= temperature <= 1
stream
boolean

Không hỗ trợ truyền trực tiếp; stream=true trả về 400 unsupported_parameter.

Unsupported: 400 unsupported_parameter
provider
object

Trường định tuyến tùy chọn; bị bỏ qua.

Ignored

Hướng dẫn chi tiết →

POST /v1/audio/transcriptions
curl https://api.bazaarlink.ai/v1/audio/transcriptions \
  -H "$BAZAARLINK_AUTH_HEADER" \
  -F model="<transcription-model-id>" \
  -F file=@audio.wav \
  -F response_format=json

curl https://api.bazaarlink.ai/v1/audio/transcriptions \
  -H "$BAZAARLINK_AUTH_HEADER" \
  -H "Content-Type: application/json" \
  -d '{"model":"<transcription-model-id>","input_audio":{"data":"<raw-base64-audio>","format":"wav"},"response_format":"verbose_json","timestamp_granularities":["word","segment"]}'
Ví dụ phản hồi

Chép lời âm thanh: json / verbose_json — Phí ví dụ chỉ để minh họa, không phải giá mô hình. audio.transcription_max_seconds_by_model đặt giới hạn theo mô hình; nếu thiếu, dùng audio.transcription_max_seconds rồi mặc định 60 giây. Âm thanh dài hơn bị từ chối trước khi xử lý với 413 audio_too_long và không bị tính phí.

{"text":"Hello","usage":{"seconds":1,"cost":0.00001}}
verbose_json
{"text":"Hello","duration":1,"segments":[{"id":0,"start":0,"end":1,"text":"Hello"}],"words":[{"word":"Hello","start":0,"end":1}],"usage":{"seconds":1,"cost":0.00001}}
Support
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
Chép lời âm thanh — BazaarLink API