Files
Get file metadata
Changed onRetrieves metadata for a single file owned by the requesting workspace.
get/files/{file_id}
Request
- Base URLhttps://openrouter.ai/api/v1
- AuthHTTP bearer
Path parameters
file_id, string required
Example:or_file_011CNha8iCJcU1wXNR6q4V8w
Query parameters
workspace_id, string uuid
Workspace to scope the request to. Defaults to the caller’s default workspace.
Example:a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7
provider, 'openai' | 'anthropic'
Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
Example:openai
Response
The file metadata.
union required
A stored file. The shape is negotiated per request — see the endpoint description.
Open Router File required
A stored file in the OpenRouter superset shape: Anthropic-shaped, plus OpenRouter-only fields.
OR
Open AIFile required
A stored file in OpenAI's Files API shape.
OR
Anthropic File required
A stored file in Anthropic's Files API shape.
Example response
{
"_shape": "openrouter",
"created_at": "2025-01-01T00:00:00Z",
"downloadable": false,
"filename": "document.pdf",
"id": "or_file_011CNha8iCJcU1wXNR6q4V8w",
"mime_type": "application/pdf",
"size_bytes": 1024000,
"type": "file"
}Changes
- breaking
for the
pathrequest parameterfile_id, the minLength was increased from0to1 - breaking
added the pattern
^[\w-]+$to thepathrequest parameterfile_id - warning
for the
pathrequest parameterfile_id, the maxLength was set to256
- breaking