---
title: "Upload media for model input"
method: POST
path: "/v1/upload"
tags: ["Models"]
---

# Upload media for model input

`POST /v1/upload`

## Request

- Base URL: `https://api.sandbase.ai`
- URL: `https://api.sandbase.ai/v1/upload`
- Auth: HTTP bearer

Uploads one image, audio, or video file and returns its stored URL. The server detects the actual MIME type
from the file bytes and filename; the optional type form field is only a hint and does not override detection.

## Response `200`

Media uploaded

- UploadMediaResponse
  - `url` string, required: Stored media URL to pass to a supported model input.
  - `filename` string, required: Original multipart filename.
  - `size` integer, required: Uploaded file size in bytes.
  - `type` string, required: Detected MIME type. This currently matches content_type.
  - `content_type` string, required: Detected MIME type used when storing the file.
  - `duration_seconds` number: Media duration in seconds. Returned for audio and video when the duration can be read from the file; omitted otherwise.

## Other responses

- `400`: Missing file, invalid multipart data, unsupported MIME type, or file too large
- `401`: Missing or invalid API key
- `402`: API key spending limit exceeded
- `403`: API key scope does not authorize this endpoint
- `500`: File could not be read or stored
- `503`: File storage is not configured

---

[API](https://skmtc.dev/sandbase/apis/sandbase-api.md) · [All operations](https://skmtc.dev/sandbase/apis/sandbase-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sandbase/apis/sandbase-api/revisions/d40df2467ba2?raw)
