Skip to main content
Models like GPT-4o can handle audio modalities. With Sudo, you can call OpenAI-compatible audio models to produce audio output and optionally send audio input alongside text.
Only certain providers currently support audio input/output with Chat Completions in this format (notably OpenAI). Before using audio, confirm your chosen model provider’s API accepts modalities and input_audio as shown here, and adjust parameters accordingly.

Audio Output from Text

Generate spoken audio from a text prompt using an audio-capable model.
TypeScript

Audio Input + Text

Send user audio together with a text prompt. Encode your audio file as base64 and include it using type: "input_audio".
TypeScript

Tips

  • Prefer lossless or high-quality input formats for best transcription/understanding.
  • Keep requests small; very long audio can increase latency and cost.
  • Verify your chosen model supports audio input/output and the requested format.