> ## Documentation Index
> Fetch the complete documentation index at: https://docs.routerlink.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code

> Use Claude Code with RouterLink — bill against credits, no Anthropic subscription required.

> This documentation is provided for informational purposes only and demonstrates how to configure and use our API with third-party AI chat interfaces. Any third-party software, websites, or services mentioned are not operated, controlled, or endorsed by us.

# **Introduction to Claude Code**

<Frame>
  <img src="https://mintcdn.com/matrixlabs/PTmbSnPKvNvMTDFk/images/demo.gif?s=3ae2a21567abea01b4ef5aadded5af47" alt="Demo" width="1552" height="992" data-path="images/demo.gif" />
</Frame>

[**Claude Code**](https://github.com/anthropics/claude-code) is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

**Claude Code** Key Features:

* **Autonomous Action**: Reads/writes files, runs terminal commands, and fixes bugs directly.
* **Full Context**: Automatically understands the entire codebase without manual copy-pasting.
* **Safety & Control**: Supports one-click rollbacks and requires manual approval for key actions.
* **Tool Integration**: Supports custom complex workflows via SKILL.md.

## **Step**

<Steps>
  <Step title="Install Claude Code" stepNumber={1}>
    > If you have previously installed Claude Code, please run the following command in the terminal to update to the latest version. This may require administrator privileges.

    ```shellscript theme={null}
    claude update
    ```

    <Tip>
      Need a one-click configuration tool? Try [RouterLink Starter](https://routerlink.ai/?utm_source=chatgpt.com), officially released by RouterLink.
    </Tip>

    <Tabs>
      <Tab title="CLI - Node.js">
        RouterLink has already prepared installation scripts for you. You can run the following commands for one-click installation of Node.js and the corresponding coding agent.

        **macOS, Linux, WSL:**

        ```shellscript theme={null}
        curl -fsSL https://install.routerlink.ai/claude.sh | bash
        ```

        **Windows PowerShell:**

        ```shellscript theme={null}
        irm https://install.routerlink.ai/claude.ps1 | iex
        ```

        > Windows users may be unable to run scripts because of digital signature requirements. Please run the following command:\
        > **Windows PowerShell:**
        >
        > ```powershell theme={null}
        > Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force
        > ```

        **Or**, you can choose to **manually** install Node.js and the corresponding coding agent:

        Install [the newest LTS version of Node.js](https://nodejs.org/en/download/), and then use npm to install it globally in the terminal:

        ```shellscript theme={null}
        npm install -g @anthropic-ai/claude-code
        ```
      </Tab>

      <Tab title="CLI - Native Install">
        **macOS, Linux, WSL:**

        ```shellscript theme={null}
        curl -fsSL https://claude.ai/install.sh | bash
        ```

        **Windows PowerShell:**

        ```powershell theme={null}
        irm https://claude.ai/install.ps1 | iex
        ```

        **Windows CMD:**

        ```powershell theme={null}
        curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

        ```

        If you see `The token '&&' is not a valid statement separator`, you’re in PowerShell, not CMD. If you see `'irm' is not recognized as an internal or external command`, you’re in CMD, not PowerShell. Your prompt shows `PS C:\` when you’re in PowerShell and `C:\` without the `PS` when you’re in CMD.

        **Native Windows setups require [Git for Windows](https://git-scm.com/downloads/win).** Install it first if you don’t have it. WSL setups do not need it.

        Native installations automatically update in the background to keep you on the latest version.
      </Tab>

      <Tab title="VS Code Extension">
        **Install** the [**Claude Code** extension](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code) from the [VS Code](https://code.visualstudio.com/download) Marketplace — no separate CLI needed. The VS Code extension provides inline diffs, @-mentions, plan review, and conversation history directly in your editor.

        <Frame>
          <img src="https://mintcdn.com/matrixlabs/E_QmGFqMvoEFoQFp/images/image-94.png?fit=max&auto=format&n=E_QmGFqMvoEFoQFp&q=85&s=ded113f1c9a6aa0d724f6da96dd74512" alt="Image" width="1925" height="1149" data-path="images/image-94.png" />
        </Frame>
      </Tab>

      <Tab title="Desktop App">
        The Claude Desktop App is available on macOS and Windows.

        Please follow [the tutorial](https://code.claude.com/docs/en/desktop-quickstart) to complete the installation.
      </Tab>
    </Tabs>
  </Step>

  <Step title="Point Claude Code at RouterLink" stepNumber={2}>
    <Tabs>
      <Tab title="CLI — settings.json">
        Claude Code officially supports managing persistent configuration through the settings system. For daily use, it is recommended to prioritize writing configurations into `settings.json`. Shell or system environment variables are better suited for temporary switching, CI scenarios, or as a fallback when encountering known issues in the current version.

        **Edit or create** the settings.json file\
        On macOS & Linux: `~/.claude/settings.json`\
        On Windows: `C:\Users\<USERNAME>\.claude\settings.json`

        Make sure to replace `<ROUTERLINK_API_KEY>` with your API key from [RouterLink](https://routerlink.ai/settings/api-keys). When replacing it, do not keep the angle brackets `<` and `>`.

        ```json theme={null}
        {
          "env": {
            "ANTHROPIC_AUTH_TOKEN": "<ROUTERLINK_API_KEY>",
            "ANTHROPIC_BASE_URL": "https://router-link.world3.ai/api",
            "API_TIMEOUT_MS": "3000000",
            "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
            "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5",
            "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
            "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-8",
            "ANTHROPIC_DEFAULT_FABLE_MODEL": "claude-fable-5"
          }
        }
        ```
      </Tab>

      <Tab title="VS Code Extension">
        Open your VS Code `settings.json.`

        <img src="https://mintcdn.com/matrixlabs/rtNJA-5vn5jN1VUG/images/claude-code/vscode-settings.png?fit=max&auto=format&n=rtNJA-5vn5jN1VUG&q=85&s=703f2e05d13b7abaf51e82a67c3f3824" alt="VS Code Claude Code settings" width="1500" height="990" data-path="images/claude-code/vscode-settings.png" />

        Click **“Edit in settings.json”** under **Environment Variables**.

        <Frame>
          <img src="https://mintcdn.com/matrixlabs/PTmbSnPKvNvMTDFk/images/image-4.png?fit=max&auto=format&n=PTmbSnPKvNvMTDFk&q=85&s=7111634e0cbc3999b28f8ee06351f687" alt="Image" width="1200" height="762" data-path="images/image-4.png" />
        </Frame>

        Add the following content. Make sure to replace  with the `<ROUTERLINK_API_KEY>` obtained from [RouterLink Key](https://routerlink.ai/settings/api-keys).

        ```json theme={null}
        {
            "claudeCode.disableLoginPrompt": true,
            "claudeCode.preferredLocation": "panel",
            "claudeCode.environmentVariables": [
            {"name":"ANTHROPIC_AUTH_TOKEN","value":"<ROUTERLINK_API_KEY>"},
            {"name":"ANTHROPIC_BASE_URL","value":"https://router-link.world3.ai/api"},
            {"name":"ANTHROPIC_DEFAULT_HAIKU_MODEL","value":"claude-haiku-4-5"},
            {"name":"ANTHROPIC_DEFAULT_SONNET_MODEL","value":"claude-sonnet-4-6"},
            {"name":"ANTHROPIC_DEFAULT_OPUS_MODEL","value":"claude-opus-4-7"}
            ]
        }
        ```
      </Tab>

      <Tab title="Desktop App">
        Open the installed Claude Desktop app.

        * Click **Help** → **Troubleshooting** in the top menu bar.
        * In the submenu that appears, click **Enable Developer Mode**.
        * For Windows users, you can access the same options by clicking the menu button in the top-left corner of the Claude Desktop app.

        <Frame>
          <img src="https://mintcdn.com/matrixlabs/VZ_IuYYHQYrllrI6/images/img_v3_0212p_0c555764-7a1f-439d-ad0b-c5daef51e4hu-1.jpg?fit=max&auto=format&n=VZ_IuYYHQYrllrI6&q=85&s=d4639aeeed0fc3f7444c0eab7b9c7aac" alt="Img V3 0212p 0c555764 7a1f 439d Ad0b C5daef51e4hu" width="1916" height="1296" data-path="images/img_v3_0212p_0c555764-7a1f-439d-ad0b-c5daef51e4hu-1.jpg" />
        </Frame>

        * After Developer Mode is enabled successfully, a new **Developer** menu will appear in the top menu bar.
        * From the **Developer** menu, select **Configure Third-Party Inference...**.

        <Frame>
          <img src="https://mintcdn.com/matrixlabs/VZ_IuYYHQYrllrI6/images/img_v3_0212p_2bd65ee8-8d1e-46ba-9343-786dbc96b6hu-1.jpg?fit=max&auto=format&n=VZ_IuYYHQYrllrI6&q=85&s=ee0a76fbba7114098e1092090541b402" alt="Img V3 0212p 2bd65ee8 8d1e 46ba 9343 786dbc96b6hu" width="1236" height="376" data-path="images/img_v3_0212p_2bd65ee8-8d1e-46ba-9343-786dbc96b6hu-1.jpg" />
        </Frame>

        * Select "**Static API key"** for **Credential kind**.
        * Enter "**[https://router-link.world3.ai/api](https://router-link.world3.ai/api)"** as the **Gateway base URL**.
        * For **Gateway API key**, enter the actual API key you obtained from [RouterLink Key](https://routerlink.ai/settings/api-keys).

        <Frame>
          <img src="https://mintcdn.com/matrixlabs/VZ_IuYYHQYrllrI6/images/img_v3_0212p_8043532d-a2f1-4ac6-833d-f555a4922chu-1.jpg?fit=max&auto=format&n=VZ_IuYYHQYrllrI6&q=85&s=92dcf70193c327f3c48e82726da400d6" alt="Img V3 0212p 8043532d A2f1 4ac6 833d F555a4922chu" width="1800" height="1440" data-path="images/img_v3_0212p_8043532d-a2f1-4ac6-833d-f555a4922chu-1.jpg" />
        </Frame>

        * Scroll down the page and click "**Add model"**.
        * In the **Model ID** field, enter "**claude-opus-4-8"**, then click **Add**. Repeat the same steps to add "**claude-sonnet-4-6"** and "**claude-haiku-4-5"**.
        * **Offer 1M-context variant** can be enabled optionally.
        * Finally, click **Apply Changes**.

        <Frame>
          <img src="https://mintcdn.com/matrixlabs/VZ_IuYYHQYrllrI6/images/img_v3_0212p_11d8941c-120f-483c-b289-64dd885062hu-2.jpg?fit=max&auto=format&n=VZ_IuYYHQYrllrI6&q=85&s=9d760f1579cc38b3925c95931a297791" alt="Img V3 0212p 11d8941c 120f 483c B289 64dd885062hu" width="1800" height="1440" data-path="images/img_v3_0212p_11d8941c-120f-483c-b289-64dd885062hu-2.jpg" />
        </Frame>
      </Tab>
    </Tabs>
  </Step>

  <Step title="First launch">
    <Tabs>
      <Tab title="CLI">
        Navigate to your code working directory and run the `claude` command in the terminal to start using Claude Code.

        ```shellscript theme={null}
        claude
        ```

        When using Claude Code for the first time, you may be forced to log in to an Anthropic account.

        <Frame>
          <img src="https://mintcdn.com/matrixlabs/VANeLrIkhJdeIljB/images/login-1.png?fit=max&auto=format&n=VANeLrIkhJdeIljB&q=85&s=f4c9e4e8bebfbb88c8d1183d06524abb" alt="Login 1" width="840" height="227" data-path="images/login-1.png" />
        </Frame>

        1. Please follow the steps below to skip this process:
        2. Open or create the `.claude.json` file in the user’s home directory. The specific paths are as follows: macOS / Linux: `~/.claude.json` Windows: `C:\Users\<USERNAME>\.claude.json`
        3. Set the value of the `hasCompletedOnboarding` field to `true`.

        ```json theme={null}
        {
          "hasCompletedOnboarding": true
        }
        ```

        Save the file, then run `claude` again in the terminal.

        After launching, choose to trust Claude Code to access the files in the folder, as shown below:

        <Frame>
          <img src="https://mintcdn.com/matrixlabs/VANeLrIkhJdeIljB/images/down.jpg?fit=max&auto=format&n=VANeLrIkhJdeIljB&q=85&s=1b2c2d8e4a69dc4d260885d2011e9981" alt="Down" width="1132" height="400" data-path="images/down.jpg" />
        </Frame>

        Done! You can now use Claude Code normally.
      </Tab>

      <Tab title="VS Code Extension">
        Click the Claude icon on the left, then select “New session” to start using Claude Code for VS Code.

        <Frame>
          <img src="https://mintcdn.com/matrixlabs/VANeLrIkhJdeIljB/images/vscode.avif?fit=max&auto=format&n=VANeLrIkhJdeIljB&q=85&s=cc488a2d3496b2b1669d563c8b627326" alt="Vscode" width="1200" height="800" data-path="images/vscode.avif" />
        </Frame>

        Done! You can now use Claude Code for VS Code.
      </Tab>

      <Tab title="Desktop App">
        <Note>
          **Enable Virtualization on Windows**

          Cowork runs in a virtualized environment. On Windows, you must enable the **Virtual Machine Platform** feature first; otherwise, Cowork will not work properly after installation.

          Open **PowerShell** as an administrator and run the following command, then restart your computer:

          ```powershell theme={null}
          Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -All -NoRestart
          ```
        </Note>

        Open the **Claude Desktop App**, and you're ready to start using it! 🚀

        <Frame>
          <img src="https://mintcdn.com/matrixlabs/VZ_IuYYHQYrllrI6/images/img_v3_0212p_acd87bdb-d39f-49ae-b3f1-c0c7d38b40hu-1.jpg?fit=max&auto=format&n=VZ_IuYYHQYrllrI6&q=85&s=cf619c4f1df07cbda8bef9d63a7cc230" alt="Img V3 0212p Acd87bdb D39f 49ae B3f1 C0c7d38b40hu" width="2400" height="1600" data-path="images/img_v3_0212p_acd87bdb-d39f-49ae-b3f1-c0c7d38b40hu-1.jpg" />
        </Frame>
      </Tab>
    </Tabs>
  </Step>
</Steps>

# **Troubleshooting**

<AccordionGroup>
  <Accordion title="No response after entering a prompt / “You don’t have enough $WAI” error">
    Make sure your API input is correct. Due to the high token consumption of Anthropic models, the daily free quota may not support this model. Please top up your balance.
  </Accordion>

  <Accordion title="How can I switch to another model?">
    Claude Code only supports the Anthropic-format API. \
    Go to [https://routerlink.ai/models](https://routerlink.ai/models). Click on the model, set the API Format to “Anthropic,” and locate the `model` field in the code block.

    Copy the model name from the `model` field and replace it in the `settings.json` file above.

    <Frame>
      <img src="https://mintcdn.com/matrixlabs/VANeLrIkhJdeIljB/images/image-12.png?fit=max&auto=format&n=VANeLrIkhJdeIljB&q=85&s=34fdae24933ac33875d749391e7e060e" alt="Image" width="788" height="714" data-path="images/image-12.png" />
    </Frame>

    Open a new terminal window. Run `claude` to start Claude Code. Then enter `/model` to switch the model, and finally type `/status` to verify the model status.

    <Frame>
      <img src="https://mintcdn.com/matrixlabs/VANeLrIkhJdeIljB/images/img_v3_02115_9616c753-a33d-47d5-9e3d-dc70d79c24hu.jpg?fit=max&auto=format&n=VANeLrIkhJdeIljB&q=85&s=f3ab9a973e9931fcbc0bb722523f1dab" alt="Img V3 02115 9616c753 A33d 47d5 9e3d Dc70d79c24hu" width="1018" height="628" data-path="images/img_v3_02115_9616c753-a33d-47d5-9e3d-dc70d79c24hu.jpg" />
    </Frame>
  </Accordion>

  <Accordion title="Manual configuration changes not taking effect">
    If you have manually edited the `~/.claude/settings.json` file but the changes are not applied, please try the following:

    1. Close all Claude Code windows. Open a new terminal window and run `claude` again to restart.
    2. If the issue persists, try deleting the `~/.claude/settings.json` file and reconfigure the environment variables. Claude Code will automatically generate a new configuration file.
    3. Make sure the JSON format of the configuration file is correct. Check for issues such as incorrect variable names, missing commas, or extra commas. You can use an online JSON validator to verify the file.
  </Accordion>

  <Accordion title="How can I upgrade Claude Code?">
    Enter the following command in the terminal:

    ```shellscript theme={null}
    claude update
    ```
  </Accordion>

  <Accordion title="For more information">
    Please check [the official documentation](https://support.claude.com/en/articles/12386420-claude-code-faq). 
  </Accordion>
</AccordionGroup>
