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

# OpenCode & CC-Switch with Global AI: Integration Guide

> Point OpenCode at Global AI by editing the Anthropic Base URL, or use CC-Switch to manage multiple Claude Code providers.

OpenCode and CC-Switch are tools built around command-line coding assistants. OpenCode is a standalone CLI. CC-Switch is a desktop utility for switching between multiple Claude Code providers.

## OpenCode

The [official OpenCode docs](https://opencode.ai/docs/) provide the full reference. This page covers only the key steps to connect it to Global AI.

<Steps>
  <Step title="Install OpenCode">
    Install with npm:

    ```bash Install OpenCode icon=terminal theme={null}
    npm install -g opencode-ai
    ```
  </Step>

  <Step title="Set the provider base URL">
    Edit `~/.config/opencode/opencode.json` (create it if missing):

    ```json ~/.config/opencode/opencode.json icon=file-code theme={null}
    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "anthropic": {
          "options": {
            "baseURL": "https://globalai.vip/v1"
          }
        }
      }
    }
    ```

    <Note>
      `~` is your home directory. On Windows this is `C:\Users\<your username>`.
    </Note>
  </Step>

  <Step title="Set the API key">
    Edit `~/.local/share/opencode/auth.json` and replace `anthropic.key` with your `sk-` key. We recommend creating a key in the claude code group at [/keys](https://globalai.vip/keys):

    ```json ~/.local/share/opencode/auth.json icon=file-code theme={null}
    {
      "anthropic": {
        "type": "api",
        "key": "sk-xxxxxxxxxxxxx"
      }
    }
    ```
  </Step>

  <Step title="Choose a model and start">
    Open a terminal and run `opencode`. Type `/models`, pick an Anthropic model such as `claude-sonnet-4-5`, and start chatting.
  </Step>
</Steps>

### UI configuration

If you prefer not to edit files by hand, open OpenCode's graphical settings, switch the provider to Anthropic, set Base URL to `https://globalai.vip/v1`, and set API Key to your token. Return to the main screen and pick your target model from the model selector.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Anthropic missing from the OpenCode model list">
    Check that `opencode.json` is at the correct path and that `auth.json` has a valid `anthropic.key`. Restart OpenCode after changes.
  </Accordion>
</AccordionGroup>


## Related topics

- [Claude Code with Global AI: CC Switch or Manual Setup](/en/clients/claude-code.md)
- [Global AI Client Integrations: Parameters and Selection](/en/clients/overview.md)
- [ChatGPT(Codex) with Global AI: CC Switch or Manual Setup](/en/clients/codex.md)
- [Cline & Roo Code with Global AI: Coding Agent Guide](/en/clients/coding-agents.md)
- [Global AI FAQ: Accounts, Tokens, Calls, and Billing](/en/faq.md)
