# Claude API Key

Anthropic's Claude models are accessed through the Anthropic console. The API uses a prepaid credit system, so you need to purchase credits before your key can process requests.

### Prerequisites

You need the following:

* An email address or Google account
* A credit card for purchasing API credits (minimum $5)

### Step-by-step instructions

Follow the steps to set up the Claude API key:&#x20;

{% stepper %}
{% step %}
Go to [console.anthropic.com](https://console.anthropic.com/) and create your developer account using an email address or a single sign-on (SSO) provider.&#x20;
{% endstep %}

{% step %}
If using an SSO provider, enter the email address and the password. Review the displayed information and click **Continue**. \
If you are not using an SSO provider, validate your email address, click the link sent to your email address, or check your inbox for the verification code, input the verification code in the **Enter verification code** field, and click **Verify Email Address** to proceed.
{% endstep %}

{% step %}
On the **Start building with Claude** page, enter your name in the **What's your full name?** and **What should we call you?** fields, select the **I am at least 18 years old...** checkbox, and then click **Continue**.
{% endstep %}

{% step %}
On the **What type of account sounds right?** page, select an account type, such as **Individual** or **Organization**.
{% endstep %}

{% step %}
*Optional*: If **Organization** is selected, you will be redirected to **Let's get your organization details** page, enter a name in the **Organization name** field, fill out the remaining organization and usage details, and then click **Create Account**.
{% endstep %}

{% step %}
On the **Claude Console** dashboard, click **Buy Credits**.
{% endstep %}

{% step %}
Verify your billing address, and purchase an initial amount of credits (minimum $5). You can also configure auto-reload so your account stays funded.

{% hint style="info" %}
**Tip:**. To process requests with your API key, you must purchase credits for your account
{% endhint %}
{% endstep %}

{% step %}
In the navigation menu, click **API keys**, and then click **Create Key**.&#x20;
{% endstep %}

{% step %}
In the **Create API key** dialog, select a workspace in the **Create in Workspace** list, enter a name in the **Name your key** field, and then click **Add**.
{% endstep %}

{% step %}
In the **Save your API key** dialog, click **Copy key**, and then click **Close**.

{% hint style="warning" %}
**Important:** Your key is shown only once for security reasons. Store it securely. Set it as an environment variable named `ANTHROPIC_API_KEY.` Never commit it to a public repository.
{% endhint %}
{% endstep %}
{% endstepper %}

### Test your key

Anthropic uses the `x-api-key` header (not a Bearer token). Use the official Anthropic Python or TypeScript SDK, or test with a `curl` request to the `/v1/messages` endpoint.<br>

<figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FbB2YRn0HnidiWQjiZOnM%2Fimage.png?alt=media&#x26;token=fbe3162d-a95f-436c-b13a-c44ab575a989" alt=""><figcaption></figcaption></figure>
