OpenAI compatibility
The Moses speech APIs answer OpenAI's audio endpoints. Keep your OpenAI SDK or framework service, change the base URL and the key, and the audio is made in Germany with nothing stored. Keys: API console. Machine-readable: openapi.json.
Base URLs
| API | Base URL | Endpoint |
|---|---|---|
| Text to speech | https://moses-ai.com/tts/v1 | POST /audio/speech |
| Speech to text | https://moses-ai.com/stt/v1 | POST /audio/transcriptions |
Authentication: Authorization: Bearer mk_…. For streaming (an LLM's tokens to speech as they arrive, live transcription) use the realtime WebSockets with @mosesai/tts and @mosesai/stt: JavaScript example.
Text to speech: what is accepted
| Field | Moses |
|---|---|
input | 1 to 20,000 characters (OpenAI: 4,096). |
model | Any value is accepted and ignored (tts-1, gpt-4o-mini-tts, …). |
voice | Moses voice ids (alba, german/…, clone:my-voice; list: GET /tts/v1/voices). OpenAI's names work too and map to built-in voices (table below). With a non-English language they map to that language's default voice. |
response_format | wav (default), pcm (16-bit mono 24 kHz), mp3 (64 kbit/s), opus (in Ogg), flac. Not offered: aac. Note: OpenAI's default is mp3, Moses' is wav; send the format you want. |
speed | 0.25 to 4.0 accepted, applied within 0.5 to 2.0. |
stream_format | audio and sse are accepted; the audio always comes as audio (streamed while it is generated), not as events. Clients that ask for SSE read it as raw audio. |
instructions | Ignored. |
| Moses extras | language, normalize (numbers, dates, currencies as words), markup (SSML subset), pauses, lexicon. |
OpenAI voice names
For clients that only allow OpenAI's names (Pipecat's OpenAI service checks them), each name picks a Moses voice.
| OpenAI name | Moses voice | OpenAI name | Moses voice |
|---|---|---|---|
alloy | alba | onyx | javert |
ash | marius | nova | vera |
ballad | jean | sage | eve |
coral | anna | shimmer | jane |
echo | charles | verse | paul |
fable | george | marin | mary |
cedar | michael |
Speech to text: what is accepted
| Field | Moses |
|---|---|
file | Audio file up to 25 MB (multipart, as with OpenAI). |
model | Any value is accepted and ignored (whisper-1, gpt-4o-mini-transcribe, …). |
language | Two-letter code, or auto (default). |
response_format | json (default), text, verbose_json, srt, vtt. |
timestamp_granularities[] | segment, word. |
prompt, temperature | Ignored. |
OpenAI SDK
from openai import OpenAI
tts = OpenAI(api_key=MOSES_API_KEY, base_url="https://moses-ai.com/tts/v1")
with tts.audio.speech.with_streaming_response.create(
model="tts-1", voice="alba", input="Hello from Moses!", response_format="mp3") as r:
r.stream_to_file("hello.mp3")
stt = OpenAI(api_key=MOSES_API_KEY, base_url="https://moses-ai.com/stt/v1")
text = stt.audio.transcriptions.create(model="whisper-1", file=open("hello.mp3", "rb"), language="en").text
import OpenAI from "openai";
const tts = new OpenAI({ apiKey: process.env.MOSES_API_KEY, baseURL: "https://moses-ai.com/tts/v1" });
const audio = await tts.audio.speech.create({ model: "tts-1", voice: "alba", input: "Hello!", response_format: "mp3" });
Pipecat
For voice agents, use the plugin instead: pipecat-moses streams over the realtime WebSockets (faster finals, every Moses voice and language). Pipecat's OpenAI services with the Moses base URLs work without it. They use the HTTP endpoints, one request per sentence; use a server key. Pipecat only accepts OpenAI's voice names, so pick one from the table; its TTS service sends no language, so it speaks English.
from pipecat.services.openai.tts import OpenAITTSService
from pipecat.services.openai.stt import OpenAISTTService
tts = OpenAITTSService(api_key=MOSES_API_KEY, base_url="https://moses-ai.com/tts/v1",
settings=OpenAITTSService.Settings(voice="nova"))
stt = OpenAISTTService(api_key=MOSES_API_KEY, base_url="https://moses-ai.com/stt/v1")
LiveKit Agents
For voice agents, use the plugin instead: livekit-plugins-moses streams over the realtime WebSockets. LiveKit's OpenAI plugin with the Moses base URLs works without it. Its TTS asks for SSE and reads the plain audio Moses sends instead; any Moses voice id works, and so does its default format, mp3. Its STT here is the file endpoint, so LiveKit cuts the audio into utterances with its VAD.
from livekit.plugins import openai
tts = openai.TTS(base_url="https://moses-ai.com/tts/v1", api_key=MOSES_API_KEY, voice="alba", response_format="pcm")
stt = openai.STT(base_url="https://moses-ai.com/stt/v1", api_key=MOSES_API_KEY, model="whisper-1", language="en")
Limits
- Per account: at most 60 requests and sessions started a minute across all your keys and the studio (standard). We raise it on request: ask via Support.
- At once: a few requests and sessions of each kind at the same time per account (see
GET /tts/v1/stats). - Per key: limits you set yourself in the console (characters or minutes a day, requests at once or a minute).
- Per IP address: keys start with 50 requests a minute per address, so a key inside an app or website can't be drained from one place.
- Credit and daily spending limit: prepaid credit; the daily limit renews at midnight UTC.
Server keys
A key used only from your own servers (a voice agent on Pipecat or LiveKit, a back end) sends everything from a few addresses, so per-address limits would get in the way. Tick Server key when you create or change the key in the console: it has no per-IP limits; your account's and the key's own limits still apply. Never put a server key into an app or a website.
Errors
Every error answer has a message, a code and, where waiting helps, Retry-After (header, and retry_after in seconds). The error object has OpenAI's shape, so OpenAI SDKs show the message.
HTTP/1.1 429 Too Many Requests
Retry-After: 23
{"detail": "at most 60 requests a minute for your account …", "code": "account_limit", "retry_after": 23,
"error": {"message": "at most 60 requests a minute for your account …", "type": "rate_limit_error", "code": "account_limit"}}
| Code | Status | Meaning |
|---|---|---|
account_limit | 429 | Your account's requests a minute |
key_limit | 429 | A limit you set on the key |
ip_limit | 429 | The key's limit per IP address |
too_many_at_once | 429 | Too many requests at the same time |
daily_limit, daily_spend | 429 | A daily allowance or the daily spending limit (renews at midnight UTC) |
no_credit | 402 | Top up in the console |
unauthorized, wrong_scope, referer, blocked | 401 / 403 | Key missing or wrong, key not for this API, wrong website, account blocked |
bad_request, bad_format, too_large | 400 / 413 | Something in the request |
unavailable, busy | 503 / 429 | Busy right now: retry after Retry-After |
Realtime WebSockets send the same codes in their error event, with retry_after where it applies.