> ## Documentation Index
> Fetch the complete documentation index at: https://magicads.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Anthropic (Claude) Setup

> Connect Anthropic (Claude) to MagicAds — a Copy Studio provider that drives AI ad-copy generation with the Claude family. It does not power image or video.

## Introduction

Anthropic is a **Copy Studio** provider — it drives AI ad-copy generation with the Claude family of models. It does **not** power image or video generation; use other providers for those (e.g. Gemini or OpenAI for images; Gemini/Veo, Runway, or fal.ai for video).

This guide walks you through getting a Claude API key, adding it in MagicAds, and the Claude models it unlocks.

## How keys are stored

All AI provider keys live in the **AI Settings** screen and are stored **encrypted** in the database. There are no `.env` edits — keys are injected into the drivers at runtime. Users never supply their own key; every generation runs on the admin's key.

<Note>
  A model only becomes available to users when **both** are true: the Anthropic API key is saved **and** the model is **enabled** in the vendor modal.
</Note>

## Before you start

* Admin access to your MagicAds platform.
* An Anthropic account with billing/credits set up.

## Part 1 — Get your Anthropic API key

<Steps>
  <Step title="Sign in to the Claude Console">
    Go to the [Anthropic Console](https://console.anthropic.com/) and sign in or create an account. Anthropic usually requires a **verified phone number** to activate API access.
  </Step>

  <Step title="Add billing / credits">
    Open **Settings → Billing** and add a payment method or purchase credits. Anthropic does not include free API credits with every account, so add a small balance so your key can make calls. Anthropic charges you directly for usage — separate from your MagicAds platform credits.
  </Step>

  <Step title="Create an API key">
    Go to **Settings → API Keys** (direct link: [console.anthropic.com/settings/keys](https://console.anthropic.com/settings/keys)) and click **Create Key**. Name it clearly (e.g. "MagicAds") and, if prompted, select the **workspace** it belongs to.

    <Warning>
      The key (it starts with `sk-ant-`) is shown **only once**. Copy it immediately and store it somewhere safe.
    </Warning>
  </Step>

  <Step title="Confirm model access">
    Make sure your account has credits and access to the Claude models you intend to enable.
  </Step>
</Steps>

## Part 2 — Add the key in MagicAds

<Steps>
  <Step title="Open AI Settings">
    In your platform, go to **Admin → AI Settings**.
  </Step>

  <Step title="Open the Anthropic vendor">
    Click the **Anthropic** vendor card to open its configuration modal.
  </Step>

  <Step title="Paste the key">
    Paste your API key into the **API key** field. Leaving it blank keeps the existing key unchanged.
  </Step>

  <Step title="Enable the models you want">
    Toggle on the Claude models you want to offer and set each model's **credit cost** (what a user is charged per generation).
  </Step>

  <Step title="Save">
    Click **Save**. The Anthropic card shows as connected and the enabled Claude models appear in the Copy Studio.
  </Step>
</Steps>

<Note>
  There is no "test connection" button. To verify, enable a model and run a quick generation in the Copy Studio.
</Note>

## Part 3 — Supported Anthropic models

### Copy Studio

| Model             | Model ID            | Tier     | Default credits | Best for                                                               |
| ----------------- | ------------------- | -------- | --------------- | ---------------------------------------------------------------------- |
| Claude Opus 4.8   | `claude-opus-4-8`   | Premium  | 4               | Most capable Claude — complex, premium, high-stakes copy.              |
| Claude Sonnet 4.6 | `claude-sonnet-4-6` | Standard | 2               | Best balance of speed and intelligence; strong default.                |
| Claude Haiku 4.5  | `claude-haiku-4-5`  | Fast     | 1               | Fastest Claude with near-frontier quality; great for high-volume runs. |

Claude provides **copy models only** here — there are no Anthropic image or video models.

<Note>
  Credit costs shown are the seeded defaults. You can change any model's cost in the vendor modal. These are what your platform charges users in credits — not Anthropic's prices.
</Note>

## Part 4 — Make Claude the default copy engine (optional)

In the global section of **AI Settings** you can set the **default copy engine** to Anthropic so Claude is pre-selected for users. You can also toggle the Copy Studio on/off and control free-tier access there.

## Troubleshooting

| Symptom                                   | Likely cause                                                    | Fix                                                                         |
| ----------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------- |
| Claude models don't appear in Copy Studio | Key missing or models disabled                                  | Add the key in the Anthropic vendor modal and enable the models, then Save. |
| "The payload is invalid." on generate     | Saved key can't be decrypted (e.g. after an environment change) | Re-enter the Anthropic key in AI Settings and Save to refresh it.           |
| Anthropic API errors / 401                | Invalid key or no billing/model access                          | Re-check the key, credits, and model access in the Claude Console.          |
| One Claude model fails but others work    | Account lacks access to that model                              | Disable that model or enable a tier your account can use.                   |
| Looking for Claude image/video            | Not supported                                                   | Claude is copy-only here; use an image/video provider instead.              |

<Note>
  Keys are stored encrypted and applied at runtime. No `.env` changes or commands are needed after saving.
</Note>
