Skip to main content

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.

This guide walks you from zero to a successful workflow run. By the end you’ll have an API key, a base URL configured, and a run executing on Magica’s infrastructure.

1. Get your API key

1

Sign in

Open app.magica.com and sign in.
2

Open API Keys

Go to Settings → API Keys → Manage.
3

Create a key

Click Create Key, label it (e.g. “Quickstart”), and copy the full gx_… token immediately — it’s only shown once.
Store the key in an environment variable like MAGICA_API_KEY — never paste it in committed code or screenshots.
See Authentication for rate limits, key rotation, and revocation.

2. Base URL

https://api.magica.com/api
Every endpoint in this reference is relative to that base. The current REST version is /v1.

3. List your workflows

A read-only call to verify the key works.
curl https://api.magica.com/api/v1/workflows \
  -H "Authorization: Bearer $MAGICA_API_KEY"
A 401 Unauthorized here means the key is missing, malformed, revoked, or expired.

4. Start a run

Pick a workflow ID from step 3 (or use a system-workflow template) and kick off a run.
curl -X POST https://api.magica.com/api/v1/runs \
  -H "Authorization: Bearer $MAGICA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"workflowId": "wf_abc123"}'
The response includes a runId. Use it to poll status or to register a webhook.

5. Get results

You have two options — poll or subscribe.
Hit GET /v1/runs/{runId} until status becomes COMPLETED, FAILED, or CANCELED.
curl https://api.magica.com/api/v1/runs/$RUN_ID \
  -H "Authorization: Bearer $MAGICA_API_KEY"
Good for one-off scripts. For long jobs (video, batch), prefer webhooks.

OpenAPI spec

The full OpenAPI 3.1 specification is at:
https://api.magica.com/api/v1/openapi.json
Import it into Postman, Insomnia, or any OpenAPI-compatible client to generate typed SDKs.

Next steps

Concepts

Understand workflows, runs, nodes, and request/response scaffolds.

API Reference

Browse every endpoint with request/response playground.