> ## Documentation Index
> Fetch the complete documentation index at: https://magicpatterns.mintlify.site/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](/api/getting-started). v2 remains online today for backwards compatibility with existing integrations, but will be removed in a future release. Migrate to v3 when convenient.
</Warning>

## 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

<Steps>
  <Step title="Log in">
    Sign in (or create an account) at [magicpatterns.com](https://www.magicpatterns.com/).
  </Step>

  <Step title="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.
  </Step>

  <Step title="Send a request">
    Use the key in the `x-mp-api-key` header.
  </Step>
</Steps>

## Rate limits

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

## v2 endpoint

<Card title="POST /v2/pattern" icon="code" href="/patterns/v2-create-a-new-design">
  Create a single design from a prompt. Returns the generated source and compiled files.
</Card>

## 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](/api/getting-started) for the full walkthrough.
