Audio uses the same API key and model IDs returned by GET /v1/models.
Key points
- Speech is priced by Unicode characters.
- Transcription and translation use multipart/form-data.
- Duration is rounded up to seconds with a one-second minimum.
- Failed requests are not charged.
Generate speech or transcribe audio#
Use the OpenAI-compatible audio routes with an API key. Speech returns an audio file; transcription and translation accept multipart audio and return JSON text.
curl https://api.xpncore.com/v1/audio/speech \
-H "Authorization: Bearer $XPNCORE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"AUDIO_MODEL_ID","input":"Hello from XPNCORE","voice":"alloy","response_format":"wav"}' \
-o speech.wavAudio models are listed by GET /v1/models with audio.speech, audio.transcriptions or audio.translations.
Audio parameters#
Speech accepts JSON with model, input and voice. Upload routes use multipart/form-data with model and file; language and prompt are optional.
curl https://api.xpncore.com/v1/audio/transcriptions \
-H "Authorization: Bearer $XPNCORE_API_KEY" \
-F [email protected] \
-F model=AUDIO_MODEL_ID \
-F language=enAudio pricing#
Speech is charged by Unicode character count using the model’s speech price per million characters. Transcription and translation are charged by measured audio duration, rounded up to whole seconds with a minimum of one second. Failed requests are not charged.
Audio errors#
Use a model that declares the requested audio capability. Invalid multipart fields, unsupported audio formats, insufficient funds and upstream failures return the standard error object; an upstream failure releases the hold.