OpenAI-compatible API
Point any OpenAI SDK at Revolab with only a base_url and API-key swap. Same
keys, same quotas, same metering as the native API — the compatible routes are
thin adapters over the same engine.
Endpoints
POST https://api.revolab.ai/v1/audio/speech
POST https://api.revolab.ai/v1/audio/transcriptionsSet base_url="https://api.revolab.ai/v1" and pass your rvl_live_ key as the
OpenAI API key. Errors use the OpenAI envelope, so SDK exception types
(BadRequestError, RateLimitError, …) behave as expected.
Text to speech
Python
from openai import OpenAI
client = OpenAI(base_url="https://api.revolab.ai/v1", api_key="rvl_live_...")
# Buffered WAV (our default — note: not OpenAI's mp3)
speech = client.audio.speech.create(
model="nada-1.0-flash",
voice="<your-voice-id>",
input="Hello from Revolab.",
response_format="wav",
)
speech.write_to_file("speech.wav")
# True progressive streaming: raw 24 kHz mono s16le PCM
with client.audio.speech.with_streaming_response.create(
model="nada-1.0-flash",
voice="<your-voice-id>",
input="Streaming starts before synthesis finishes.",
response_format="pcm",
) as response:
for chunk in response.iter_bytes():
play(chunk) # first bytes arrive at time-to-first-chunkSpeech to text
Python
from openai import OpenAI
client = OpenAI(base_url="https://api.revolab.ai/v1", api_key="rvl_live_...")
audio_file = open("speech.wav", "rb")
transcript = client.audio.transcriptions.create(
model="aisyah-1.0-flash",
file=audio_file,
)
print(transcript.text)
# stream=True works too (SDK-compatibility emulation: one full-text
# delta + done — latency is unchanged, our engines return the final
# transcript in one shot)
stream = client.audio.transcriptions.create(
model="aisyah-1.0-flash", file=audio_file, stream=True
)
for event in stream:
print(event.type, getattr(event, "delta", getattr(event, "text", "")))Support matrix
| Area | Support |
|---|---|
| TTS output | wav (buffered, default) and pcm (progressively streamed, 24 kHz mono s16le). mp3 / opus / aac / flac are rejected with a clear 400 — no transcoding. Delivery is identical to the native /v1/tts: both return the audio bytes directly. |
| TTS streaming | response_format="pcm" streams chunks as the model produces them; stream_format="sse" additionally emits speech.audio.delta / done events. |
| STT formats | json (default), text, verbose_json. srt / vtt and word timestamps are not available (engines return whole-utterance text). |
| STT streaming | stream=true is an emulation: one transcript.text.delta with the full text, then transcript.text.done. No latency benefit. |
| Models | Revolab names only — nada-1.0-flash-lite / nada-1.0-flash / nada-1.0-pro (TTS), aisyah-1.0-flash / aisyah-1.0-pro (STT). OpenAI names like tts-1 or whisper-1 return a 400 listing valid models. |
| Model listing | client.models.list() works — GET /v1/models returns the active catalog in the OpenAI list shape. |
| Speed | 0.5–2.0 (OpenAI allows 0.25–4.0; out-of-range values are rejected, never silently clamped). |
Voice IDs come from the Voice Library in your dashboard; quotas and error codes match the native API.