Menu

Text-to-Speech API

Convert text to natural speech in Ghanaian languages

💰 Cost: 2 credits per request

Endpoint

POST https://api.bisakofi.com/api/tts

Request

  • text (required): Text to convert to speech

    language (required): Language code: tw, ee

Response

{
  "success": true,
  "audio": "base64_encoded_audio_data...",
  "format": "mp3",
  "encoding": "base64",
  "creditsRemaining": 98
}

Example

const response = await fetch('https://api.bisakofi.com/api/tts', {
  method: 'POST',
  headers: {
    'X-API-Key': 'bsk_your_api_key_here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    text: 'Akwaaba! Wo ho te sen?',
    language: 'tw'
  })
});

const data = await response.json();

const audio = new Audio('data:audio/mp3;base64,' + data.audio);
audio.play();

What did you think of this content?

like-icon

It was helpful

dislike-icon

It was not helpful

feedback-icon

I have a feedback