# Upload a file

**API:** Model API

**Endpoint:** `POST /api/v1/files`

**Tags:** Files

Upload one nonempty file up to 100 MiB. Uploaded files can be referenced by ID but cannot be downloaded. Supported uploads include PDF, PNG/JPEG/GIF/WebP, MP4, audio, Office documents and UTF-8 text. Generation inputs require compatible media and model capabilities; Messages/Responses accept PDF and images only.

## Base URL

- `https://openapi.felo.ai` — 生产环境

## Authentication

- `FeloBearerAuth` (http bearer) — 以 `Authorization: Bearer <key>` 形式发送的 Felo API 密钥。
- `FeloApiKey` (apiKey in header `X-API-Key`) — 以 `X-API-Key: <key>` 形式发送的 Felo API 密钥。

## Request body

Required: **yes**

### multipart/form-data

Schema:

```json
{
  "type": "object",
  "required": [
    "file"
  ],
  "properties": {
    "file": {
      "type": "string",
      "format": "binary"
    }
  }
}
```

## Responses

### 200 — Successful Response

Headers:
- `Location` (string, (uri)) — File metadata URL.

**application/json**

Schema: `FileMetadata` (`#/components/schemas/FileMetadata`)

## Schema definitions

### FileMetadata

`#/components/schemas/FileMetadata`

```json
{
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "type": {
      "type": "string",
      "const": "file",
      "title": "Type"
    },
    "source": {
      "type": "string",
      "enum": [
        "upload",
        "generated"
      ],
      "title": "Source",
      "description": "Origin of the file: `upload` for user uploads, `generated` for model outputs."
    },
    "filename": {
      "type": "string",
      "title": "Filename"
    },
    "mime_type": {
      "type": "string",
      "title": "Mime Type"
    },
    "size_bytes": {
      "type": "integer",
      "title": "Size Bytes"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "downloadable": {
      "type": "boolean",
      "title": "Downloadable",
      "description": "Whether the original bytes can be downloaded. Uploaded files cannot."
    }
  },
  "type": "object",
  "required": [
    "id",
    "type",
    "source",
    "filename",
    "mime_type",
    "size_bytes",
    "created_at",
    "downloadable"
  ],
  "title": "FileMetadata"
}
```
