Àkọsílẹ̀ API
Fi TTS.ai pamọ́ sínú àwọn ìṣàmúlò-ètò rẹ̀ láti inú REST API wà. Àwọn ìṣàmúlò-ètò OpenAI-ọ̀fẹ̀ fún ìṣàfilọ́lẹ̀ rọ́ọ̀nù.
Àwọn ìṣàmúlò-ètò
The TTS.ai API provides programmatic access to all platform features: text-to-speech synthesis, speech-to-text transcription, voice cloning, audio enhancement, and more. The API uses standard REST conventions with JSON request/response bodies.
Bọ́tìnì API
Gba àwọn bọ́tìnì API rẹ̀ láti Àwọn Àtòjọ-ẹ̀yàn Àtòjọ-ẹ̀yàn. Wa ni Pro ati Enterprise plans.
URL Ìdálẹ̀
https://api.tts.ai/v1/
Àwọn Àmì-ìwé
Àwọn Ìṣàmúlò-ètò Authorization àwọn àmì-ìwé
Àwọn Ìṣàmúlò-ètò
Gbogbo àwọn ìṣàmúlò-ètò API náà fẹ́ ìṣàfihàn láti inú tónẹ́ẹ̀lì Béèrì nínú Authorization àwọn àmì-ìwé.
Authorization: Bearer sk-tts-your-api-key-here
URL Ìdálẹ̀
Gbogbo àwọn ààyè-iṣẹ́ ìparí ní pàtó ní pàtó URL̀ ìṣàmúlò-ètò yìí. Àwọn ààyè-iṣẹ́ ìparí TTS ni:
Àwọn Ìgúnrégé Ìjáde
Àwọn ààyè-iṣẹ́ àwọn ààyè-iṣẹ́ API yatọ láti inú àwọn ààyè-iṣẹ́:
| Àwọn ìṣàmúlò-ètò | Àwọn Ìtàn/minútùù | Concurrent | Ìgbà pípẹ́ ìrísí-lẹ́tà kíki |
|---|---|---|---|
| Àwọn Ìṣàmúlò-ètò | 60 | 5 | Àwọn àmì-ìwé 5,000 |
| Àwọn Ìṣàfilọ́lẹ̀ | 300 | 20 | Àwọn àmì-ìwé 50,000 |
Àwọn àmì-ìwé-ìwé ìdáràn nínú àwọn ìsàlẹ̀-ilà gbogbo: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
Àwọn Ìṣàmúlò-ètò
| Àwọn iṣẹ́ | Àwọn Irinṣẹ́ | Unit |
|---|---|---|
| TTS (Móòdù Fẹ́ẹ̀: Piper, VITS, MeloTTS) | Àwọn ìṣàmúlò-ètò | fún àwọn àmì-àṣírí 1,000 |
| TTS (Móòdù ìpèwọ̀n: Kokoro, CosyVoice 2, abbl.) | Àwọn ìṣàmúlò-ètò 2 | fún àwọn àmì-àṣírí 1,000 |
| TTS (Móòdù Premium: Tortoise, Chatterbox, abbl.) | Àwọn ìṣàmúlò-ètò | fún àwọn àmì-àṣírí 1,000 |
| Àwọn Àmì-ìwé | Àwọn ìṣàmúlò-ètò 2 | Nínú iṣẹ́jú kọ̀ǹpútà |
| Àwọn Àmì-ìwé | Àwọn ìṣàmúlò-ètò | fún àwọn àmì-àṣírí 1,000 |
| Àtòjọ-ẹ̀yàn Àwọn Àmì-ìwé | Àwọn ìṣàmúlò-ètò | Nínú iṣẹ́jú kọ̀ǹpútà |
| Àwọn ìṣàfarawé àwòrán | Àwọn ìṣàmúlò-ètò 2 | Nínú iṣẹ́jú kọ̀ǹpútà |
| Ìjánu-ìṣàmúlò-ètò | Àwọn ìṣàmúlò-ètò | Nínú iṣẹ́jú kọ̀ǹpútà |
| Àwọn ìṣàfarawé kọ̀ǹpútà | Àwọn ìṣàmúlò-ètò | Nínú iṣẹ́jú kọ̀ǹpútà |
| Àkọlé àwòrán | Àwọn ìṣàmúlò-ètò | Àwọn ìṣàmúlò-ètò |
| Alábòójútó Bọ́tìnì BPM | Àìfihàn | -- |
| Àwọn Ìjánu-ìṣàmúlò-ètò | Àìfihàn | -- |
Àkọlé sí Àkọ́kọ́
Ṣàfikún àyọkà náà sí àwòrán àkọlé. Ṣàfikún fáìlì àwòrán nínú ìrísí-lẹ́tà tí a beere.
Àwọn ìṣàmúlò-ètò
| Àwọn ìkúndùǹ | Àwọn ìrísí-lẹ́tà | Tí a fẹ́ | Àkóónú |
|---|---|---|---|
| model | string | Yà | ID àwòrán (gẹ́gẹ́ bíi kokoro, chatterbox, piper) |
| text | string | Yà | Àkọlé tí a fẹ́ láti yipada sí àgbékalẹ̀ (àwọn àmì-àṣírí 5,000 fun Pro, 50,000 fun Enterprise) |
| voice | string | Yà | Àtòjọ Àwọn Àwòrán (lo /v1/voices/ láti ṣàfihàn àwọn àwòrán tí a ní) |
| format | string | Àwọn ààyè-iṣẹ́ | Àwọn ìṣàmúlò-ètò àtòjọ-ẹ̀yàn: mp3 (píríǹtì), wav, flac, ogg |
| speed | float | Àwọn ààyè-iṣẹ́ | Aṣàfilọ́lẹ̀ ìṣàfilọ́lẹ̀ ààyè-iṣẹ́. Àtòjọ-ẹ̀yàn: 1.0. Ìjáde: 0.5 sí 2.0 |
| language | string | Àwọn ààyè-iṣẹ́ | Àtòjọ-ètò ìtàn (gẹ́gẹ́ bíi, en, es). Àtòjọ-ètò ìṣàfilọ́lẹ̀ láti inú ìṣàfilọ́lẹ̀. |
| stream | boolean | Àwọn ààyè-iṣẹ́ | Fún ìṣàfilọ́lẹ̀ ìṣàfilọ́lẹ̀. Àtòjọ-ẹ̀yàn: fáìlì |
Àwọn ìṣàmúlò-ètò
curl -X POST https://api.tts.ai/v1/tts/ \
-H "Authorization: Bearer sk-tts-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "kokoro",
"text": "Hello from TTS.ai! This is a test.",
"voice": "af_bella",
"format": "mp3"
}' \
--output output.mp3
Àwọn ìsàlẹ̀-ilà
Returns the audio file as binary data with appropriate Content-Type header (audio/mpeg, audio/wav, etc.).
Content-Type: audio/mpeg
Content-Length: 48256
X-Credits-Used: 2
X-Credits-Remaining: 498
Àwọn Àmì-ìwé
Ṣàfihàn àwòrán láti inú àkọsílẹ̀. Ṣàfihàn àwọn ètò 99 láti inú ìṣàfilọ́lẹ̀ àtòjọ-ètò.
Àwọn ìṣàmúlò-ètò (multipart/form-data)
| Àwọn ìkúndùǹ | Àwọn ìrísí-lẹ́tà | Tí a fẹ́ | Àkóónú |
|---|---|---|---|
| file | file | Yà | Fáìlì àwòrán (MP3, WAV, FLAC, OGG, M4A, MP4, WebM). Max 100MB. |
| model | string | Àwọn ààyè-iṣẹ́ | Àwọn ìṣàmúlò-ètò STT: whisper (píríǹtì), faster-whisper, sensevoice |
| language | string | Àwọn ààyè-iṣẹ́ | Àtòjọ-ẹ̀yàn. àtòjọ-ẹ̀yàn fún ìṣàfihàn-àtòjọ-ẹ̀yàn (píríǹtì). |
| timestamps | boolean | Àwọn ààyè-iṣẹ́ | Ṣàfikún àwọn àkóónú àkóónú. Àtòjọ-ẹ̀yàn: fáìlì |
| diarize | boolean | Àwọn ààyè-iṣẹ́ | Mú ìṣàfilọ́lẹ̀ àwọn àkọlé àwòrán ṣiṣẹ́. Àtòjọ-ẹ̀yàn: fáìlì |
Àwọn ìsàlẹ̀-ilà
{
"text": "Hello, this is a transcription test.",
"language": "en",
"duration": 3.5,
"segments": [
{
"start": 0.0,
"end": 1.8,
"text": "Hello, this is",
"speaker": "SPEAKER_00"
},
{
"start": 1.8,
"end": 3.5,
"text": "a transcription test.",
"speaker": "SPEAKER_00"
}
]
}
Àwọn Àmì-ìwé
Ṣẹ̀dà àkọlé nínú àwòrán. Lọ́ọ̀kan àwòrán àti àyọkà ìṣàfilọ́lẹ̀.
Àwọn ìṣàmúlò-ètò (multipart/form-data)
| Àwọn ìkúndùǹ | Àwọn ìrísí-lẹ́tà | Tí a fẹ́ | Àkóónú |
|---|---|---|---|
| reference_audio | file | Yà | Àwòrán àwòrán ìṣàfilọ́lẹ̀ (10-30 àkókò). Max 20MB. |
| text | string | Yà | Àyọkà láti sọ nínú àwòrán tí a kọ́. |
| model | string | Àwọn ààyè-iṣẹ́ | Àwọn ìṣàmúlò-ètò Clone: chatterbox (píríǹtì), cosyvoice2, gpt-sovits |
| format | string | Àwọn ààyè-iṣẹ́ | Àwọn ìṣàmúlò-ètò àtòjọ-ẹ̀yàn: mp3 (píríǹtì), wav, flac |
| language | string | Àwọn ààyè-iṣẹ́ | Àtòjọ-ẹ̀yàn àwọn ètò ìjánu-ìṣàfilọ́lẹ̀. Ní pàtó láti jẹ́ ìṣàfilọ́lẹ̀ láti inú àwòrán tí a yan. |
Àwọn ìsàlẹ̀-ilà
Ṣàfihàn fáìlì àwòrán bí àtòjọ-ẹ̀yàn láti inú àtòjọ-ẹ̀yàn, bẹ́ẹ̀ nínú àwọn ààtò ìparí TTS.
Àtòjọ-ẹ̀yàn Àwọn Àmì-ìwé
Ṣàfikún àwòrán láti jẹ́ àwòrán ìṣàmúlò-ètò mìíràn. Ṣàfikún àwòrán ìṣàmúlò-ètò náà láti yan àwòrán ìṣàmúlò-ètò.
Àwọn ìṣàmúlò-ètò (multipart/form-data)
| Àwọn ìkúndùǹ | Àwọn ìrísí-lẹ́tà | Tí a fẹ́ | Àkóónú |
|---|---|---|---|
| file | file | Yà | Fáìlì ìrísí-lẹ́tà (MP3, WAV, FLAC). Max 50MB. |
| target_voice | string | Yà | Àtòjọ-ẹ̀yàn àwòrán tí a fẹ́ láti yipada sí (lo /v1/voices/ láti ṣàfihàn àwòrán tí a nì) |
| model | string | Àwọn ààyè-iṣẹ́ | Móòdù ìyipadà àwòrán: openvoice (píríǹtì), knn-vc |
| format | string | Àwọn ààyè-iṣẹ́ | Àwọn ìṣàmúlò-ètò àtòjọ-ẹ̀yàn: wav (píríǹtì), mp3, flac |
Àwọn ìṣàmúlò-ètò
curl -X POST https://api.tts.ai/v1/voice-convert/ \
-H "Authorization: Bearer sk-tts-your-key" \
-F "file=@source_audio.mp3" \
-F "target_voice=af_bella" \
-F "model=openvoice" \
-o converted.wav
Àwọn ìsàlẹ̀-ilà
Ṣàfihàn fáìlì àwòrán tí a yipadà láti inú àtòjọ-ẹ̀yàn.
Àwọn ìṣàfarawé kọ̀ǹpútà
Ṣàfihàn àwòrán tí a sọ̀rọ̀ láti ìtàn kan sí àwòrán mìíràn. Ṣàfihàn àwòrán-si-àkọsílẹ̀, ìṣàfihàn, àwòrán-si-àkọsílẹ̀ nínú ipe kan.
Àwọn ìṣàmúlò-ètò (multipart/form-data)
| Àwọn ìkúndùǹ | Àwọn ìrísí-lẹ́tà | Tí a fẹ́ | Àkóónú |
|---|---|---|---|
| file | file | Yà | Fáìlì ìrísí-lẹ́tà nínú ìrísí-lẹ́tà ìṣàfarawe. Max 100MB. |
| target_language | string | Yà | Àtòjọ-ètò ìsàlẹ̀-ilà (gẹ́gẹ́ bíi es, fr, de, ja) |
| voice | string | Àwọn ààyè-iṣẹ́ | Àwòrán fún àwọn àtòjọ-ẹ̀yàn tí a tumọ̀. A yan nípa àtòjọ-ẹ̀yàn tí a kò bà jẹ́. |
| preserve_voice | boolean | Àwọn ààyè-iṣẹ́ | Àwọn ààyè-iṣẹ́ ìṣàfihàn |
Àwọn ìsàlẹ̀-ilà
{
"original_text": "Hello, how are you?",
"translated_text": "Hola, como estas?",
"source_language": "en",
"target_language": "es",
"audio_url": "https://api.tts.ai/v1/results/translate_abc123.mp3",
"credits_used": 5
}
Àwọn Àkọlé
Ṣàfikún àwọn ìṣàmúlò-ètò, àwọn ìrànwọ́, tàbí àwọn ìṣàfilọ́lẹ̀ nígbà tí a bá tọju àwọn ìṣàmúlò-ètò náà. Lórí ìṣàfilọ́lẹ̀ àwọn ìṣàmúlò-ètò, àwọn ìṣàfilọ́lẹ̀, àti àwọn ìṣàfilọ́lẹ̀.
Àwọn ìṣàmúlò-ètò (multipart/form-data)
| Àwọn ìkúndùǹ | Àwọn ìrísí-lẹ́tà | Tí a fẹ́ | Àkóónú |
|---|---|---|---|
| file | file | Yà | Fáìlì àwòrán ìṣàfihàn. Max 50MB. |
| voice | string | Yà | Àtòjọ-ẹ̀yàn àwòrán fún àwòrán |
| model | string | Àwọn ààyè-iṣẹ́ | Àwọn ìṣàmúlò-ètò: openvoice (píríǹtì), chatterbox |
| emotion | string | Àwọn ààyè-iṣẹ́ | Àkọ́lé àwòrán: ọ̀fẹ́, ọ̀fẹ́, ọ̀pọ̀lú, ọ̀pọ̀lú, ọ̀pọ̀lú |
| speed | float | Àwọn ààyè-iṣẹ́ | Àtòjọ-ẹ̀yàn ààyè-iṣẹ́. Àtòjọ-ẹ̀yàn ìpéwọ̀n: 1.0. Àwọn ààyè-iṣẹ́: 0.5 sí 2.0 |
Àwọn ìsàlẹ̀-ilà
Ṣàfihàn fáìlì àwòrán tí a yipadà láti inú àtòjọ-ẹ̀yàn.
Àwọn Àtòjọ-ẹ̀yàn Àkọsílẹ̀
Àwọn ààyè-iṣẹ́ ìparí ìṣàfarawé àwòrán fún ìṣàfarawé, ìjánu-ìṣàmúlò-ètò, ìjánu-ìṣàfilọ́lẹ̀, àti àwọn mìíràn mìíràn.
Ṣàfihàn àwọn ìṣàmúlò-ètò àwòrán: denoise, ìṣàfihàn ìwọ̀n, àwọn ìṣàfihàn nla.
| file file | Fáìlì àwòrán tí a fẹ́ mú |
| denoise boolean | Ṣàfikún àwọn ìṣàmúlò-ètò tí a kò fẹ́ (òrò: òótọ́) |
| enhance_clarity boolean | Ṣẹ̀dà ìròyìn àkọlé ( ìpéwọ̀n: òótọ́) |
| super_resolution boolean | Ìgúnrégé àwọn àyọkà ìṣàfarawé àwọn ìṣàmúlò-ètò |
| strength integer | 1-3 (ìwọ̀n, ìsàlẹ̀-ilà, ìrànwọ́). Àwọn ìpéwọ̀n: 2 |
Ṣẹ̀dà àwọn àwòrán láti inú àwọn ìṣàmúlò-ètò (ìjáde àwòrán) tàbí fi pamọ́ láti inú àwọn ẹ̀yàn.
| file file | Fáìlì àwòrán tí a fẹ́ fi pamọ́ |
| model string | demucs (Àwọn ìpéwọ̀n) tabi spleeter |
| stems integer | Àwọn àgbèwọlé: 2, 4, 5, tàbí 6 (píríǹtì: 2) |
| format string | Àwọn ìṣàmúlò-ètò àtòjọ-ẹ̀yàn: wav, mp3, flac |
Ṣàfikún àgbègbè àti àgbègbè láti inú àwọn àkọsílẹ̀ àwòrán.
| file file | Fáìlì àwòrán tí a óò lò |
| type string | echo or reverb (default: both) |
| intensity integer | 1-5 (default: 3) |
Ṣàfihàn àwòrán láti ṣàfihàn bọ́tìnì, BPM, àti àyọkà ìgbà.
| file file | Audio file to analyze |
{
"key": "C",
"scale": "Major",
"bpm": 120.0,
"time_signature": "4/4",
"camelot": "8B",
"compatible_keys": ["C Major", "G Major", "F Major", "A Minor"]
}
Ṣàfikún àwòrán laarin àwọn ìrísí-lẹ́tà.
| file file | Fáìlì àwòrán láti yipada |
| format string | Àwọn ìṣàmúlò-ètò: mp3, wav, flac, ogg, m4a, aac |
| bitrate integer | Bítárátì ìjánu-ìṣàfilọ́lẹ̀ nínú kbps: 64, 128, 192, 256, 320 |
| sample_rate integer | Àwọn ìṣàmúlò-ètò: |
| channels string | mono tabi stereo |
Àkọlé àwòrán
Fi àwòrán tàbí àkọlé pamọ́ ki o si gba ìjánu-íjánu AI nípa ìṣàfarawe-ìrọ̀.
Àwọn ìṣàmúlò-ètò (multipart/form-data tabi JSON)
| Àwọn ìkúndùǹ | Àwọn ìrísí-lẹ́tà | Tí a fẹ́ | Àkóónú |
|---|---|---|---|
| audio | file | Àwọn ààyè-iṣẹ́* | Ààyè-iṣẹ́ àwòrán (yàni àwòrán tàbí àyọkà tí a fẹ́) |
| text | string | Àwọn ààyè-iṣẹ́* | Àwọn ìṣàmúlò-ètò àyọkà (ọ̀kan ninu àwòrán tàbí àwòrán tí a fẹ́) |
| voice | string | Àwọn ààyè-iṣẹ́ | Àwòrán fún àgbékalẹ̀ AI. Àtòjọ-ẹ̀yàn: af_bella |
| tts_model | string | Àwọn ààyè-iṣẹ́ | Àwọn ìṣàmúlò-ètò TTS fún àgbékalẹ̀. Àtòjọ-ẹ̀yàn: kokoro |
| system_prompt | string | Àwọn ààyè-iṣẹ́ | Àwọn ìṣàmúlò-ètò fún AI |
| conversation_id | string | Àwọn ààyè-iṣẹ́ | Lọ́wọ́lọ́wọ́ àkọlé tí wa |
Àwọn ìsàlẹ̀-ilà
{
"conversation_id": "conv_abc123",
"user_text": "What is the capital of France?",
"ai_text": "The capital of France is Paris.",
"audio_url": "https://api.tts.ai/v1/audio/tmp/resp_xyz.mp3",
"credits_used": 3
}
Àtòjọ àwọn ìṣàmúlò-ètò
Ṣàfihàn àtòjọ àwọn ìṣàmúlò-ètò tó lè wa nínú àwọn ìṣàmúlò-ètò wọn.
Àwọn ìsàlẹ̀-ilà
{
"models": [
{
"id": "kokoro",
"name": "Kokoro",
"type": "tts",
"tier": "standard",
"languages": ["en", "ja", "ko", "zh", "fr"],
"supports_cloning": false,
"supports_streaming": true,
"credits_per_1k_chars": 2
},
{
"id": "chatterbox",
"name": "Chatterbox",
"type": "tts",
"tier": "premium",
"languages": ["en"],
"supports_cloning": true,
"supports_streaming": true,
"credits_per_1k_chars": 4
}
]
}
Àwọn Àmì-ìwé Àtòjọ
Ṣàfihàn àtòjọ àwọn àwòrán tó lè wa ní pàtó, àti àwọn ìṣàmúlò-ètò ìṣàfihàn láti inú àwòrán tàbí àwòrán.
Àwọn ààtòjọ-ẹ̀yàn
| Àwọn ìkúndùǹ | Àwọn ìrísí-lẹ́tà | Àkóónú |
|---|---|---|
| model | string | Píríǹtì láti inú ID ìṣàmúlò-ètò (gẹ́gẹ́ bíi kokoro) |
| language | string | Fi àwọn àmì-ìwé ìsàlẹ̀-ilà pamọ́ (gẹ́gẹ́ bíi en) |
| gender | string | Aṣàfilọ́lẹ̀ láti inú ìwọ̀n: ọmọkunrin, ọmọbinrin, ọ̀kan-ọ̀kan |
Àwọn ìsàlẹ̀-ilà
{
"voices": [
{
"id": "af_bella",
"name": "Bella",
"model": "kokoro",
"language": "en",
"gender": "female",
"preview_url": "https://api.tts.ai/v1/voices/preview/af_bella.mp3"
}
],
"total": 142
}
Àwọn Ààtòjọ-ẹ̀yàn
Àkọlé sí Àkọ́kọ́
import requests
API_KEY = "sk-tts-your-key"
# Text to Speech
response = requests.post(
"https://api.tts.ai/v1/tts/",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"model": "kokoro",
"text": "Hello from TTS.ai!",
"voice": "af_bella",
"format": "mp3"
}
)
with open("output.mp3", "wb") as f:
f.write(response.content)
print(f"Credits used: {response.headers.get('X-Credits-Used')}")
Àwọn Àmì-ìwé
# Speech to Text
with open("recording.mp3", "rb") as f:
response = requests.post(
"https://api.tts.ai/v1/stt/",
headers={"Authorization": f"Bearer {API_KEY}"},
files={"file": f},
data={"model": "faster-whisper", "timestamps": "true"}
)
result = response.json()
print(result["text"])
Àwọn Àmì-ìwé
# Voice Cloning
with open("reference.wav", "rb") as ref:
response = requests.post(
"https://api.tts.ai/v1/tts/clone/",
headers={"Authorization": f"Bearer {API_KEY}"},
files={"reference_audio": ref},
data={
"text": "This speech uses a cloned voice.",
"model": "chatterbox"
}
)
with open("cloned_output.mp3", "wb") as f:
f.write(response.content)
Àkọlé sí Àkọ́kọ́
const API_KEY = 'sk-tts-your-key';
// Text to Speech
const response = await fetch('https://api.tts.ai/v1/tts/', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'kokoro',
text: 'Hello from TTS.ai!',
voice: 'af_bella',
format: 'mp3'
})
});
const audioBlob = await response.blob();
const audioUrl = URL.createObjectURL(audioBlob);
const audio = new Audio(audioUrl);
audio.play();
Àwọn Àmì-ìwé
// Speech to Text
const formData = new FormData();
formData.append('file', audioFile);
formData.append('model', 'faster-whisper');
const response = await fetch('https://api.tts.ai/v1/stt/', {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}` },
body: formData
});
const result = await response.json();
console.log(result.text);
Àkọlé sí Àkọ́kọ́
# Text to Speech
curl -X POST https://api.tts.ai/v1/tts/ \
-H "Authorization: Bearer sk-tts-your-key" \
-H "Content-Type: application/json" \
-d '{"model":"kokoro","text":"Hello!","voice":"af_bella","format":"mp3"}' \
-o output.mp3
Àwọn Àmì-ìwé
# Speech to Text
curl -X POST https://api.tts.ai/v1/stt/ \
-H "Authorization: Bearer sk-tts-your-key" \
-F "file=@recording.mp3" \
-F "model=faster-whisper" \
-F "timestamps=true"
Àwọn Àmì-ìwé
# Voice Cloning
curl -X POST https://api.tts.ai/v1/tts/clone/ \
-H "Authorization: Bearer sk-tts-your-key" \
-F "reference_audio=@reference.wav" \
-F "text=This uses a cloned voice." \
-F "model=chatterbox" \
-o cloned.mp3
Àwọn ìṣàfarawé àwòrán
# Audio Enhancement
curl -X POST https://api.tts.ai/v1/audio/enhance/ \
-H "Authorization: Bearer sk-tts-your-key" \
-F "file=@noisy_audio.mp3" \
-F "denoise=true" \
-F "enhance_clarity=true" \
-o enhanced.mp3
Àwọn Àmì-ìwé Àṣìṣe
Gbogbo àwọn ìṣàmúlò-ètò náà láti gba ìjánu-ìrò JSON láti inú error ààyè.
{
"error": {
"code": "insufficient_credits",
"message": "You do not have enough credits for this request.",
"credits_required": 4,
"credits_available": 2
}
}
| Ààyè HTTP | Error Code | Àkóónú |
|---|---|---|
| 400 | bad_request |
Àwọn ìpéwọ̀n ìtàn tí kò tọ́. Ṣàyẹwo àmì-ìwé ìṣàfarawé fún àwọn ìròyìn. |
| 401 | unauthorized |
Bọ́tìnì API tí kùnà tàbí tí kò tọ́. |
| 402 | insufficient_credits |
Kò ní àwọn ẹ̀yàn to kù jù lọ. Ràwọ́lù nínú /pricing/. |
| 403 | forbidden |
Àwọn ìṣàmúlò-ètò API kò wa nínú àtòjọ-ẹ̀yàn rẹ̀. |
| 404 | not_found |
A kò rí àwọn ìṣàmúlò-ètò àti àwòrán. |
| 413 | file_too_large |
Fáìlì tí a fi pamọ́ lọ́wọ́lọ́wọ́ lọ́wọ́lọ́wọ́. |
| 429 | rate_limited |
Àwọn ìṣàmúlò-ètò tí a fẹ́ jù lọ. Ṣàyẹwo àwọn àmì-ìwé ìpejúwé. |
| 500 | internal_error |
Àṣìṣe àwọn sáà. Wá nígbà kejì. |
| 503 | model_loading |
Ìṣàmúlò-ètò náà tí n ṣàfihàn. Jẹ́ ki o ṣàfihàn lẹ́nú àwọn ìsàlẹ̀-ètò diẹ. |
Àwọn wẹ́ẹ̀bù
Fún àwọn iṣẹ́ tí n lọ́wọ́lọ́wọ́ jú lọ́wọ́lọ́wọ́ lọ́wọ́lọ́wọ́, o lè ṣàfihàn ààtòjọ-ẹ̀yàn webhook_url. Nígbà tí iṣẹ́ náà bá parí, a á fi ààtòjọ-ẹ̀yàn náà pamọ́ sí URL rẹ̀.
{
"event": "task.completed",
"task_id": "task_abc123",
"status": "success",
"result_url": "https://api.tts.ai/v1/results/task_abc123",
"credits_used": 12,
"created_at": "2025-01-15T10:30:00Z",
"completed_at": "2025-01-15T10:30:45Z"
}
Rẹ́ọ̀nù láti Ṣẹ̀dá
Gba bọ́tìnì API rẹ̀ láti fi TTS.ai pamọ́ sí àwọn ìṣàmúlò-ètò rẹ̀.