POST /v1/chat/completions.
Use this page for:
- audio input with
input_audio - audio output with
modalitiesandaudio
Audio input
Send audio as a content part inside a chat message.- curl
- Node.js SDK
- Python SDK
- Go SDK
- Java SDK
input_audio takes base64-encoded bytes in data, or a remote url on BytePlus
models, plus a format (wav, mp3, aiff, aac, ogg, flac, m4a, pcm16
or pcm24). Keep inline audio to about 7 MB.
Audio output
Request text and audio together when the model supports audio output.modalities and audio.
Translate audio to English
POST /v1/audio/translations accepts audio in any language and returns the speech translated to English. It returns the same TranscriptionResponse (with a .text field) as transcription.
POST /v1/audio/transcriptions/translate is a legacy alias of this endpoint with the same behaviour. It takes model, file, prompt, tags and safety_identifier, but not response_format or temperature. Use /v1/audio/translations and always pass model. Check GET /v1/models for models that support translation.- Python SDK
- Node.js SDK
- Go SDK
prompt (context hint for the model), response_format (json, text, or verbose_json), and temperature (0–2).
SDK coverage
- Node:
client.chat.completions.create(...) - Python:
client.chat.completions.create(...) - Go:
client.Chat.Completions.Create(...) - Java:
client.chat().completions().create(...)
Notes
- Inline audio payloads are base64 encoded in the request body. BytePlus models also take a remote
url. - Check
GET /v1/modelsto find models that accept or produce audio. - Keep payload sizes reasonable, especially for browser-based clients.