> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cubestack.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Uploads

> API endpoints for file and image uploads.

# Uploads Endpoints

Endpoints for uploading and managing files and images.

## Upload Image

Upload an image to be served via CDN.

```bash theme={null}
POST /api/v1/{project}/upload
```

<ParamField header="X-Api-Key" type="string" required>
  Your API key
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `multipart/form-data`
</ParamField>

### Request

```bash theme={null}
curl -X POST "https://api.cubestack.app/api/v1/{project}/upload" \
  -H "X-Api-Key: your-api-key" \
  -F "file=@image.jpg"
```

### Response

```json theme={null}
{
  "id": "img_abc123",
  "url": "https://api.cubestack.app/api/v1/img/img_abc123"
}
```

## Image Variants

Uploaded images are available in multiple sizes:

| Variant     | Description           |
| ----------- | --------------------- |
| `thumbnail` | Small preview (150px) |
| `medium`    | Medium size (600px)   |
| `full`      | Full resolution       |

Access variants by appending the variant name:

```
https://api.cubestack.app/api/v1/img/{image_id}/{variant}
```
