Send a prompt to the Milvey API and get a video file back.

Base URL https://api.milvey.example/v1. A run takes a model, a prompt and a credit cap, and returns a file URL. The API is in private preview, so ids and numbers on this page are samples.

Crowned hedgehog on an ornate throne (description; prompt not published)

Quickstart in a terminal

quickstart.sh
# 1. Studio → Settings → API keys. The key is shown once.
export MILVEY_API_KEY="mv_live_…"

# 2. Start a run. max_credits caps what it can cost.
curl https://api.milvey.example/v1/runs \
  -H "Authorization: Bearer $MILVEY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"kling-v3","prompt":"Neon market in the rain","max_credits":120}'
# → {"id":"run_8f2a91","status":"queued","credits_held":110,…}

# 3. Poll until status is "succeeded", then download output.url
curl https://api.milvey.example/v1/runs/run_8f2a91 -H "Authorization: Bearer $MILVEY_API_KEY"

Keep the key in $MILVEY_API_KEY on a server. Browser code that holds the key exposes it to anyone who opens dev tools.

POST /v1/runs starts a run

FieldTypeNotes
modelstringModel slug, e.g. kling-v3, or auto. auto picks a model under max_credits.
promptstringText prompt.
durationintegerSeconds. Allowed values depend on the model.
resolutionstring480p, 720p or 1080p, if the model supports it.
max_creditsintegerCap for this run. The request fails with 409 if the estimate is above it.
webhook_urlstringOptional. Receives run.succeeded or run.failed.

Statuses: queued, running, succeeded, failed. Poll every 3 to 5 seconds, or pass webhook_url.

response · 201
HTTP/1.1 201 Created

{
  "id": "run_8f2a91",
  "status": "queued",
  "model": "kling-v3",
  "credits_held": 110,
  "estimate": { "min": 110, "max": 110 },
  "poll_url": "/v1/runs/run_8f2a91"
}
response · when done
GET /v1/runs/run_8f2a91

{
  "id": "run_8f2a91",
  "status": "succeeded",
  "output": { "url": "https://cdn.milvey.example/run_8f2a91.mp4", "duration": 5 },
  "credits_charged": 110,
  "route": "kling-primary"
}

Errors and what they cost

run_77c0 · kling-v3 · 5s · 720p502 provider_failed
09:40:02Hold for kling-v3 (estimate 110 cr)−110
09:40:31Kling returned 503 on every route. Rerouted to wan-2.2, the next model under the cap0
09:41:10wan-2.2 runs on Milvey GPUs and found no free capacity. It queued, then timed out. It does not fall back to a paid API0
09:41:10Hold released. Response 502 provider_failed+110
Net cost 0 cr. Credits are charged only when a file is delivered. sample
HTTPCodeMeaningCharged
400invalid_inputA field is missing or out of range.No
401unauthorizedKey missing, revoked or wrong.No
402insufficient_creditsBalance is below the estimate for this run.No
409cap_exceededEstimate is above your max_credits.No
422content_blockedThe provider refused the prompt or input.No
429rate_limitedToo many requests. Wait for Retry-After seconds.No
502provider_failedEvery route failed, no cheaper model fit under the cap, or an open model could not get GPU capacity.No
200succeededFile delivered.Yes

The same request in curl, TypeScript and Python

run.sh
curl https://api.milvey.example/v1/runs \
  -H "Authorization: Bearer $MILVEY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"kling-v3","prompt":"Neon market in the rain","max_credits":120}'

Rate limits by plan

PlanRequestsVideo runs at a timePodsQueue
Starter10 / minsample11 podStandard
Creator60 / minsample32 podsPriority GPUs
Studio300 / minsample10DedicatedReserved capacity

A 429 response includes a Retry-After header in seconds. Limits are samples while pricing is set. Plan details: pricing.

Webhooks

POST to your webhook_url
POST https://example.com/hooks/milvey
X-Milvey-Signature: t=1762333964,v1=5c1f…

{
  "type": "run.succeeded",
  "id": "evt_41c7",
  "created": "2026-11-05T09:12:44Z",
  "data": { "run_id": "run_8f2a91", "credits_charged": 110 }
}
Events
run.succeeded, run.failed
Reply
Any 2xx status
Retries
With backoff, for up to 24 hours
Duplicates
Each event has a stable id. Store it and skip repeats.
Signature
Check X-Milvey-Signature with your webhook secret before reading the body.

Create a key in Studio and send the curl above.

Questions about the API, or a model you need on it? Join the list and reply to the first email. Requests and responses on this page are samples.

Email when signups open · Unsubscribe any time