---
title: "Upload a file"
method: POST
path: "/files"
tags: ["Files"]
---

# Upload a file

`POST /files`

Uploads a file to be referenced in future API calls. The file is stored under the workspace of the authenticating API key. Maximum file size: 100 MB.

## Query parameters

- `workspace_id` string, uuid — Workspace to scope the request to. Defaults to the caller’s default workspace.

## Response `200`

The uploaded file metadata.

- FileMetadata — Metadata describing a stored file.
  - `created_at` string, required
  - `downloadable` boolean, required
  - `filename` string, required
  - `id` string, required
  - `mime_type` string, required
  - `size_bytes` integer, required
  - `type` 'file', required

## Other responses

- `400` — Bad Request - Invalid request parameters or malformed input
- `401` — Unauthorized - Authentication required or invalid credentials
- `403` — Forbidden - Authentication successful but insufficient permissions
- `413` — Payload Too Large - Request payload exceeds size limits
- `429` — Too Many Requests - Rate limit exceeded
- `500` — Internal Server Error - Unexpected server error

---

[API](https://skmtc.dev/openrouterteam/apis/openrouter-api.md) · [All operations](https://skmtc.dev/openrouterteam/apis/openrouter-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openrouterteam/openrouter-api/revisions/9814733ca74d/schema)
