# πŸš€ Free Claude Code + Aerolink Setup Guide by subh.expp 🎬

Hey family! Welcome back to **subh.expp**. If you want to use the powerful **Claude Opus 4.8** inside your terminal for *free* (or super cheap) using the **Aerolink** gateway, you are in the right place! 

Follow this quick guide to set everything up in less than 2 minutes. πŸ‘‡

---

## πŸ”‘ Step 1: Get Your Aerolink API Key
1. Go to the official website: **[aerolink.lat](<https://aerolink.lat>)** 🌐
2. Sign up and verify your account using their **Telegram Bot** (this links your phone number and activates your account).
3. Go to the **API Keys** section, click **Create Key**, and copy your secret key (it looks like `aero_live_...`). πŸ—οΈ

---

## πŸ€– Step 2: Feed This Prompt to Your AI Assistant
Copy the prompt below and paste it into **any AI Coding Assistant** (like Gemini, Cursor, Cline, or Copilot) running on your computer. It will automatically install Claude Code and configure the settings for you!

```text
Hey! Please set up Claude Code on my system to use the Aerolink API gateway. 

Here are the details:
- Base URL: <https://capi.aerolink.lat/>
- Model: claude-opus-4-8
- Key: <PASTE_YOUR_AEROLINK_KEY_HERE>

Please write this configuration directly to my ~/.claude/settings.json file in the correct format:
{
  "theme": "light",
  "env": {
    "ANTHROPIC_BASE_URL": "<https://capi.aerolink.lat/>",
    "ANTHROPIC_API_KEY": "<PASTE_YOUR_AEROLINK_KEY_HERE>",
    "ANTHROPIC_MODEL": "claude-opus-4-8",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "model": "sonnet[1m]",
  "apiKeyHelper": "echo '<PASTE_YOUR_AEROLINK_KEY_HERE>'"
}

If Claude Code is not installed on my system, please install it globally using `npm install -g @anthropic-ai/claude-code` first.

πŸ’» Step 3: Run Claude Code!

Once the AI assistant completes the setup:

  1. Open your terminal. πŸ–₯️
  2. Run the following command:
    claude
    
  3. Boom! You are now chatting with Claude Opus 4.8 directly in your terminal. πŸ”₯

Created with ❀️ for the subh.expp community.

⚑ Gateway Switcher β€” Switch Between Free Claude Code APIs Instantly

🎬 Add-on guide by subh.expp β€” Use this alongside the main Claude Code setup guide!

Tired of being stuck on one gateway? This tool lets you switch between 5+ free Claude Code API gateways with one click β€” no more editing JSON files manually! πŸ”₯


🌐 Supported Gateways

Gateway Models Available How to Get Key
πŸš€ Agent Router Claude Opus 4.8, GPT-5, DeepSeek V3.1 agentrouter.org/console/token
✈️ Aerolink Claude Opus 4.6, Claude Sonnet aerolink.lat β†’ Telegram verify
🧠 FreeModel AI Claude Opus, Claude Sonnet freemodel.dev
🌐 OpenRouter 100+ models (Claude, GPT, Llama, etc.) openrouter.ai/keys
βš™οΈ Custom Any Anthropic-compatible endpoint Your own server

πŸ“¦ Step 1: Install the Gateway Switcher

Copy-paste this into your terminal: πŸ‘‡

# Clone or download the gateway-switcher folder
# Then run these commands:
cd gateway-switcher
npm install

That's it β€” one dependency (Express.js), installs in 3 seconds. ⚑


πŸš€ Step 2: Start the Switcher

npm run dev

You'll see:

  ⚑ Gateway Switcher running at:
  β†’ <http://localhost:3847>

  πŸ“ Config path: ~/.claude/settings.json

Now open http://localhost:3847 in your browser! 🌐


🎯 Step 3: Switch Gateways (One-Click!)

  1. πŸƒ Click any gateway card (Agent Router, Aerolink, FreeModel, OpenRouter, etc.)
  2. πŸ”‘ Paste your API key in the input field on the card
  3. πŸ”Œ Hit "Test Connection" to verify it works
  4. πŸš€ Hit "Apply to Claude Code" β€” it writes directly to ~/.claude/settings.json!
  5. πŸ”„ Restart Claude Code in your terminal:
    claude
    
  6. βœ… Done! You're now on the new gateway! πŸŽ‰

πŸ’‘ Pro tip: Your API keys are saved in your browser β€” you won't have to re-enter them when switching back and forth!


πŸ€– Automated Setup Prompt

Want to set this all up automatically? Copy this prompt into any AI coding assistant: πŸ‘‡

Hey! Please set up the Claude Code Gateway Switcher on my system.

Steps:
1. Create a folder called "gateway-switcher" in my current project directory
2. Create these files:

package.json:
{
  "name": "gateway-switcher",
  "version": "1.0.0",
  "type": "module",
  "scripts": { "dev": "node server.js" },
  "dependencies": { "express": "^5.1.0" }
}

3. Create server.js β€” an Express server on port 3847 that:
   - Serves static files from a "public" folder
   - GET /api/config β†’ reads ~/.claude/settings.json and returns it as JSON
   - POST /api/config β†’ writes the request body to ~/.claude/settings.json
   - GET /api/test β†’ tests a connection to a given provider URL + API key

4. Create public/index.html, public/style.css, public/app.js β€” a dark-mode web UI with:
   - Cards for these gateways: Agent Router (agentrouter.org), Aerolink (capi.aerolink.lat), FreeModel AI (cc.freemodel.dev), OpenRouter (openrouter.ai/api), and a Custom option
   - Each card has an API key input field
   - "Apply to Claude Code" button that POSTs the config to the server
   - "Test Connection" button that calls GET /api/test
   - Shows a preview of the generated settings.json
   - Premium dark UI with gradients, animations, and JetBrains Mono code font

5. Run npm install
6. Start the server with npm run dev
7. Open <http://localhost:3847> in my browser

πŸ”§ How It Works (Under the Hood)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Browser (localhost:3847)      β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚   β”‚ Click "Apply" button  β”‚     β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚              β”‚ POST /api/config β”‚
β”‚              β–Ό                  β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚   β”‚   Express Server      β”‚     β”‚
β”‚   β”‚   (server.js)         β”‚     β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚              β”‚ fs.writeFileSync β”‚
β”‚              β–Ό                  β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚   β”‚ ~/.claude/settings.jsonβ”‚    β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚              β”‚                  β”‚
β”‚              β–Ό                  β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚   β”‚  Claude Code reads it β”‚     β”‚
β”‚   β”‚  on next startup      β”‚     β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸŽ“ Quick Config Reference

Each gateway needs a different settings.json. Here's what each one looks like:

πŸš€ Agent Router

{
  "env": {
    "ANTHROPIC_API_KEY": "sk-YOUR_AGENT_ROUTER_KEY",
    "ANTHROPIC_AUTH_TOKEN": "sk-YOUR_AGENT_ROUTER_KEY",
    "ANTHROPIC_BASE_URL": "<https://agentrouter.org/>",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "apiKeyHelper": "echo 'sk-YOUR_AGENT_ROUTER_KEY'"
}

✈️ Aerolink

{
  "env": {
    "ANTHROPIC_API_KEY": "aero_live_YOUR_KEY",
    "ANTHROPIC_BASE_URL": "<https://capi.aerolink.lat/>",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "apiKeyHelper": "echo 'aero_live_YOUR_KEY'"
}

🧠 FreeModel AI

{
  "env": {
    "ANTHROPIC_API_KEY": "fe_oa_YOUR_KEY",
    "ANTHROPIC_BASE_URL": "<https://cc.freemodel.dev/>",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "apiKeyHelper": "echo 'fe_oa_YOUR_KEY'"
}

🌐 OpenRouter

{
  "env": {
    "ANTHROPIC_API_KEY": "sk-or-v1-YOUR_KEY",
    "ANTHROPIC_BASE_URL": "<https://openrouter.ai/api/>",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "apiKeyHelper": "echo 'sk-or-v1-YOUR_KEY'"
}

❓ FAQ

Q: Do I need to restart Claude Code after switching? A: Yes! Just close the current claude session and run claude again. It re-reads settings.json on startup. πŸ”„

Q: Can I use this to switch mid-conversation? A: No β€” you need to exit and re-launch claude for the new gateway to take effect.

Q: My gateway shows "Test Failed" β€” what do I do? A: Double-check your API key is correct, and that you've verified your account on that gateway's website. Some gateways require Telegram or email verification first. πŸ”‘

Q: Can I add more gateways? A: Yes! Open public/app.js and add a new entry to the PROVIDERS array. The UI updates automatically. βš™οΈ


Made with ⚑ by subh.expp β€” Switch gateways, not vibes.