Upload a file
Uploads a file to be referenced in future API calls. The file is stored under the workspace of the authenticating API key. Maximum file size: 100 MB; empty files are rejected. The file type is determined from the file contents — not the filename or the declared content type — and must be a PDF, a PNG/JPEG/GIF/WebP image, a DOCX/XLSX/PPTX document, an MP3/WAV/FLAC/OGG audio file, or UTF-8 text. Text is reported by its structure as application/json, application/x-ndjson, text/csv, text/markdown, or text/plain.
Authorizations
API key as bearer token in Authorization header
Query Parameters
Workspace to scope the request to. Defaults to the caller’s default workspace.
"a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7"
Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
openai, anthropic "openai"
Body
Response
The uploaded file metadata.
- Option 1
- Option 2
- Option 3
A stored file. The shape is negotiated per request — see the endpoint description.