Skip to main content

Quick Checklist

Before diving deeper, check these common causes:
1

No extra spaces

Ensure there are no leading or trailing spaces when you paste your API key. Copy it fresh from Connect → AI Coding Tools → [Your Tool].
2

Correct tool selected

Verify you’re using the key from the right tool. Different tools may show different keys in the Connect → AI Coding Tools section.
3

Credits available

A 402 error means your credits are exhausted — this is NOT an invalid key error. See Credits & Budget for resolution.
4

Key not regenerated

If someone (including you) regenerated the key, your old key is now permanently invalid. Copy the new key from the dashboard.

”Invalid API key” in Roo Code

CheckFix
Wrong API provider selectedSelect “unbound” as the API provider (not “OpenAI” or “Anthropic”)
Wrong key pastedPaste the key from Connect → AI Coding Tools → Roo Code — not an Anthropic or OpenAI key
Wrong Roo Code versionYou must use the Unbound-modified version of Roo Code, not the standard VS Code marketplace version
Cached old keyRemove the key, save settings, re-enter the key, save again
Stale sessionRestart VS Code completely after changing the key

”Invalid API key” in Claude Code CLI

1. Wrong base URL (most common cause)

Your base URL must point to Unbound, not Anthropic. Verify your current settings:
echo $ANTHROPIC_API_KEY
echo $ANTHROPIC_BASE_URL
The base URL must be https://api.getunbound.ai. If it’s set to https://api.anthropic.com or is empty, that’s the problem.

2. Environment variables not loaded

After setting environment variables, you must restart your terminal. If using ~/.bashrc or ~/.zshrc:
source ~/.zshrc  # or source ~/.bashrc

3. Config file conflict

If using a config file at ~/.config/claude-code/config, verify both the API key and base URL are correct there too. The config file may override your environment variables.

”API Key Is Incorrect, But It’s Correct”

This frustrating error almost always means one of these:
  • Base URL is wrong — Your requests are going to Anthropic’s API (which doesn’t recognize Unbound keys) instead of Unbound’s API. Fix: export ANTHROPIC_BASE_URL="https://api.getunbound.ai"
  • Key from wrong tool — Double-check which tool’s key you copied from Connect → AI Coding Tools
  • Key was recently regenerated — Someone on your team may have regenerated the key. Check the current key in the dashboard
  • Invisible characters — Some terminals or password managers add invisible characters. Try typing the key manually or pasting from a plain text editor

How to Verify Your API Key

Run this quick test in your terminal:
curl https://api.getunbound.ai/models \
  -H "Authorization: Bearer YOUR_API_KEY"
Expected results:
  • Valid key → Returns a JSON list of available models
  • Invalid key → Returns an authentication error message
  • No credits → Returns a 402 error (key is valid, but credits are exhausted)

Still Not Working?

Contact support with:
  1. The exact error message you’re seeing (screenshot preferred)
  2. Which tool you’re using (Claude Code, Roo Code, Cursor, etc.)
  3. Your email address associated with your Unbound account