cURL
curl --request POST \ --url https://api.example.com/tts \ --header 'Content-Type: application/json' \ --data ' { "text": "<string>", "language": "<string>", "api_key": "<string>" } '
Convert text to speech
curl -X POST https://api.gistmag.co.uk/tts \ -H "Content-Type: application/json" \ -d '{ "text": "Hello, this is a test of the text-to-speech API.", "language": "en", "api_key": "your_api_key_here" }' \ --output output.wav
audio/wav
attachment; filename=output.wav
import requests response = requests.post( "https://api.gistmag.co.uk/tts", json={ "text": "Hello, this is a test.", "language": "en", "api_key": "your_api_key_here" } ) with open("output.wav", "wb") as f: f.write(response.content)
const response = await fetch('https://api.gistmag.co.uk/tts', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ text: 'Hello, this is a test.', language: 'en', api_key: 'your_api_key_here' }) }); const audioBlob = await response.blob(); const audioUrl = URL.createObjectURL(audioBlob); // Play the audio or download it