Text-to-Audio (HTTP)

Generate speech from text with a single HTTP request.
curl --request POST \
  --url https://geoff.ai/api/v1/t2a \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "text": "Hello, welcome to Geoff AI. Let me show you what I can do.",
    "voice_id": "default",
    "format": "mp3"
  }' \
  --output speech.mp3

Async Speech Generation

For longer content, use the async endpoint:
import requests
import time

# 1. Create the task
response = requests.post(
    "https://geoff.ai/api/v1/t2a/async",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "text": "Your long-form content here...",
        "voice_id": "default",
        "format": "mp3",
    },
)
task_id = response.json()["data"]["task_id"]

# 2. Poll for completion
while True:
    status = requests.get(
        f"https://geoff.ai/api/v1/t2a/async/{task_id}",
        headers={"Authorization": "Bearer YOUR_API_KEY"},
    ).json()

    if status["data"]["status"] == "completed":
        audio_url = status["data"]["audio_url"]
        break
    time.sleep(2)

print(f"Audio ready: {audio_url}")

WebSocket Streaming

For real-time audio streaming, use the WebSocket endpoint. See the T2A WebSocket API reference.