Connect Anthropic (Claude)
Create an Anthropic API key in the Console, add credit, set spend limits, paste it into the AI providers page, test it, and fix common errors.
Last updated:
Anthropic makes the Claude family of models. To use them in SiteTrellis you need an Anthropic API account (separate from a Claude.ai chat subscription) and an API key. The screens below describe the Anthropic Console as of writing; Anthropic updates its console, so if a menu has moved, check Anthropic's own documentation.
Create an account and add credit#
- Go to
console.anthropic.comand sign up or log in. Create an organization if prompted. - Open the billing area (Plans & Billing or similar) and add a payment method. Anthropic's API is typically prepaid: you buy credit, and usage draws it down. Without credit, requests fail even with a valid key.
- Optionally enable auto-reload so the balance does not run out mid-month. If you do, also set a limit (below).
Create the API key#
- In the Console open API keys (under Settings, or the left menu).
- Click Create Key. Name it something like "SiteTrellis production". If your organization uses workspaces, create the key in the workspace you want to bill and limit.
- Copy the key immediately. Anthropic shows the full key only once. Keys are long strings that start with
sk-ant-.
Set spend limits#
In the Console's Limits or billing settings you can set a monthly spend limit for the organization, and, with workspaces, for an individual workspace. Set a limit you would be comfortable losing in a worst case, such as a bot hammering your chat. Review usage on the Console's usage page during the first weeks. Tier-based rate limits also apply, and increase as your account's paid history grows.
Paste it into SiteTrellis#
- In the dashboard open AI providers and add a key.
- Choose Anthropic and enter a label, for example "Anthropic - production".
- Paste the key and save.
- The status should change to ok after the automatic test. If not, read the error text, then use Test after fixing.
- In your agent's model section add a step, select this key, and pick a model from the model list in the dashboard. Models change often, so choose from the list rather than typing an identifier from the internet.
Typical errors#
| Message or code | Meaning | Fix |
|---|---|---|
| 401 authentication error | The key is wrong, was revoked, or has extra spaces. | Create a new key, paste it again without leading or trailing whitespace, and rotate it into SiteTrellis. |
| 403 permission error | The key's workspace or organization cannot use that model or feature. | Check workspace permissions, or choose another model. |
| 404 not found | The selected model does not exist for your account (retired or not enabled). | Pick a different model from the dashboard list. |
| "Credit balance is too low" (a 400-series error) | The prepaid balance is empty. | Add credit in Plans & Billing, then press Test. |
| 429 rate limit | You are sending requests faster than your tier allows. | Wait, request a higher tier, or add a fallback step on another key or provider. |
| 500 or 529 overloaded | Anthropic is busy or having an incident. | Transient. A fallback step covers it; see AI keys overview. |
Data handling#
Your visitors' messages and your prompt are sent to Anthropic under your account's terms. Anthropic publishes how it treats API data (for example retention periods and whether API inputs are used for training); read the current terms in its commercial terms and privacy documents, and reflect them in your own privacy policy. For how SiteTrellis itself stores and protects your key and chat data, see Security and privacy.
Rotating the key#
- Create a second key in the Console.
- In SiteTrellis, rotate the existing entry to the new key and press Test.
- Send a test chat from the playground.
- Delete the old key in the Console.
Next: build your agent.