The Magic Patterns API lets you create and iterate on designs programmatically — kicking off generations, polling status, reading and writing artifact files, and publishing changes — all from your own systems. v3 is the current API surface. It mirrors the Magic Patterns MCP server endpoint-for-endpoint, so the same key works for both REST and MCP. You don’t need to choose.Documentation Index
Fetch the complete documentation index at: https://magicpatterns.mintlify.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Already integrated against the legacy
/v2/pattern endpoint? See the v2 reference. v2 is being deprecated and will be removed in a future release — plan to migrate to v3 when convenient.Authentication
All v3 endpoints require an API key in thex-mp-api-key header.
Log in
Sign in (or create an account) at magicpatterns.com.
Create an API key
Open Settings → API Keys and click Create Key. Copy the key immediately — you can only see it once.
200 OK with {"status":"ok"} confirms your key is valid.
Billing
v3 usage draws from your normal Magic Patterns credit balance — the same credits the web app and MCP use. There is no separate API subscription.- Free-tier accounts get free monthly credits and can call v3 up to that limit.
- Need more? Upgrade your plan or buy credit packs at Settings → Billing & Subscription.
- When you run out, v3 calls that consume credits return
402 Payment Required. Read endpoints continue to work.
Quickstart: create a design
This kicks off generation in the background, then polls until the design is ready.Asynchronous endpoints
Two endpoints kick off long-running work and return immediately:POST /v3/designs(whenpromptis set)POST /v3/designs/{editorId}/prompts
requestId (or editorId) right away. To know when the work is done, poll GET /v3/designs/{editorId}/status until isGenerating is false.
There are no webhooks in v3 — polling is the only mechanism. We may add webhooks in a future release if customers ask.
Same key for MCP
The same API key authenticates the Magic Patterns MCP server. If you’ve installed MCP locally and have a key, you don’t need to do anything extra — just use the key with both transports.Common errors
| Status | Meaning |
|---|---|
400 | Invalid input — check the request body and parameters. |
401 | Missing or invalid x-mp-api-key. |
402 | Out of credits. Top up at Settings → Billing. |
403 | The key’s owner doesn’t have access to the requested design or artifact. |
404 | The design or artifact doesn’t exist. |
422 | Compilation failed on a publish call. |
500 | Unexpected server error — logged on our side. |
application/json with a single error field:
Rate limits
1000 generations per 10 hours per key. Contact us if you need a higher limit.Next steps
Browse endpoints
Full API reference with request/response examples and a try-it widget.
MCP server
Use the same key with our Model Context Protocol server.