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

Using gpro model

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
  }'

Using Grok (xAI)

Grok voices support both MP3 (default) and WAV output via response_format.

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"
  }'

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