> ## Documentation Index
> Fetch the complete documentation index at: https://www.magicpatterns.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Legacy v2 API

> Reference for the legacy v2 single-shot creation endpoint

> [!WARNING]
>
> **v2 is being deprecated.** All new integrations should use [v3](https://www.magicpatterns.com/docs/api/getting-started.md). v2 remains online today for backwards compatibility with existing integrations, but will be removed in a future release. Migrate to v3 when convenient.

## When to use v2 vs v3

Use **v3** if you are building anything new. v3 is the current Magic Patterns API: it covers everything v2 does (single-shot design creation) plus iteration, file reads/writes, version history, and publishing. The same API key works for both v3 and the MCP server.

Use **v2** only if you are already integrated against `POST /api/v2/pattern` and not yet ready to migrate. The same API key works for both v2 and v3 endpoints, so there's no key churn when you move over.

## v2 quickstart

**1. Log in**

Sign in (or create an account) at [magicpatterns.com](https://www.magicpatterns.com/).

**2. Create an API key**

Open [Settings → API Keys](https://www.magicpatterns.com/settings/api-keys) and click **Create Key**. Copy the key immediately — you can only see it once.

**3. Send a request**

Use the key in the `x-mp-api-key` header.

## Rate limits

1000 generations per 10 hours per key. Contact us if you need a higher limit.

## v2 endpoint

> [card] [POST /v2/pattern](https://www.magicpatterns.com/docs/patterns/v2-create-a-new-design)
>
> Create a single design from a prompt. Returns the generated source and compiled files.

## Migrating to v3

The v3 equivalent of `POST /v2/pattern` is `POST /v3/designs` with a `prompt` in the body. The same API key authenticates both. See [v3 Getting Started](https://www.magicpatterns.com/docs/api/getting-started.md) for the full walkthrough.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.