List files
Changed onLists files belonging to the workspace of the authenticating API key.
Request
- Base URL: https://openrouter.ai/api/v1
- URL: https://openrouter.ai/api/v1/files
- Auth: HTTP bearer
Query parameters
Maximum number of files to return (1–1000).
Opaque pagination cursor from a previous response.
Workspace to scope the request to. Defaults to the caller’s default workspace.
Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
OpenAI-style forward cursor: the id to list after.
Anthropic-style forward cursor: the id to list after.
Anthropic-style reverse cursor. Not supported by OpenRouter storage.
Sort direction. Only asc is supported by OpenRouter storage.
Response
A page of files.
Example response
{
"_shape": "openrouter",
"cursor": null,
"data": [],
"first_id": null,
"has_more": false,
"last_id": null
}Changes
- breaking
added to the response body
oneOflist for the response status - breaking
the response's body type changed from
objectto no type for status - breaking
removed the required property
from the response with the status - breaking
removed the required property
from the response with the status - breaking
removed the required property
from the response with the status - breaking
removed the required property
from the response with the status - breaking
removed the required property
from the response with the status - info
added the new optional
queryrequest parameterafter - info
added the new optional
queryrequest parameterafter_id - info
added the new optional
queryrequest parameterbefore_id - info
added the new optional
queryrequest parameterorder - info
added the new optional
queryrequest parameterprovider - info
added response discriminator for the response status
- info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the non-success response with the status
- breaking