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

# OpenCode

[OpenCode](https://opencode.ai/) is an open-source coding agent for the terminal, IDE, and desktop.

This guide configures GeekAI as a model provider for the terminal client.

### Quick start

Install OpenCode using the installation script:

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

![Installing OpenCode](https://static.geekai.co/storage/2026/02/25/image-20260225234457882.png)

In the root of your project, create `opencode.json` with the following provider configuration:

```json theme={null}
{
    "$schema": "https://opencode.ai/config.json",
    "provider": {
        "geekai": {
            "npm": "@ai-sdk/openai-compatible",
            "name": "GeekAI",
            "options": {
                "baseURL": "https://geekai.co/api/v1",
                "apiKey": "<YOUR_GEEKAI_API_KEY>"
            },
            "models": {
                "gpt-5.3-codex": {
                    "name": "GPT-5.3 Codex"
                },
                "claude-sonnet-4-6": {
                    "name": "Claude Sonnet 4.6"
                },
                "gemini-3.1-pro-preview": {
                    "name": "Gemini 3.1 Pro Preview"
                }
            }
        }
    }
}
```

> [!NOTE]
>
> Replace `<YOUR_GEEKAI_API_KEY>` with your [GeekAI API key](https://geekai.co/user/api_keys). To use [GeekAI International](https://geekai.dev), set `baseURL` to `https://geekai.dev/api/v1` and use a [key issued by the international service](https://geekai.dev/user/api_keys).

Save the file and start OpenCode:

```bash theme={null}
opencode
```

![Starting OpenCode](https://static.geekai.co/storage/2026/02/26/image-20260226111621634.png)

> [!NOTE]
>
> If you see `opencode: command not found`, open a new terminal or reload your shell configuration with `source ~/.bashrc` (Bash) or `source ~/.zshrc` (Zsh).

Enter a coding request in plain language:

![Coding with OpenCode through GeekAI](https://static.geekai.co/storage/2026/02/26/image-20260226113011165.png)

To switch models, run `/models` and choose a model from the list:

![Choosing a model in OpenCode](https://static.geekai.co/storage/2026/02/26/image-20260226112554508.png)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.