Anthropic / Claude API

Set up API access for Claude and other Anthropic models.

⏱ 5 minutes ai llm console.anthropic.com
getapi anthropic

Prerequisites

  • An Anthropic account

Credentials

Variable Description Sensitive
ANTHROPIC_API_KEY API key for authenticating requests to the Anthropic API Secret

Setup Steps

  1. 1 Info

    We'll get you an Anthropic API key for using Claude models. You'll need to add a payment method or have existing credits -- the API is pay-per-use.

  2. 2 Open URL

    Opening the Anthropic Console. Sign in or create an account if prompted.

    https://console.anthropic.com
  3. 3 Choice

    Do you have billing set up (payment method or credits)?

  4. 4 Open URL

    Opening billing settings. Add a payment method or purchase credits to enable API access.

    https://console.anthropic.com/settings/billing
  5. 5 Confirm

    Billing set up?

    Checkpoint — confirm before continuing
  6. 6 Open URL
  7. 7 Info

    Click 'Create Key'. Give it a descriptive name (e.g., your project name).

  8. 8 Input

    Copy your API key and paste it here (starts with sk-ant-):

    → ANTHROPIC_API_KEY
    Starts with sk-ant-. At least 20 characters
  9. 9 Validate

    Checking your API key works...

    API key verified. You're ready to use Claude.
    Couldn't verify the API key. Make sure billing is set up and the key is active.

Things to Know

  • API keys are shown only once when created. If you lose it, you'll need to create a new one.
  • The Anthropic API requires an 'anthropic-version' header (e.g., '2023-06-01'). Most client libraries handle this automatically.
  • New accounts start with lower rate limits (Tier 1). Limits increase automatically as you spend more.
  • Set a monthly spending limit in the Console to avoid unexpected charges.
  • Claude models have different pricing tiers. Claude Haiku is the cheapest; Claude Opus is the most capable and most expensive.
  • The API uses 'x-api-key' header for authentication, not the more common 'Authorization: Bearer' pattern.