Speech

Perceptron provides an OpenAI-compatible text-to-speech API. Speech models accept text input and return synthesized audio. You pay using credits purchased with USDT.

The API is OpenAI-compatible. You can use the OpenAI SDK pointed at Perceptron as a drop-in replacement for the OpenAI speech API.

Base URL

https://perceptron.cloud/api/v1

Authentication

Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Generate an API key from the Keys page in the Perceptron app.

Available Models

curl https://perceptron.cloud/api/tts/models

Speech (text-to-speech) models (the audio output modality) are listed separately from chat models. Query GET /api/tts/models for the current list and pricing.

Speech

POST /api/v1/audio/speech  ·  /api/tts/speech

Synthesize speech from text. Returns raw audio bytes.

Request

curl https://perceptron.cloud/api/v1/audio/speech \
  -H "Authorization: Bearer $PERCEPTRON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "hexgrad/kokoro-82m", "input": "Hello, world.", "voice": "af_heart", "response_format": "mp3"}' \
  --output speech.mp3
Field Type Required Description
model string yes TTS model ID from GET /api/tts/models
input string yes The text to synthesize
voice string no Voice id (provider-specific, e.g. af_heart)
response_format string no Audio format: mp3 (default), wav, opus, ogg, flac

Response

Raw audio bytes with Content-Type: audio/mpeg (or audio/wav, audio/ogg per response_format).

See the full reference at API Reference.

Pricing

Speech synthesis is billed from your credits balance. See Billing for more details.