Skip to main content

Claude Code - use free model

Use claude code free models, follow below steps:

1. Install claude code cli (with node + npm)

        npm install -g @anthropic-ai/claude-code

2. Configure Claude Code using a project-level settings file at .claude/settings.local.json in your project root:

Add below in file
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://openrouter.ai/api",
    "ANTHROPIC_AUTH_TOKEN": "<your-openrouter-api-key>",
    "ANTHROPIC_API_KEY": "",
    "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1"
  },
      "model": "openrouter/free",
      "theme": "dark"
}

replace <your-openrouter-api-key> with actual openrouter api key generated at the openrouter.ai









 1. MCP server

2. Skills


VsCode Addon

: @ to select different path - folders/subfolders/files




alt M to keep edit mode 


Comments

Popular posts from this blog

API Basics

 

Algorithm solving Common Patterns & Techniques

  These are targeted data manipulation strategies used to handle arrays, strings, and linked lists efficiently. Two Pointers : Uses two reference pointers to iterate through a data structure simultaneously, typically from opposite ends or at different speeds (Fast & Slow pointers). Sliding Window : Maintains a subset of data (a "window") over a sequential structure to track running statistics without recalculating the whole set. Prefix Sum : Pre-computes and stores cumulative sums of an array to allow for \(O(1)\) constant-time range sum queries. Dynamic Programming (DP ): Dynamic programming is an optimization technique used to solve problems by breaking them down into simpler subproblems and storing the results of these subproblems to avoid redundant computations. It is particularly effective for problems exhibiting overlapping subproblems and optimal substructure. Greedy Algorithm Breadth-First Search (BFS) / Depth-First Search (DFS) : Systematic graph and tree travers...