← Docs

Set up Claude CLI

Use the Claude models in your LaRouter plan with the claude command in Terminal on Mac, Linux or Windows.

Option A · Fastest

1-click setup file

Download one file and open it. It installs Claude CLI and connects it to LaRouter with your key. You need a LaRouter account with a plan.

  1. Download the file

    Loading your key…

    The file is made in your browser and contains your key: don't share it, and delete it after use. Before changing a settings file it saves a copy next to it (names ending in .bak-…). Those copies can hold a key too, so delete them once everything works.

    On Linux? Use the manual setup below: one command in a terminal.

  2. Open the file

    The first time you open a file from the web, your computer warns you. This is how to get past it.

    macOS

    1. 1. Open the zip file in Downloads (Safari unzips it for you). Right-click the setup file, choose Open, then click Open again.

      The Downloads folder with the LaRouter setup file selected and Open highlighted in the right-click menu
    2. 2. On macOS 15 and later you see "LaRouter setup" Not Opened instead. Click Done.

      Warning dialog reading "LaRouter setup" Not Opened, with the Done button highlighted
    3. 3. Go to System Settings > Privacy & Security, scroll to Security and click Open Anyway. Confirm, and the setup runs.

      Privacy & Security settings saying "LaRouter setup" was blocked, with the Open Anyway button highlighted

    Windows

    1. 1. Open the .cmd file in Downloads. If a blue "Windows protected your PC" screen appears, click More info.

      Blue "Windows protected your PC" screen with the More info link highlighted
    2. 2. Click Run anyway. The setup runs in a window. Windows asks for permission a few times while the apps install: click Yes each time. The window says Done when it finishes.

      The same blue screen after More info, with the Run anyway button highlighted

    This is the normal warning for any small file that isn't from an app store. You can open it in a text editor and read it first.

  3. Check it works

    When the file says Done, open a new Terminal window (PowerShell on Windows) and type the command it shows: claude or codex. Send any message: the reply comes through LaRouter.

Option B

Manual setup

Prefer to see every step, or on Linux? Set up Claude CLI by hand: the commands below already include your key when you are signed in.

The video is in Vietnamese; the written steps below are the same.

What you need

  • A LaRouter account
  • Claude CLI installed (install steps below)
  • Nothing else to install: the setup command uses tools already on your computer
  • About 2 minutes
How to install Claude CLI
Mac / Linux (Terminal)
curl -fsSL https://claude.ai/install.sh | bash
Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex

Loading your API key…

Connect Claude CLI to LaRouter

  1. Open Terminal. On a Mac, press Command + Space, type Terminal and press Return. On Windows, open the Start menu, type PowerShell and press Enter.

  2. Copy the command for your computer, paste it into the window and press Enter.

    Mac / Linux
    curl -fsSL https://larouter.lapage.vn/setup/claude.sh | LAROUTER_KEY='YOUR_API_KEY' bash
    See what this command does

    It downloads a short LaRouter script and runs it on your computer. The script adds LaRouter to your settings file, keeps everything else, and saves a backup first. Your key is passed in by the command and saved only in that file on your computer; it is never part of the script. Read the script

  3. Wait for the message "Done. LaRouter is set up". Your other settings stay as they were, and a backup copy is saved next to them.

  4. If Claude CLI is already running, type /exit and start it again.

Check it works

  1. In Terminal, type claude and press Enter.

  2. Type /status and press Enter. The line Anthropic base URL should show i-larouter.lapage.vn.

  3. Ask something simple, such as "Say hello". If you get an answer, it works.

Common problems

Claude CLI shows a login screen.
Run the command from step 2 again, then open a new Terminal window and type claude. If it still asks, type /logout inside Claude CLI and start it again.
I see "not valid JSON. Nothing was changed".
Your settings file has a typing mistake, so the command left it alone. Fix it with "Set it up by hand" below, or rename the file and run the command again.
Terminal says "command not found" for claude.
Claude CLI isn't installed yet, or Terminal was open during the install. Install it (see What you need), then open a new Terminal window.
Terminal says "curl: command not found" (Linux).
Some Linux computers don't have curl. Use this command instead; it does the same thing with wget.
Mac / Linux
wget -qO- https://larouter.lapage.vn/setup/claude.sh | LAROUTER_KEY='YOUR_API_KEY' bash
The command didn't work? Set it up by hand
  1. Open the hidden .claude folder. On a Mac, open Finder, press Command + Shift + G, paste the Mac address and press Return. On Windows, press Windows + R, paste the Windows address and press Enter. If the folder doesn't exist, create a folder named .claude in your home folder.

    Mac
    ~/.claude
    Windows
    %USERPROFILE%\.claude
  2. Open the file settings.json with TextEdit or Notepad. If it isn't there, create it, paste the whole box below and skip to the last step.

    New file
    {
      "env": {
        "ANTHROPIC_BASE_URL": "https://i-larouter.lapage.vn/v1",
        "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY"
      }
    }
  3. If the file already has content, don't replace it. Find the line "env": { and paste these two lines just below it. If there's no "env" line, paste the second box just below the first { in the file.

    Two lines to add
        "ANTHROPIC_BASE_URL": "https://i-larouter.lapage.vn/v1",
        "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    If there's no "env" line
      "env": {
        "ANTHROPIC_BASE_URL": "https://i-larouter.lapage.vn/v1",
        "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY"
      },
  4. Save the file, then start Claude CLI again.

Agent skills

Skills let your agent use more LaRouter models. Install one, then ask your agent in plain words.