OpenAI Audio API Integration Guide & Examples
| Method | Path | Use |
|---|---|---|
POST | /v1/audio/speech | Text to speech |
POST | /v1/audio/transcriptions | Speech to text |
POST | /v1/audio/translations | Audio translation |
Whether a model offers an endpoint follows the protocols shown in the model marketplace; otherwise the gateway answers 400 model_protocol_not_offered.
Speech
The request is JSON (OpenAI {model, input, voice}) and the response body is binary audio.
curl https://api.modelgo.ai/v1/audio/speech \
-H "Authorization: Bearer $MODELGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"<openai-speech-model>","input":"Hello from ModelGo.","voice":"alloy"}' \
--output speech.mp3MiniMax speech models
speech-2.8-hd / speech-2.8-turbo can also be called on this endpoint the same way. Note:
voicetakes a MiniMax voice ID (e.g.female-shaonv), not an OpenAI name such asalloy;response_formatsupportsmp3(default) /pcm/flac/wav;opus/aacreturn400and are not billed;speedmaps to MiniMax's speech-rate setting.
For MiniMax-native fields (voice mix, subtitles, hex JSON, SSE), see MiniMax Audio Inbound Protocol.
Transcriptions
Upload the audio file and model as multipart/form-data; the response is JSON with the recognized text.
curl https://api.modelgo.ai/v1/audio/transcriptions \
-H "Authorization: Bearer $MODELGO_API_KEY" \
-F "model=<model>" \
-F "file=@./speech.m4a"Translations
Uploads follow the same shape as transcriptions and return translated text in JSON.
curl https://api.modelgo.ai/v1/audio/translations \
-H "Authorization: Bearer $MODELGO_API_KEY" \
-F "model=<model>" \
-F "file=@./speech.m4a"For transcriptions and translations the whole request body, audio file included, is capped at 10 MiB; a larger one returns 400, so compress or split longer audio first.