Docs/REST API
REST API
The same primitives over HTTP.
Every MCP tool has a REST twin with the same body. Scripts, CI and backends use these with an API key; agents use the connector.
On this page
Base URL and auth
base
https://api.agent-media.ai
header
Authorization: Bearer ma_... (from `agent-media login` or the dashboard)
Routes
| Method | Path | Body | Returns |
|---|---|---|---|
| POST | /v2/generate/{video|image|audio} | the tool arguments | 201 { job_id, model, mode?, quality?, credits_deducted, breakdown, auto?, status_url } |
| POST | /v2/quote/{video|image|audio} | the same arguments | 200 { credits, usd, model, mode?, quality?, breakdown, auto? } |
| GET | /v1/videos/{job_id} | – | { status, video_url } (the URL is a png or mp3 for those kinds) |
| GET | /v1/models | – | the catalog with modes, prices per quality and recent stats; public |
| POST | /v1/runs/{job_id}/rate | { score: 1..5, note? } | 200 { job_id, model, score } |
| POST | /v1/uploads/image | { image_base64 } or { image_url } | { image_url } |
| GET | /v1/characters | – | saved characters with sheet/portrait URLs |
The fixed recipes (make_ugc, make_podcast, make_subtitles, selfie, crazy look) remain REST and CLI routes for the dashboard. They are not MCP tools.
Example
curl
curl -X POST https://api.agent-media.ai/v2/generate/video \
-H "Authorization: Bearer ma_..." -H "Content-Type: application/json" \
-d '{ "prompt": "A 28-year-old woman in a bright kitchen, phone framing, holds a serum bottle to the lens and says: \"Okay, I did not expect this to work.\"", "seconds": 5 }'OpenAPI
Machine-readable spec at https://api.agent-media.ai/openapi.json, interactive reference at https://api.agent-media.ai/docs.