Before you start
Create an API key in the dashboard withchat:completions for Chat Completions or messages:create for Messages. 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:
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.
.py file.
Messages accepts an optional anthropic-version header. If supplied, it must be one valid calendar date in YYYY-MM-DD form. It is a compatibility hint and does not change the supported features. The SDK supplies its version header automatically.
Save a PNG image as image.png in the directory where you run an example. The cURL examples use Python to encode that file and generate JSON, so they also need Python installed. They do not need a Python SDK.
Chat Completions
CallPOST /v1/chat/completions with chat:completions. Put an image_url content part in a user message. For a local file, use a base64 data URL with the image’s MIME type.
choices[0].message.content. detail is optional and accepts auto, low, or high.
You can also set image_url.url to a public absolute HTTP or HTTPS URL. Its path must end in .gif, .jpeg, .jpg, .png, or .webp. Do not include URL credentials. Use a URL the service can retrieve; a local path or a URL requiring your browser’s login is not an uploaded image.
Messages
CallPOST /v1/messages with messages:create. Put an image block in a user message. For a local PNG, use source.type: "base64", media_type: "image/png", and the encoded bytes in data. Do not put a data: prefix inside Messages source.data.
content. Messages also accepts an image source with type: "url" and a url field containing a public HTTP or HTTPS image URL with one of the supported file extensions. A URL source is supported; it is not restricted to base64.
Formats and limits
The MIME type must match the file. For JPEG, use
image/jpeg; for GIF or WebP, use image/gif or image/webp. Adapt the filename and MIME type together when changing an example.
Base64 adds roughly one third to the file size. The encoded data, JSON, and conversation must all fit within the request-body limit. Local-file paths are read by the example application; they are not sent as filesystem paths for OverControl to open.
Lume Omni has a 400,000-token context window and up to 32,768 output tokens. Both APIs cap the output budget to the model maximum and estimated remaining context. Messages requires max_tokens; Chat accepts one output-budget parameter and defaults to the model maximum. Images and text share the request’s context. These are API limits; Chat app attachments have their own limits.
Usage and common errors
Image requests consume model usage. Read token counts fromusage; Pricing explains model rates and included usage. Requests reserve estimated usage before execution and release unused reserved usage afterward. Set an explicit output budget for a short description.
A remote image can still fail during retrieval or processing. Do not assume a syntactically valid URL guarantees the image is accessible. Keep
X-Request-Id for support; Messages also returns request-id.
Next
Audio understanding
Ask Lume Omni about an MP3 or WAV clip.
Models
Compare input capabilities and output limits.

