Speech to Text

Speech-to-Text (STT) API nhận một file audio và trả về văn bản được nhận dạng từ nội dung audio đó.

Base URL

https://api.omicx.one/public-svc/api/ai

Gọi thử endpoint

Request dùng multipart/form-data để đính kèm file audio:

$curl --location 'https://api.omicx.one/public-svc/api/ai/stt' \
> --header 'accept: application/json' \
> --header 'x-api-key: YOUR_API_KEY' \
> --form 'file=@"/path/to/audio.mp3"' \
> --form 'languageCode="vi"' \
> --form 'providerType="OMICALL"'

Response trả về JSON chứa văn bản nhận dạng được:

1{
2 "text": "Xin chào, đây là bản demo từ OMICX",
3 "languageCode": "vi",
4 "durationMs": 2400,
5 "confidence": 0.94,
6 "creditsUsed": 10
7}

Billing

Chi phí được tính theo độ dài audio đầu vào, quy đổi theo tỷ lệ 1 phút audio = 10 credits (làm tròn lên theo phút).

Xử lý lỗi

Nếu request thất bại, API trả về JSON mô tả lỗi, cùng định dạng với Text-to-Speech:

1{
2 "error": {
3 "code": "invalid_audio_format",
4 "message": "Định dạng file audio không được hỗ trợ."
5 }
6}

Xem đầy đủ tham số tại API Reference.