Using Claude Code with AI-VERDE¶
Claude Code is Anthropic's official CLI coding assistant. AI-VERDE can serve as the backend for Claude Code, routing requests through AI-VERDE's budget controls and guardrails to Anthropic Claude models hosted on AWS Bedrock.
Tip
If your course or team's Claude models are hosted on AWS Bedrock, we recommend using this Bedrock-style setup with Claude Code rather than the Anthropic-style setup. Ask your instructor or team lead if you're unsure where your models are hosted.
Note
Unlike the non-Bedrock Claude Code setup, which uses ANTHROPIC_API_KEY, the Bedrock setup must put your AI-VERDE API key in ANTHROPIC_AUTH_TOKEN. When talking to a Bedrock endpoint, Claude Code only sends ANTHROPIC_AUTH_TOKEN; an ANTHROPIC_API_KEY would be ignored.
Prerequisites¶
- Obtain your AI-VERDE API key and note the AI-VERDE base URL. The base URL used in the environment variables ends in
/bedrockrather than/v1. Instructions can be found here. - Note the Claude model ID for Opus, Sonnet, and Haiku. Instructions for listing available models can be found here. Model names in AI-VERDE are prefixed with an identifier for your course or team, separated by a dash or a slash (e.g.
my-team-claude-sonnet-5ormy-team/claude-sonnet-5). - Install Claude Code. Instructions can be found at https://code.claude.com/docs/en/setup.
- The remaining instructions assume a terminal on macOS or Linux with bash and Claude Code installed. On Windows, Option 1 below works the same way, with the file at
%USERPROFILE%\.claude\settings.json.
1. Configure Claude Code¶
Option 1: ~/.claude/settings.json (recommended)¶
Add the following env section to ~/.claude/settings.json (create the file if it does not exist). Settings in this file apply every time you run Claude Code, in any terminal.
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "<your-ai-verde-api-key>",
"ANTHROPIC_BEDROCK_BASE_URL": "https://llm-api.cyverse.ai/bedrock",
"CLAUDE_CODE_SKIP_BEDROCK_AUTH": "1",
"CLAUDE_CODE_USE_BEDROCK": "1",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "<model name for opus>",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "<model name for sonnet>",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "<model name for haiku>"
}
}
For example:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxxxxxxxx",
"ANTHROPIC_BEDROCK_BASE_URL": "https://llm-api.cyverse.ai/bedrock",
"CLAUDE_CODE_SKIP_BEDROCK_AUTH": "1",
"CLAUDE_CODE_USE_BEDROCK": "1",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "my-team-claude-opus-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "my-team-claude-sonnet-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "my-team-claude-haiku-4-5"
}
}
If the file already has other settings, add the env section alongside them rather than replacing the file.
Warning
~/.claude/settings.json holds your API key. Keep the key in this user-level file, not in a project's .claude/settings.json, and don't commit or share it.
Option 2: Shell environment variables¶
Alternatively, export the same variables in your terminal before launching Claude Code:
export ANTHROPIC_AUTH_TOKEN="<your-ai-verde-api-key>"
export ANTHROPIC_BEDROCK_BASE_URL=https://llm-api.cyverse.ai/bedrock
export CLAUDE_CODE_SKIP_BEDROCK_AUTH=1
export CLAUDE_CODE_USE_BEDROCK=1
export ANTHROPIC_DEFAULT_OPUS_MODEL="<model name for opus>"
export ANTHROPIC_DEFAULT_SONNET_MODEL="<model name for sonnet>"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="<model name for haiku>"
Exported variables only last for the current terminal session. To avoid re-entering them each session, add the lines to your shell profile (e.g. ~/.bashrc or ~/.zshrc), then source your shell profile.
Note
To obtain the AI-VERDE Bedrock Base URL, simply substitute /v1 with /bedrock, e.g. https://llm-api.cyverse.ai/v1 to https://llm-api.cyverse.ai/bedrock. If both ~/.claude/settings.json and your shell set the same variable, the value in ~/.claude/settings.json is used.
2. Launch Claude Code¶
Start Claude Code:
claude
You can run /status inside Claude Code to confirm it is using Amazon Bedrock with the AI-VERDE base URL.
If you need to change your API Key¶
If for some reason you need to change your AI-VERDE API key, update ANTHROPIC_AUTH_TOKEN wherever you set it in step 1 (~/.claude/settings.json or your shell profile), then restart Claude Code.