Skip to main content

Audio

Speech-to-text (transcription), text-to-speech, and sound effects.

OpenAI-compatible

The transcription and text-to-speech routes accept the standard OpenAI Audio parameters. Primex differences: authenticate with your prx- key, set model to a Primex model ID, and see Errors & Limits for status codes. Sound effects use the Primex contract below.

Transcription (speech-to-text)​

POST https://gateway.primexos.com/v1/audio/transcriptions

curl https://gateway.primexos.com/v1/audio/transcriptions \
-H "Authorization: Bearer prx-YOUR_KEY" \
-F model="whisper" \
-F file="@meeting.mp3"

Speech recognition may be billed by audio minute or by reported tokens, depending on the selected live model. POST /v1/audio/translations accepts the same multipart shape when you need speech translated to English.

For reusable temporary input, use the Primex temporary Files API with purpose AUDIO_INPUT, then send the finalized file_id in a JSON request to the same transcription or translation endpoint. Playground production examples use this shared account-scoped flow.

Text-to-speech​

POST https://gateway.primexos.com/v1/audio/speech

curl https://gateway.primexos.com/v1/audio/speech \
-H "Authorization: Bearer prx-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "eleven-multilingual-v2",
"input": "Welcome to Primex.",
"voice": "alloy",
"response_format": "mp3"
}' --output speech.mp3

ElevenLabs speech models available through this endpoint include Multilingual v2, v4, v4 Turbo, v3, v3 Conversational, Flash v2.5, and Flash v2. The live catalogue shows which models are enabled. Select a voice from each model's published Playground choices: Primex exposes 22 verified premade voices, including Rachel (alloy), George (george), Bella (bella), and Adam (adam). Output is MP3. Optional per-request voice settings are stability (0–1) and, where the model allows it, similarity_boost (0–1), speed (0.7–1.2), style (0–1), and use_speaker_boost (boolean). v4 and v4 Turbo allow stability and similarity; v3 and v3 Conversational allow stability; Multilingual v2 and both Flash models allow all five. Unsupported combinations return 400 unsupported_parameter. Voice instructions remain unsupported on ElevenLabs models. Omitting all settings keeps the saved/default voice behavior. The same endpoint serves every enabled audio model in the live catalogue, which shows its billing unit and customer price.

Sound effects​

POST https://gateway.primexos.com/v1/audio/sound-effects

Generate one MP3 sound effect from a text prompt. Specify a duration from 0.5 to 30 seconds in half-second steps. Optional loop (boolean) requests a smooth loop, and prompt_influence (0–1, supplier default 0.3) controls how closely the output follows the prompt. Automatic duration remains unsupported so the requested duration bounds cost before generation.

curl https://gateway.primexos.com/v1/audio/sound-effects \
-H "Authorization: Bearer prx-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "eleven-sound-effects-v2",
"prompt": "A soft click with a short reverb tail",
"duration_seconds": 1,
"loop": false,
"prompt_influence": 0.3
}' --output sound-effect.mp3

The live catalogue shows availability and the customer price per generated second. The response's X-Primex-Cost-USD header reports the settled customer charge.