POST /openai/files uploads a local file and returns a file object with a signed url. Pass that url in any *_url content part instead of a base64 data URI. The route needs an API key: an anonymous call returns 401.
The upload follows the OpenAI Files request shape: a multipart form with file and an optional purpose. The reply adds url, which the OpenAI Files API does not return.
invoice.pdf, then reads it page by page with paddleocr/pp-ocrv6 through the returned url.
The file object
Use the url
- Chat Completions: in an
image_url,video_url,document_url, orfile_urlpart. - Embeddings: in any
*_urlpart the model accepts. - Transcriptions: in the
urlform field ofPOST /openai/audio/transcriptions.
url expires, call GET /openai/files/{file_id} with the same key for a new one.
url.
Access and cost
An upload is not billed. The call that reads the
url bills as usual. An MCP client with no API key gets an upload token from create_upload_token. The token is valid for one upload.
Errors
Next steps
Supported Inputs
Content part types and per-modality limits.
MCP Tools
create_upload_token for agents with no API key.