Claude Code Integration with The Grid | Anthropic API Setup
Use Claude Code with The Grid through the Anthropic Messages API. Set environment variables, map model aliases, and run Claude Code normally.
Prerequisites
Setup
1. Create ~/.claude/settings.json
~/.claude/settings.json{
"apiKeyHelper": "~/.claude/thegrid_key.sh",
"env": {
"ANTHROPIC_BASE_URL": "https://messages-beta.api.thegrid.ai",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "code-prime",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "code-standard",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "code-max",
"CLAUDE_CODE_SUBAGENT_MODEL": "code-standard"
}
}2. Create the API key helper script
3. Make the helper script executable
4. (Optional) Pin specific Anthropic versions with modelOverrides
5. Start Claude Code
Verification
Troubleshooting
Last updated
Was this helpful?