Before you start
Create an API key in the dashboard withfiles:write, files:read, and files:delete, plus chat:completions for Chat or messages:create for Messages. If the key has a model allowlist, include lume-omni. Keep the key on your server and set it in your shell:
Authorization: Bearer or x-api-key. Sending both with values returns HTTP 401. The SDK examples configure authentication for you.
Install the SDKs for the examples you use:
.py file. Save Node.js examples as .mjs files for import and top-level await.
Save a PDF as notes.pdf in the directory where you run an example. The cURL examples use Python to read the upload response and build request JSON; they do not need an SDK.
Chat Completions: upload, ask, and delete
Usehttps://api.overcontrolgroup.com/v1 as the OpenAI SDK base URL. A user message contains a text question and a file part with file.file_id. The upload uses the same account and key as inference.
choices[0].message.content. finish_reason: "length" means it reached the output budget and may be incomplete. The examples delete the stored file after the answer; keep it longer if you need to reference it again.
Messages: upload, ask, and delete
Uploads use the same/v1/files API. For inference, call POST /v1/messages and send a document block with source: {"type":"file","file_id":"..."}. The Anthropic SDK base URL omits /v1 because the SDK adds /v1/messages.
The Python example uses the OpenAI SDK for Files and the Anthropic SDK for Messages, with the same OverControl key.
content text blocks. Messages requires a positive max_tokens. anthropic-version is optional; if you send it, use a single valid YYYY-MM-DD calendar date. The SDK supplies its own version hint, and SDK versions may authenticate using either supported key header.
A file_id requires files:read on either inference API. Upload needs files:write and deletion needs files:delete. These permissions are separate from chat:completions or messages:create.
Stop a cURL walkthrough if a command fails. If an upload already succeeded, clean it up with its returned ID or let the one-hour expiry pass. Remove the local JSON files separately if you no longer need them.
Send a PDF inline
Inline PDF input does not need Files scopes because it does not create a reusable Files API object. You still need the inference scope and access to Lume Omni..pdf filename, as shown, or a data:application/pdf;base64,... URL in file_data. Send file_data or file_id, not both.
Messages accepts base64 PDF bytes, a stored file source, or a public HTTP/HTTPS source with type: "url" and a url ending in .pdf. PDF sources are different from web fetch: use document input to ask Lume Omni about a PDF. Enabling document citations on a PDF block is not currently supported; omit that setting or use {"enabled":false}.
Limits and reuse
File-reference counts apply across the submitted conversation, including repeated references. Base64 adds roughly one third to the size of inline bytes. The context and output limits still apply after a document is supplied; a file ID is not a way to bypass them. Both APIs reduce the output budget to the model maximum and estimated remaining context space. Chat accepts one of
max_tokens and max_completion_tokens, defaulting to the model maximum when neither is supplied.
Uploaded files belong to the account. A key from the same account can use a file if it has files:read, the inference scope, and model access. Another account’s file ID is unavailable. A file remains stored until deletion or its configured expiry; it does not disappear when inference finishes.
For another question, submit the relevant earlier user and assistant messages plus the new question. Keep the PDF reference in the conversation when the next answer needs the document, and keep the stored file available. Each request can process the PDF again and consume model usage.
Usage and common errors
Files API uploads and management currently do not spend inference allowance. Requests that process a PDF consume model usage. OverControl reserves estimated usage before inference and releases unused reserved usage afterward. Pricing explains model rates and allowances.
Files endpoints always use the Chat-style error object. Messages inference uses its native
type: "error" body without error.code. Chat inference includes error.code, such as file_not_found or insufficient_credits. Keep X-Request-Id; Messages inference also returns request-id and an error-body request_id.
Next
Managing files
List, inspect, download, and delete stored PDFs.
Structured outputs
Extract document information into a supplied JSON schema.

