AI Gateway
Models & modalities
Discover models and use embeddings, speech and transcription.
GET https://cloud.roar-ai.com/v1/models returns the catalogue your key can use. Each entry lists its roar_modalities — the request types it serves:
| Modality | Endpoint |
|---|---|
chat | POST /v1/chat/completions |
embedding | POST /v1/embeddings |
tts | POST /v1/audio/speech (text → audio bytes) |
stt | POST /v1/audio/transcriptions (multipart audio upload, max 50MB) |
Embeddings
emb = client.embeddings.create(
model="text-embed-large",
input=["first passage", "second passage"],
)
print(len(emb.data[0].embedding))
Speech
curl https://cloud.roar-ai.com/v1/audio/speech \
-H "Authorization: Bearer roar_live_..." \
-H "Content-Type: application/json" \
-d '{"model": "tts-fast", "input": "Hello there", "voice": "alloy"}' \
--output hello.mp3
curl https://cloud.roar-ai.com/v1/audio/transcriptions \
-H "Authorization: Bearer roar_live_..." \
-F file=@meeting.mp3 \
-F model=whisper-fast
Routing
You never pick a server — the gateway routes each request to the best available backend for the model under your account's routing policy (lowest cost, fastest, or most private), and fails over automatically when a backend degrades. Change the policy in Settings → Model routing.