Skip to main content
Send an MP3 or WAV clip to Lume Omni and receive a text answer. Use audio input to summarize a recording, extract spoken information, or ask a focused question about the clip. Audio input is available on Chat Completions only; the API does not generate audio.

Before you start

Create an API key in the dashboard with chat:completions for Chat Completions. If your key has a model allowlist, include lume-omni. Keep the key on your server and set it in the shell where you run the examples:
Send one authentication header per request: Authorization: Bearer or x-api-key. Supplying both with values returns HTTP 401. For SDK examples, install the client you use. cURL examples do not need an SDK.
Run Python examples from a .py file. Save an MP3 clip as clip.mp3 in the directory where you run an example. The cURL example uses Python to encode the clip and generate JSON, so it also needs Python installed. It does not need the Python SDK.

Send an audio clip

Call POST /v1/chat/completions with chat:completions. Add an input_audio part to a user message alongside the question. data contains base64 bytes without a data: prefix, and format is mp3 or wav.
The answer is in choices[0].message.content. To use a WAV file, change the local filename and input_audio.format to wav. Do not send a local path or remote URL in data; encode the file’s bytes as shown.

Limits

Base64 adds roughly one third to the file size. A clip below 25 MiB can still exceed the body limit when combined with other content, encoded data, and JSON. Reduce the clip or split the task when the request is too large. Use max_tokens or max_completion_tokens, but not both. Chat defaults to the model’s maximum output if neither is supplied. A requested output budget is reduced to the model maximum and estimated remaining context space. The example uses 256 tokens for a short answer.

Usage and common errors

Audio requests consume model usage. Read usage.prompt_tokens and usage.completion_tokens in the response; Pricing covers model rates and included usage. Requests reserve estimated usage before running and release unused reserved usage afterward. Messages does not accept audio input. An audio block on that endpoint returns HTTP 400. A response ending with finish_reason: "length" reached its output budget and may be incomplete. Keep X-Request-Id when reporting a failure.

Next

Image understanding

Ask Lume Omni about visual content.

Generate text

Build a conversation with any Lume model.