Skip to main content
POST
/
audio
/
speech
Speech Generation API
curl --request POST \
  --url https://geekai.dev/api/v1/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "tts-1",
  "input": "Hi, nice to meet you!",
  "voice": "alloy",
  "response_format": "mp3",
  "speed": 1,
  "retries": 0
}'
This response does not have an example.
Note: For speech model name settings, refer to the System Supported Speech Model List. The request/response parameter structure is fully compatible with OpenAI. When switching models, you only need to modify the corresponding model name. If the model request/response parameters are inconsistent with OpenAI, GeekAI will automatically convert and align them at the backend.
The response data format is fully compatible with OpenAI, returning the binary data of the audio file.

cURL Request Example

curl --location 'https://geekai.dev/api/v1/audio/speech' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: {YOUR_GEEKAI_API_KEY}' \
    --data '{
        "input":"Hello! Nice to meet you!",
        "model":"tts-1",
        "voice":"ash",
        "speed":"1.0"
    }'

Authorizations

Authorization
string
header
required

token

Body

application/json
model
string
required

speech model

Example:

"tts-1"

input
string
required

input text

Example:

"Hi, nice to meet you!"

voice
string
required

voice option

Example:

"alloy"

response_format
string
default:mp3

response format

Example:

"mp3"

speed
number
default:1

speech speed(between 0.25-4.0)

Example:

1

retries
integer
default:0

auto retry times, default 0, means no retry

Example:

0

Response

successful response

mp3 format audio

I