Introduction

Base URL, authentication, response formats, and error codes for the Speechify API

The Speechify API is a RESTful service at https://api.speechify.ai. All requests require an API key in the Authorization header.

Authorization: Bearer YOUR_API_KEY

Install an official SDK to get started:

$pip install speechify-api
1from speechify import Speechify
2
3client = Speechify() # uses SPEECHIFY_API_KEY env var

Set the SPEECHIFY_API_KEY environment variable and the SDKs authenticate automatically.

Example request

A minimal text-to-speech call. The request and response below are generated from the API specification, so they stay in sync with the live endpoint.

POST
/v1/audio/speech
1curl -X POST https://api.speechify.ai/v1/audio/speech \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "input": "Hello! This is the Speechify text-to-speech API.",
6 "voice_id": "george",
7 "audio_format": "mp3",
8 "model": "simba-english"
9}'
Response
1{
2 "audio_data": "string",
3 "audio_format": "wav",
4 "billable_characters_count": 1,
5 "speech_marks": {
6 "chunks": [
7 {
8 "end": 1,
9 "end_time": 1.1,
10 "start": 1,
11 "start_time": 1.1,
12 "type": "string",
13 "value": "string"
14 }
15 ],
16 "end": 1,
17 "end_time": 1.1,
18 "start": 1,
19 "start_time": 1.1,
20 "type": "string",
21 "value": "string"
22 }
23}

Response format

All non-streaming endpoints return JSON. Audio data is base64-encoded in the audio_data field. The streaming endpoint returns raw audio chunks via HTTP chunked transfer encoding.

Errors

The API uses standard HTTP status codes:

StatusMeaning
400Invalid request parameters
401Missing or invalid API key
402Insufficient account balance
429Rate or concurrency limit exceeded
500Server error

Error responses include a JSON body with an error field describing the issue.