SexyVoice Docs
Guides

API Quickstart

How to authenticate, generate speech, and check billing with SexyVoice API

Use the API when you want to generate speech from your own backend or app.

Prerequisites

  • A SexyVoice account
  • API key from Dashboard -> API Keys
  • Paid account

1. Authenticate

Send your API key as a Bearer token:

-H 'Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

2. Generate Speech

You can select a voice in either of two ways:

  • Pass voice + model for name-based lookup.
  • Pass voiceId from GET /api/v1/voices; the API derives the model from that voice ID.

Using gpro model

Gemini voices (gpro and gpro31) accept an optional temperature (range 02). Higher values make the delivery more varied and expressive; omit it to use the model default. temperature is ignored for non-Gemini voices.

curl -X POST 'https://sexyvoice.ai/api/v1/speech' \
  -H 'Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gpro",
    "voice": "achernar",
    "input": "Hello from SexyVoice API",
    "style": "calm",
    "seed": 1234,
    "temperature": 1.2
  }'

Using G31 (Gemini 3.1 Flash TTS)

Gemini 3.1 supports 70+ languages and inline audio expression tags like [cheerfully], [whispering], and [pause]. Use gpro31 only with voices returned by /api/v1/voices as model: "gpro31"; gpro voices stay on Gemini 2.5 Pro.

curl -X POST 'https://sexyvoice.ai/api/v1/speech' \
  -H 'Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gpro31",
    "voice": "achernar",
    "input": "[cheerfully] Hello from Gemini 3.1! [pause] This supports 70+ languages.",
    "seed": 1234
  }'

Using a voiceId

Use voiceId when you want a stable identifier from GET /api/v1/voices or when the same voice name exists for more than one model. Do not include voice or model in the same request.

curl -X POST 'https://sexyvoice.ai/api/v1/speech' \
  -H 'Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "voiceId": "390f5864-111b-4795-81ea-7026a1e64cfc",
    "input": "Hello from a voice ID",
    "style": "calm"
  }'

Using Grok (xAI)

Grok voices support both MP3 (default) and WAV output via response_format. They also accept an optional speed multiplier (range 0.71.5, per the xAI TTS API) to slow down or speed up delivery; omit it for the default 1.0. speed is ignored for non-Grok voices.

curl -X POST 'https://sexyvoice.ai/api/v1/speech' \
  -H 'Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "xai",
    "voice": "eve",
    "input": "Hello from Grok! [laugh] This is exciting.",
    "response_format": "mp3",
    "speed": 1.2
  }'

Successful response includes:

  • url: generated audio URL
  • credits_used
  • credits_remaining
  • usage

3. Check Balance

curl -X GET 'https://sexyvoice.ai/api/v1/billing' \
  -H 'Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

Response includes:

  • creditsLeft
  • lastUpdated
  • userId
  • lastBillingTransaction

4. Handle Errors + Debugging

  • Every response includes a request-id header. Log it in your app.
  • On failures, inspect error.code and error.type.
  • See Error Codes for the full list.

Useful Endpoints

  • POST /api/v1/speech
  • GET /api/v1/billing
  • GET /api/v1/voices
  • GET /api/v1/models
  • GET /api/v1/openapi

Next Steps

  • Read full API Reference
  • Browse Grok Voices & Speech Tags for the full tag reference
  • Retry transient 503 provider_unavailable responses with backoff, and treat 429 provider_quota_exceeded as temporary provider quota exhaustion
  • Store request-id with your logs for support and tracing

On this page