TL;DR
- Create openrouter.ai account & generate API key
- Optional but highly recommended: deposit $10
- Install VS Code
- Install VS Code extension: Claude Code for VS Code
- Update VS Code user config JSON
If you want to start your agentic AI development journey without breaking bank then this setup may be for you 💸
Openrouter.ai
OpenRouter provides a unified API to access all the major LLM models on the market. It also allows users to aggregate their billing in one place and keep track of all of their usage using our analytics.
Create account for free then generate an API key. The format of the key will look something like:
sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The free account will give us 50 free model requests/day. While this could be sufficient if we are just trying to create few simple scripts, we would want to consider to deposit 10 credits (or $10 at the time of writing) to unlock 1000 requests/day https://openrouter.ai/docs/faq#how-are-rate-limits-calculated
For this setup, we want to leverage openrouter/free router that will find and use any of the available free models https://openrouter.ai/openrouter/free
Claude Code for VS Code
Next, we need to install official Claude Code extension for VS Code vscode:extension/anthropic.claude-code. This extension will automatically handle the setup of Claude Code binary under the hood.
Finally, we just need to edit our User/settings.json. In Windows/Linux, we just need press Shift + Ctrl + P > Preferences: Open User Settings (JSON). Then add this claudeCode.environmentVariables below to the JSON object.
Save the setting and we are ready to code! 🚀
{
"claudeCode.environmentVariables": [
{
"name": "ANTHROPIC_AUTH_TOKEN",
"value": "sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
{
"name": "ANTHROPIC_API_KEY",
"value": ""
},
{
"name": "ANTHROPIC_BASE_URL",
"value": "https://openrouter.ai/api"
},
{
"name": "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY",
"value": "1"
},
{
"name": "ANTHROPIC_MODEL",
"value": "openrouter/free"
},
{
"name": "ANTHROPIC_DEFAULT_OPUS_MODEL",
"value": "openrouter/free"
},
{
"name": "ANTHROPIC_DEFAULT_SONNET_MODEL",
"value": "openrouter/free"
},
{
"name": "ANTHROPIC_DEFAULT_HAIKU_MODEL",
"value": "openrouter/free"
},
{
"name": "CLAUDE_CODE_SUBAGENT_MODEL",
"value": "openrouter/free"
}
],
"claudeCode.disableLoginPrompt": true,
"claudeCode.preferredLocation": "panel"
}
Success Story
Despite of using free models, this setup allow me to solve real world software development problem like migrating a Laravel 8 project to Laravel 12: it definitely took more than few prompts (planning, triggering phase by phase, then some troubleshooting) but it took only a day. Without agentic AI, I might spend days to read docs, dig stackoverflow, and plenty of trial-and-errors. So I’d say this is a big win 🏆



