Files

Get file metadata

Retrieves metadata for a single file owned by the requesting workspace.

get/files/{file_id}

Path parameters

file_idstring required
Example:or_file_011CNha8iCJcU1wXNR6q4V8w

Query parameters

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.

Response

The file metadata.

OR
OR

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

Changed in 2 of the 303 revisions of this API.1115

  • ed04e14f275521See the full diff
    • ▲

      for the path request parameter file_id, the minLength was increased from 0 to 1

      request-parameter-min-length-increased

    • ▲

      added the pattern ^[\w-]+$ to the path request parameter file_id

      request-parameter-pattern-added

    • ●

      for the path request parameter file_id, the maxLength was set to 256

      request-parameter-max-length-set

  • 6968addaaf9795See 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

    • ▲

      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 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