Documentation

API version v1 · last updated 2026-10-02

Everything in the dashboard can be done over HTTP. The API is a plain JSON API, the CLI is a thin wrapper around it, and both use the same tokens.

Base URL and authentication

All requests go to https://api.media-host.online/v1. Authenticate with a bearer token from Settings → API keys. Tokens starting with mh_live_ work against your real account; mh_test_ tokens hit a sandbox that accepts uploads but never serves them publicly.

curl https://api.media-host.online/v1/account \
  -H "Authorization: Bearer mh_live_3f9a...c21e"
{
  "id": "acc_Qm4xT",
  "plan": "studio",
  "storage_used_bytes": 41288312902,
  "transfer_month_bytes": 612338190021,
  "collections": 4
}

Install the CLI

The CLI is a single static binary for Linux and macOS. It reads MH_TOKEN from the environment or from ~/.config/mh/config.toml.

curl -fsSL https://media-host.online/install.sh | sh
mh auth login          # pastes a token into the config file
mh ls                  # list collections
mh ls weekly-show      # list files in a collection

Rate limits

600 requests per minute per token for metadata calls. Uploads are not rate-limited by count, only by concurrency: 8 parallel chunks per token. Over the limit you get 429 with a Retry-After header.

Errors

Errors are JSON with a stable code you can switch on, and a human message you probably shouldn't.

HTTP/1.1 404 Not Found
{ "error": { "code": "file_not_found", "message": "No file f_9ZZZ in collection weekly-show" } }

Guides