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

# Upload Media

> POST /v1/media/upload — upload a local image or video file and get back a public URL.

## Endpoint

```
POST /v1/media/upload
```

Use this when you have a **local file** instead of a public URL. Upload it here first, then
pass the returned `url` into the `image`, `last_image`, or `video` field of
[Create Video](/docs/api/create-video) or [Image Edits](/docs/api/images) (`POST /v1/images/edits`).

If your image or video is already hosted somewhere public, you can skip this endpoint and pass
that URL directly instead.

## Request

<ParamField header="Authorization" type="string" required>
  `Bearer <your-token>`
</ParamField>

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

### Body

<ParamField body="file" type="file" required>
  The image or video file to upload. Max **50MB**.
</ParamField>

## Example

```bash theme={null}
curl -X POST https://hypergate.store/v1/media/upload \
  -H "Authorization: Bearer your-token" \
  -F "file=@/path/to/video.mp4"
```

## Response `200`

```json theme={null}
{
  "url": "https://hypergate.store/v1/media/ref/236b3c89-1234-5678-abcd-ef0123456789",
  "type": "video",
  "size": 46113
}
```

| Field | Description |
| - | - |
| `url` | Public URL — use this in `image`, `last_image`, or `video` on other endpoints. |
| `type` | `image` or `video`, detected from the uploaded file. |
| `size` | File size in bytes. |

<Warning>
  Uploaded URLs are for temporary use with generation requests only — do not rely on them for
  long-term storage. Use the URL within the same session as the upload.
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.