Skip to main content
POST
/
v1
/
audio
/
speech
cURL
curl https://api.deerapi.com/v1/audio/speech \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DEERAPI_KEY" \
  -d '{
    "model": "tts-1",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy"
  }'
"<string>"

Overview

Use this endpoint to call the TTS workflow through DeerAPI. The API reference on this page shows the request schema, response schema, authentication requirements, and runnable examples for the configured endpoint.

Before you start

Use the DeerAPI base URL and pass your API Key in the Authorization header:
https://api.deerapi.com
Authorization: Bearer $DEERAPI_KEY

Model selection

Choose a current model ID from the live pricing page. Model availability changes over time, so avoid copying a model ID from an old project without checking the live list first.

Implementation notes

  • Use the OpenAPI playground for the exact request fields accepted by this endpoint.
  • Keep API Keys on the server side when you build production applications.
  • Log the request ID from failed calls so support can investigate the request.
  • Retry 429, 500, and 503 responses with exponential backoff.

Authorizations

Authorization
string
header
required

Use a DeerAPI API Key as a Bearer token.

Body

application/json
model
string
default:tts-1
required

The TTS model to use. Choose a current speech model from the Models page.

input
string
required

The text to generate audio for. Maximum length is 4096 characters.

Maximum string length: 4096
voice
enum<string>
default:alloy
required

The voice to use for speech synthesis.

Available options:
alloy,
ash,
ballad,
coral,
echo,
fable,
onyx,
nova,
sage,
shimmer
response_format
enum<string>
default:mp3

The audio output format.

Available options:
mp3,
opus,
aac,
flac,
wav,
pcm
speed
number
default:1

The speed of the generated audio. Select a value between 0.25 and 4.0.

Required range: 0.25 <= x <= 4

Response

200 - audio/mpeg

The audio file content.

The response is of type file.