A short tour of the building blocks the API exposes. If you’ve used a visual workflow tool before, most of this will be familiar.Documentation Index
Fetch the complete documentation index at: https://magica.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Workflows
A workflow is a saved graph of nodes connected by edges. Think of it as a function: it takes inputs from a Request Node, runs them through one or more processing nodes, and emits results from a Response Node.User workflows
Workflows you create and own. Manage them with
POST /v1/workflows, PATCH /v1/workflows/{id}, etc.System workflows
Pre-built templates Magica ships (e.g. “Nano Banana Pro”, “Flux 2 Pro”).
Read-only — list with
GET /v1/system-workflows.Nodes
A node is a single step in a workflow. Two special scaffold nodes exist in every workflow:Request Node
Defines workflow inputs. Each input field has a name, type, and optional
default value. The values you pass to
start_run populate these fields.Response Node
Defines workflow outputs. Whatever gets wired into the Response Node is
what the run returns.
| Category | Examples |
|---|---|
| Image | Flux 2 Pro, Nano Banana Pro, GPT Image 1.5 |
| Video | Runway, Kling, Veo |
| Audio | TTS, music generation, sound effects |
| LLM | GPT-5, Claude Sonnet, OpenRouter models |
| Utility | Merge videos, extract audio, transcription |
Scaffold nodes (Request, Response) cannot be deleted. All other nodes can.
Ports & edges
Every node has typed input and output ports. An edge is a connection between an output port on one node and an input port on another.- Type compatibility — image ports can’t feed into text-only inputs.
- No cycles — workflows are DAGs.
- Single-input rule — most input ports accept exactly one upstream edge.
text · image · video · audio · avmedia · file · number · boolean · select · any.
Runs
A run is a single execution of a workflow. Runs are asynchronous —POST /v1/runs returns a runId immediately, and the actual execution happens in the background.
States
RUNNING → terminal: COMPLETED, FAILED, or CANCELED.Get the result
Poll
GET /v1/runs/{runId}, or register a webhook on the run
to get notified.Run result shape
response field surfaces what the Response Node received — usually the only thing you need. nodes gives per-step status + output, useful for debugging partial failures.
Run history in the UI
API-triggered runs aren’t invisible — they’re surfaced in the same dashboard your UI runs land in. Use this to debug a failing run, inspect a past result, or copy arunId you forgot to log.
Two places to find it:
- Workflow editor
- Node / workflow playground
Open any workflow on the canvas and click the clock icon in the top toolbar to slide out the Execution History panel. Switch to the API Runs tab to filter to runs started via the REST API or MCP server.



Webhooks
Instead of polling, subscribe to run events. Add awebhook object to your POST /v1/runs body:
Credits
Each run debits credits from your account. Costs depend on the model and parameters used (resolution, duration, etc.).GET /v1/credits/balance— current balanceGET /v1/models/catalog— model list with cost structure- Canceled runs refund unused estimated credits
How it all fits together
Define a workflow
Wire processing nodes between the Request and Response scaffold nodes. Save
it via
POST /v1/workflows.Next steps
Quickstart
Walk through the API end-to-end with code samples.
MCP Server
Drive all of the above from a Claude or Cursor conversation.
