Files

List files

Lists files belonging to the workspace of the authenticating API key.

get/files

Query parameters

limitinteger

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

Example:100

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

cursorstring

Opaque pagination cursor from a previous response.

Example:eyJjdXJzb3IiOiJvcl9maWxlXzAxMUNOaGE4aUNKY1Uxd1hOUjZxNFY4dyJ9

Opaque pagination cursor from a previous response.

workspace_idstring uuid

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

Example:a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7

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

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

Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.

afterstring

OpenAI-style forward cursor: the id to list after.

Example:or_file_011CNha8iCJcU1wXNR6q4V8w

OpenAI-style forward cursor: the id to list after.

after_idstring

Anthropic-style forward cursor: the id to list after.

Example:or_file_011CNha8iCJcU1wXNR6q4V8w

Anthropic-style forward cursor: the id to list after.

before_idstring

Anthropic-style reverse cursor. Not supported by OpenRouter storage.

Example:or_file_011CNha8iCJcU1wXNR6q4V8w

Anthropic-style reverse cursor. Not supported by OpenRouter storage.

order'asc' | 'desc'

Sort direction. Only asc is supported by OpenRouter storage.

Example:asc

Sort direction. Only asc is supported by OpenRouter storage.

Response

A page of files.

OR
OR

Example response

{
  "_shape": "openrouter",
  "cursor": null,
  "data": [],
  "first_id": null,
  "has_more": false,
  "last_id": null
}

Changes

Changed in 1 of the 303 revisions of this API.79

  • 6968addaaf9779See the full diff
    • ▲

      added to the response body oneOf list for the response status

      response-body-one-of-added

    • ▲

      the response's body type changed from object to no type for status

      response-body-type-changed

    • ▲

      removed the required property from the response with the status

      response-required-property-removed

    • ▲

      removed the required property from the response with the status

      response-required-property-removed

    • ▲

      removed the required property from the response with the status

      response-required-property-removed

    • ▲

      removed the required property from the response with the status

      response-required-property-removed

    • ▲

      removed the required property from the response with the status

      response-required-property-removed

    • ○

      added the new optional query request parameter after

      new-optional-request-parameter

    • ○

      added the new optional query request parameter after_id

      new-optional-request-parameter

    • ○

      added the new optional query request parameter before_id

      new-optional-request-parameter

    • ○

      added the new optional query request parameter order

      new-optional-request-parameter

    • ○

      added the new optional query request parameter provider

      new-optional-request-parameter

    • ○

      added response discriminator for the response status

      response-body-discriminator-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog