Developers
Parexa REST API for text to speech and speech to text.
Authentication
Every request needs a key created on the API Keys page. Send it as a bearer token:
Authorization: Bearer px_live_...
Base URL: https://parexa.xyz (local: http://localhost:3000)
POST
/api/v1/audio/speechtext → mp3Synthesize speech. Returns raw audio (default audio/mpeg).
| Field | Type | Description |
|---|---|---|
| text | string · required | Up to 4,000 characters. |
| voice | string | Edge neural voice, e.g. en-IN-PrabhatNeural. |
| rate | number 0.5–2 | Speaking speed. Default 1. |
| pitch | number 0.5–2 | Voice pitch. Default 1. |
| format | string | mp3-48k (default), mp3-96k, opus-24k. |
curl https://parexa.xyz/api/v1/audio/speech \
-H "Authorization: Bearer $PAREXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Hello from Parexa","voice":"en-US-AriaNeural"}' \
--output speech.mp3const res = await fetch("https://parexa.xyz/api/v1/audio/speech", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PAREXA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ text: "Hello from Parexa", voice: "en-US-AriaNeural" }),
});
const audio = Buffer.from(await res.arrayBuffer());
POST
/api/v1/audio/transcriptionsaudio → textTranscribe an audio file. Send multipart/form-data with the recording in the file field (max 25 MB).
| Field | Type | Description |
|---|---|---|
| file | file · required | mp3, wav, m4a, ogg, webm. Max 25 MB. |
| language | string | Optional ISO-639-1 hint, e.g. hi. |
| response_format | json | text | Default json. |
curl https://parexa.xyz/api/v1/audio/transcriptions \ -H "Authorization: Bearer $PAREXA_API_KEY" \ -F "[email protected]" \ -F "language=en"
{
"text": "Hello from Parexa",
"provider": "cloudflare",
"language": "en"
}GET
/api/v1/voicesvoice catalogList available voices. Filter with ?locale=en-IN or ?search=aria.
curl "https://parexa.xyz/api/v1/voices?locale=en-IN" \ -H "Authorization: Bearer $PAREXA_API_KEY"
Limits & errors
- · 60 requests per minute per key
- · TTS text up to 4,000 characters per request
- · Audio uploads up to 25 MB
| Status | Meaning |
|---|---|
| 401 | Missing or invalid API key. |
| 400 / 413 / 415 | Bad input, too large, unsupported audio type. |
| 422 | No speech detected in the audio. |
| 429 | Rate limit exceeded. |
| 502 / 503 | Upstream engine failed or not configured. |
Errors return { "error": { "message", "type" } }.