Skip to main content
GET
/
files
List files
curl --request GET \
  --url https://openrouter.ai/api/v1/files \
  --header 'Authorization: Bearer <token>'
{
  "cursor": null,
  "data": [
    {
      "created_at": "2025-01-01T00:00:00Z",
      "downloadable": false,
      "filename": "document.pdf",
      "id": "file_011CNha8iCJcU1wXNR6q4V8w",
      "mime_type": "application/pdf",
      "size_bytes": 1024000,
      "type": "file"
    }
  ],
  "first_id": "file_011CNha8iCJcU1wXNR6q4V8w",
  "has_more": false,
  "last_id": "file_011CNha8iCJcU1wXNR6q4V8w"
}

Authorizations

Authorization
string
header
required

API key as bearer token in Authorization header

Query Parameters

limit
integer

Maximum number of files to return (1–1000).

Required range: 1 <= x <= 1000
Example:

100

cursor
string

Opaque pagination cursor from a previous response.

Example:

"eyJjdXJzb3IiOiJmaWxlXzAxMUNOaGE4aUNKY1Uxd1hOUjZxNFY4dyJ9"

workspace_id
string<uuid>

Workspace to scope the request to. Defaults to the caller’s default workspace.

Example:

"a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7"

Response

A page of files.

A page of files belonging to the requesting workspace.

cursor
string | null
required

Opaque cursor for the next page; null when there are no more results.

data
object[]
required
first_id
string | null
required
has_more
boolean
required
last_id
string | null
required