Other clients

Raya API drop-in

Raya's own REST, SSE and voices APIs through the cache: keep your Raya client, change the URL and key.

Endpoints#

Raya’s API, mirrored under https://api.ttscacherouter.dev/raya. Requests, responses, status codes and error bodies are Raya’s own. Send your router API key in X-API-Key; your request is forwarded to Raya as you sent it, with the Raya key stored under Provider keys.

  • POST /raya/v1/text-to-speech/stream: Raya’s server-sent events. A reply from the cache sends the same chunk events, without step_time, then done.
  • POST /raya/v1/text-to-speech: the whole clip in the requested codec, with Raya’s headers.
  • GET /raya/v1/voices: Raya’s voice list, never cached.

For a LiveKit agent, see Raya with LiveKit. Each synthesis request is cached as a whole: the same body again replays the same audio. Any other path under /raya answers 404.

curl -N https://api.ttscacherouter.dev/raya/v1/text-to-speech/stream \  -H "X-API-Key: $TTS_CACHE_ROUTER_API_KEY" \  -H "Content-Type: application/json" \  -d '{"text": "नमस्ते, मैं प्रिया बोल रही हूँ।", "voice_id": "d6a002d0-230c-49b1-a137-b8a7d564b1ae",       "language": "hi", "model": "standard", "sample_rate": 24000}'

Errors#

A wrong or missing router key gets Raya’s own refusal, HTTP 401. So does an org with no Raya key stored, with a message that links to the dashboard. Errors from Raya, such as a wrong stored Raya key or an unknown voice, reach you as Raya sent them.

HTTP/1.1 401 UnauthorizedWWW-Authenticate: Key realm="bakbak-tts"{"message": "Unauthorized", "request_id": null}