ENGLISH TO TWI

Real-time professional translation and high-fidelity speech synthesis.

ENGLISH TWI

API Reference

Base URL: https://african-tts.vercel.app  |  Interactive docs: /docs

POST /api/translate

Translate English text to Asante Twi. Fast and lightweight — no audio synthesis.

Request Body
{
  "english_text": "Good morning!"
}
Response
{
  "translated_text": "Mema wo akye!"
}
cURL Example
curl -X POST "https://african-tts.vercel.app/api/translate" \
  -H "Content-Type: application/json" \
  -d '{"english_text": "Good morning!"}'
⚡ Try it live
POST /api/translate-twi

Translate Asante Twi text to English.

Parameters
Field Type Description
twi_text string The Twi text to translate.
Request Body
{
  "twi_text": "Mereba fie."
}
Response
{
  "translated_text": "I am coming home."
}
cURL Example
curl -X POST "https://african-tts.vercel.app/api/translate-twi" \
  -H "Content-Type: application/json" \
  -d '{"twi_text": "Mereba fie."}'
⚡ Try it live
POST /api/tts

Translate English to Twi and synthesize to speech. Returns a playable audio URL.

Parameters
Field Type Description
english_text string English input (translates automatically)
twi_text string Twi input (skips translation step)
speaker string "Female" | "Male (Low)" | "Male (High)"
Request
{
  "english_text": "I am coming home.",
  "speaker": "Female"
}
Response
{
  "twi_text": "Mereba fie.",
  "audio_url": "data:audio/wav;base64,..."
}
cURL Examples
curl -X POST "https://african-tts.vercel.app/api/tts" \
  -H "Content-Type: application/json" \
  -d '{"english_text": "I am coming home.", "speaker": "Female"}'
curl -X POST "https://african-tts.vercel.app/api/tts" \
  -H "Content-Type: application/json" \
  -d '{"english_text": "I am coming home.", "speaker": "Male (Low)"}'
⚡ Try it live
POST /api/tts-english

Translate Asante Twi to English and synthesize to speech. Returns a playable audio URL.

Parameters
Field Type Description
twi_text string The Twi text to translate and synthesize.
include_audio boolean Whether to include audio in the response.
cURL Examples
curl -X POST "https://african-tts.vercel.app/api/tts-english" \
  -H "Content-Type: application/json" \
  -d '{"twi_text": "Mereba fie.", "include_audio": true}'
curl -X POST "https://african-tts.vercel.app/api/tts-english" \
  -H "Content-Type: application/json" \
  -d '{"twi_text": "Mereba fie.", "include_audio": false}'
⚡ Try it live