Skip to main content
Mesh API supports audio through POST /v1/chat/completions. Use this page for:
  • audio input with input_audio
  • audio output with modalities and audio

Audio input

Send audio as a content part inside a chat message.
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.
The same request shape is available through all four SDKs by setting chat-completions fields for 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.
Optional parameters: 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/models to find models that accept or produce audio.
  • Keep payload sizes reasonable, especially for browser-based clients.