Skip to content

Commit bfc92bf

Browse files
committed
docs: Add API key precedence information to Claude Code provider documentation
1 parent 3c855a4 commit bfc92bf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/providers/claude-code.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ Once configured, Roo Code will use your local Claude CLI installation to interac
2020

2121
The Claude Code provider allows you to use Anthropic's Claude models through their official CLI (Command Line Interface) instead of the web API. This provides direct access to your Claude Max subscription right from Roo Code.
2222

23+
:::warning API Key Precedence
24+
The Claude Code provider executes the `claude` command-line tool, which is built on Anthropic's official SDKs. These SDKs are designed to automatically use the `ANTHROPIC_API_KEY` environment variable for authentication if it is set.
25+
26+
If you have this environment variable defined, it will take precedence over the CLI's internal login (`/login`). Roo Code will reflect that an API key is being used, which is the expected behavior of the underlying `claude` tool.
27+
:::
28+
2329
**Website:** [https://docs.anthropic.com/en/docs/claude-code/setup](https://docs.anthropic.com/en/docs/claude-code/setup)
2430

2531
---
@@ -86,8 +92,8 @@ The specific models available depend on your Claude CLI subscription and plan.
8692
## Common Questions
8793

8894
**"Do I need a Claude API key for this provider?"**
89-
- No! This provider uses your Claude CLI setup instead of the web API
90-
- You'll need the Claude CLI installed and authenticated on your system
95+
- No, the primary authentication method is the CLI's built-in `/login` command.
96+
- However, if the `ANTHROPIC_API_KEY` environment variable is set in your system, the Claude CLI will use it for authentication, and it will take precedence.
9197

9298
**"How do I install the Claude CLI?"**
9399
- Visit [Anthropic's CLI documentation](https://docs.anthropic.com/en/docs/claude-code/setup) for installation instructions

0 commit comments

Comments
 (0)