How to set up a Claude API key

Set up Claude Console, add API credits, control workspace spending, connect your app, troubleshoot errors, and replace API keys safely.

A blue key connects a navy app tile to a terracotta doorway bearing Claude’s sunburst symbol.

A Claude API key connects the AI features in another app to your Anthropic account. It gives that app a way to request answers from Claude, with the usage charged to your API balance.

The setup happens in Claude Console. We’ll work through the account, credits, spending controls, and key, then try the connection in your app. No terminal or programming is needed. Dashboard labels can vary as Anthropic updates the service.

Use Claude Console to manage API access

Open Claude Console and sign in or register. Complete the organization and use-case details requested during onboarding. Anthropic’s getting-started guidance covers this account setup.

  1. Check that you’re in the organization whose API balance you intend to use.
  2. Visit Settings → Workspaces. A workspace groups an integration’s resources, access, and usage.
  3. For an app you want to track separately, have an organization admin choose Create workspace and give it a recognizable name, such as Personal notes.

You can begin in the Default Workspace, but a separate workspace lets you set its own budget later. Only organization admins can create workspaces. On a shared account, ask an admin for Developer access to the workspace you’ll use. Anthropic documents the roles and settings in its workspace guide.

Fund API usage through Console billing

Paying for Claude Pro or Max doesn’t fund ordinary API requests made with a Console key. The chat subscription and developer platform have separate billing, as Anthropic explains in its subscription and API billing guide. A paid chat plan is not a prerequisite for this setup.

  1. Go to Settings → Billing. Managing payments requires an Admin or Billing role.
  2. For a prepaid account, select Buy credits, enter the amount offered by the form, and review the purchase before paying.
  3. Check that the purchased credits appear in the balance on the Billing page.
  4. Inspect Auto-reload. Leave it off for a trial if you prefer to decide when to buy more. If enabled, review the balance threshold and reload amount.

Most Console organizations use prepaid credits; some have monthly invoicing arrangements. With prepaid billing, an empty balance stops API access until it is replenished. Purchased credits expire after one year and are non-refundable, so choose an amount that fits the experiment. The API payment guide explains credit purchases and auto-reload.

Give your app a monthly budget with spend limits

Decide what this connection is worth to you before letting the app use it regularly. For example, you could give a notes app a $15 monthly workspace budget, with reminders at $6 and $12. If you run two integrations, a $25 organization limit could cover their combined usage. These numbers illustrate how the controls fit together; they don’t predict your costs.

  1. In Billing, find Spend limits and choose Adjust limit, or Set limit. Enter your organization’s monthly amount and save. It must fit within the account’s current tier cap.
  2. Open your app’s workspace under Workspaces. Use its Spend limits tab for a monthly cap and spending alerts. Workspace limits cannot exceed organization limits.
  3. After several days of ordinary use, review costs before deciding whether to change either amount.

A spend limit pauses requests when reached; an alert is a reminder. Adding prepaid credits doesn’t remove a reached spend limit. Check which control stopped the app before paying for more. Anthropic’s spend and rate limits guide describes the behavior.

Create a Claude key for the workspace you’ll use

In Claude Console, go to Settings → API keys and select Create key. Give it a useful name, such as Notes app on my Mac, so you can identify the connection later.

  1. For your own app connection, choose yourself under Linked account. This creates a personal key.
  2. Scope it to the workspace you prepared. A key tied to one workspace avoids requiring the app to specify a separate workspace ID.
  3. Choose an expiration that suits how long you expect to use the connection. Record when you’ll need a replacement.
  4. Finish creating the key and save the full secret in a secure password-manager entry while you have it available.

A personal key acts with your access. For an integration shared by a team, ask an admin about a service account instead. Anthropic’s authentication guide explains key ownership, workspace scope, and expiration.

Choose Claude or Anthropic in your app’s provider settings

The app may name the provider Claude or Anthropic. Anthropic is the company behind Claude, so check the app’s instructions if both names appear in its setup.

  1. Find the app’s AI connection settings and select its Anthropic or Claude integration.
  2. Enter the secret in the API key field. Use the actual key value, without a label, surrounding quotation marks, or an authentication-header prefix.
  3. If there’s a model selector, choose a Claude model supported by this app and available to your account.
  4. Save, then try a small task: for example, ask Claude to turn a short note into three bullet points.

Check the result before using the connection for longer documents or repeated tasks. Then return to Console to review the cost. A short first request helps you confirm both the connection and where its usage appears.

Match connection errors to the account setting that needs attention

If the test fails, read the HTTP status, error.type, and complete message. Claude uses the same error type for some different limits, so the message matters too. If your app only shows “connection failed,” look in its connection log or ask support for the underlying error without sharing your key.

Claude API connection problems and useful next checks
Message or statusNext check
401 — authentication_errorCheck the pasted key and whether it is disabled, deleted, or expired.
402 — billing_errorCheck the organization’s payment details in Billing.
Message reports insufficient or exhausted creditsCheck the prepaid balance in Billing and buy credits if needed. Use the message to identify a credit problem; don’t assume every billing or usage-limit error means an empty balance.
400 — invalid_request_error, message includes “specified workspace API usage limits”The workspace reached its spend cap. Review usage with an admin before adjusting it, or wait for the stated reset.
400 — invalid_request_error, message includes “specified API usage limits”The organization reached its spend cap. Review spending with an admin before adjusting it, or wait for the stated reset.
429 — rate_limit_error, with error.details.error_code set to enforced_spend_limit_reachedThe Messages API identifies the organization’s monthly tier cap this way, without retry-after. Request a higher cap or wait for the monthly reset.
429 — rate_limit_error, message identifies a request or token rate limitWait for retry-after, reduce simultaneous requests, and increase traffic gradually. Check workspace and organization rate limits.
400 — invalid_request_error, message says anthropic-workspace-id is requiredUse a single-workspace key, or configure the workspace ID if the app supports it.
529 — overloaded_errorRetry later; Anthropic has temporary capacity pressure.

Use Anthropic’s API error reference alongside its limit explanations. Buying credits won’t fix every limit, and a fresh key won’t resolve a service overload.

Configured workspace and organization spend limits share an error type; use the message to distinguish them. The special Claude Code workspace can return 429 for its spend limit too.

How to replace your Claude API key

For a planned replacement, keep the current key active until the app works with the new one. Start before its expiration date.

  1. Create a replacement. In Claude Console’s Settings → API keys, create a new key for the same linked account and workspace. Use a recognizable new name, choose an expiration, and save the secret securely.
  2. Update the app. Replace the credential in its Claude or Anthropic settings and save. Update other installations that still use the previous key.
  3. Check the connection. Run a small task with your usual Claude model and confirm that it returns an answer. Saving the key by itself doesn’t prove that requests work.
  4. Revoke the old key. After every connection uses the replacement successfully, delete the previous key in Console and remove its stored secret. Disable stops access too, but is reversible; Delete permanently retires it.

Anthropic’s key replacement guidance follows this order. If a secret becomes public, disable or delete it immediately, then connect a replacement and inspect recent usage for unfamiliar requests.

Get more from our apps with API keys

Connect your OpenAI or Claude API key to use AI features in our apps. Here’s how each app puts your key to work.

  • Flux

    App Store tools

    Translate App Store reviews into your language, then translate your replies into the reviewer’s language before sending.

    Explore Flux

By Echo-O · Edited by Alexander Martirosov