Skip to content
Guide

Setting up Anthropic

Claude models from Anthropic, with an API key.

On this page

Anthropic makes the Claude models. This guide covers getting an API key from the Claude Console and connecting it to Aldwin.

What Anthropic is#

Anthropic's API gives you the Claude models, billed per use. It is separate from a Claude.ai subscription: API keys are made in the Claude Console.

When Aldwin uses Anthropic, your prompts and the files Aldwin reads for you go to Anthropic over the internet. If you want everything to stay on your computer, use Ollama or LM Studio instead.

What you need#

  • An Anthropic Console account and API key
  • A payment method or credit on the account
  • Aldwin installed (uv tool install aldwin)

You pay per use. See Claude pricing.

Get a key#

  1. Sign in to the Claude Console.
  2. Open API keys and click Create key.
  3. Give it a name, choose when it expires, and create it.
  4. Copy the key now; it starts with sk-ant- and is shown only once. Treat it like a password.

Connect Aldwin#

In the web app#

  1. Open Settings from the bottom of the sidebar and choose Models.
  2. Find Anthropic under Providers and select Add key.
  3. Paste your key and select Connect. Aldwin checks the key with Anthropic before saving it. If it does not work, Aldwin says why and saves nothing.
  4. Under Model in use, pick a Anthropic model. You can also switch models from the message box in any chat.

Setting up Aldwin for the first time? On the Connect a model page, pick Paste an API key, choose Anthropic, and paste the key.

To change or remove the key later, use Replace key or Disconnect on the same row.

In the terminal#

  1. Start Aldwin and type /model.
  2. Pick Add a provider… and press Enter. It lists the cloud providers that don't have a key yet.
  3. Pick Anthropic, then paste your key at Anthropic API key: (the input is hidden) and press Enter.
  4. Aldwin checks the key with Anthropic before saving it. When it works you see ✓ Saved key for Anthropic. If not, Aldwin says why and saves nothing.
  5. Anthropic now appears under Available providers. Pick it, then pick a model. You see ✓ Switched to <model> (Anthropic).

On first launch, aldwin offers the same choice: choose to use a cloud provider, pick Anthropic, and paste the key. You can rerun this any time with aldwin setup.

Choosing a model#

Every current Claude model uses tools. claude-sonnet-5-5 is a good balance of speed, quality and cost. claude-opus-5-5 is stronger for hard tasks, and claude-haiku-5-5 is the fastest and cheapest.

To switch straight to a model by name, type /model anthropic/claude-sonnet-5-5.

Update or remove the key#

Type /model, choose Manage keys…, and pick Anthropic. Update key checks and saves a new key. Disconnect removes the saved key; switch to another model first if Anthropic runs the current one.

Other ways to add the key#

These skip the check, so use them only if you prefer files or environment variables.

Secrets file. Add this line to ~/.aldwin/secrets.yaml (create the file if it does not exist, and keep any lines already in it):

anthropic_api_key: your-key-here

Environment variable, for one terminal session or in your shell profile (~/.zshrc or ~/.bashrc):

export ANTHROPIC_API_KEY=your-key-here

An environment variable wins over a saved key.

Try it#

aldwin

Ask something that uses a tool:

List the files in this folder.

You should see a list_dir step and then the answer. The status line at the bottom shows your model and Anthropic.

Privacy notes#

  • Anthropic does not use API data to train its models without your permission. See API and data retention.
  • Aldwin keeps the key only in ~/.aldwin/secrets.yaml (or your environment), and removes it from any error message it shows.
  • Details: Privacy.

Troubleshooting#

Messages from /model appear right after you paste a key. Messages during a chat appear after ✗ in place of an answer.

What Aldwin saysFix
Your Anthropic key was rejected. Check the key and try again.The key is wrong, revoked, or was pasted with extra characters. Copy it again from Anthropic.
Could not reach Anthropic to verify the key.Check your internet connection and try again. If it keeps happening, the account may be blocked or out of credit; check it on the provider's site.
Anthropic runs the current model. Switch to another model first.You can't disconnect the provider you are using. Switch model with /model, then disconnect Anthropic.
Anthropic's key comes from ANTHROPIC_API_KEY in your environment. ...Disconnect can't remove an environment variable. Delete the export ANTHROPIC_API_KEY=... line from your shell profile, then restart Aldwin.
Your Anthropic key was rejected. Run `aldwin setup` to replace it.The key stopped working after it was saved. Run /model, choose Manage keys…, pick Anthropic, and choose Update key.
Anthropic refused the request (HTTP 402). ...A billing problem, usually no credit or an expired card. Fix it in the Claude Console under billing.
Anthropic rate limit reached. Wait a moment and try again.Too many requests, or your plan's monthly spend limit is reached. Wait, or check limits in the Console.
Can't reach Anthropic. ...Check your internet connection, or switch to a local model with /model.
Model ... isn't available to your key. ...Your account can't use that model. Pick another with /model.
This conversation is too long for ... Start a fresh one with /new.Type /new. Your saved memory notes stay.
Was this page helpful?