Skip to content
OPENCODE TERMINAL AGENT

OpenCode CLIMulti-model.

Follow these steps in a terminal window. Choose your computer below.

Before you start

Have your API key and some Outrun credit ready. Keep your key private.

Choose your computer

Open your computer’s Terminal app. Commands below are for this window.

Optional setup helperUse an AI assistant to walk through these steps

Copy the setup instructions into an AI assistant you already use. Review any file changes it suggests before allowing them.

Enter your API key directly in the app or local settings. Keep it out of the assistant’s chat.

Connection settingsShow
Connection settings
Provider baseURL: https://api.outrun.to/v1
Key variable: OUTRUN_API_KEY
First model: claude-opus-5-5

Get your key from Outrun → API keys and enter it privately in the app or local settings. Test with “Reply with OK only.” Tests use credit; check Activity before retrying.

Setup Steps

  1. 1
    Install Node.js first

    Use the Download Node.js link below and choose the LTS version for your computer. Follow its installation instructions, then close and reopen your terminal. Node.js includes npm, the program used by the Install Command below.

    Download Node.js (LTS)
  2. 2
    Install the tool

    Open Commands and settings below. Copy only the Install Command for your selected computer into your terminal and press Enter. Wait for it to finish.

  3. 3
    Open the settings file

    Find ~/.config/opencode/opencode.json. Open your home folder in the file manager and show hidden files (often Ctrl+H). ~ means your home folder; folders starting with a dot are hidden. Open the file in a text editor. If the folder or file is missing, create it.

  4. 4
    Add the Outrun settings

    Open Commands and settings below and copy the Configuration Template into this file. If the file already has settings, keep them and add only the Outrun provider/settings block. Save the file. Do not paste JSON or TOML settings into the terminal.

  5. 5
    Enter your key privately

    Use the Environment Setup commands for your computer below. Replace KEY with your own Outrun key in your local terminal or settings file. Never put the key in an AI chat or screenshot.

  6. 6
    Reopen and test

    Open a new terminal and run opencode. Use /models to choose an outrun/... model. Start a new chat and send: Reply with OK only. A short reply with no connection error means the first test worked. This request uses Outrun credit; check Activity if it is interrupted before trying again.

Commands and settings for LinuxShow
Install Command
npm install -g opencode-ai
# or: curl -fsSL https://opencode.ai/install | bash
macOS / Linux · OUTRUN_API_KEY
# Put your key in the OUTRUN_API_KEY variable (replace KEY with your own key).
# Add the line to whichever shell files you use, then open a new terminal.
echo 'export OUTRUN_API_KEY="KEY"' >> ~/.zshrc
echo 'export OUTRUN_API_KEY="KEY"' >> ~/.bashrc
source ~/.zshrc 2>/dev/null || source ~/.bashrc

# Check (prints only the first characters):

Replace KEY with your own key only in your local app, editor or terminal. Never send that key to an AI chat. Copy one command block at a time.

Configuration Template

Config JSON
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "outrun": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Outrun",
      "options": {
        "baseURL": "https://api.outrun.to/v1",
        "apiKey": "{env:OUTRUN_API_KEY}"
      },
      "models": {
        "claude-opus-5-5": {
          "name": "Claude Opus 5.5"
        },
        "claude-opus-5": {
          "name": "Claude Opus 5"
        },
        "claude-sonnet-5-5": {
          "name": "Claude Sonnet 5.5"
        },
        "claude-sonnet-5": {
          "name": "Claude Sonnet 5"
        },
        "claude-fable-5-1": {
          "name": "Claude Fable 5.1"
        },
        "claude-fable-5": {
          "name": "Claude Fable 5"
        },
        "gpt-6.1-sol": {
          "name": "GPT-6.1 Sol"
        },
        "gpt-6-sol": {
          "name": "GPT-6 Sol"
        },
        "gpt-6-astra": {
          "name": "GPT-6 Astra"
        },
        "gpt-5.6-sol": {
          "name": "GPT-5.6 Sol"
        },
        "gpt-5.6-terra": {
          "name": "GPT-5.6 Terra"
        },
        "gemini-3.8-flash": {
          "name": "Gemini 3.8 Flash"
        },
        "gemini-3.1-pro-preview": {
          "name": "Gemini 3.1 Pro Preview"
        },
        "gemini-3.7-flash": {
          "name": "Gemini 3.7 Flash"
        },
        "grok-4.7": {
          "name": "Grok 4.7"
        },
        "deepseek-v4-pro": {
          "name": "DeepSeek V4 Pro"
        },
        "deepseek-v4-flash": {
          "name": "DeepSeek V4 Flash"
        },
        "deepseek-v4.1-flash": {
          "name": "DeepSeek V4.1 Flash"
        },
        "kimi-k3": {
          "name": "Kimi K3"
        },
        "MiniMax-M3": {
          "name": "MiniMax M3"
        },
        "glm-5.3": {
          "name": "GLM 5.3"
        },
        "glm-5.3-flash": {
          "name": "GLM 5.3 Flash"
        },
        "glm-5.3-uncensored": {
          "name": "GLM 5.3 Uncensored"
        },
        "glm-5.3-flash-uncensored": {
          "name": "GLM 5.3 Flash Uncensored"
        },
        "glm-5.3-flash-abliterated": {
          "name": "GLM 5.3 Flash Abliterated"
        },
        "glm-5.3-abliterated": {
          "name": "GLM 5.3 Abliterated"
        },
        "deepseek-v4-pro-uncensored": {
          "name": "DeepSeek V4 Pro Uncensored"
        },
        "deepseek-v4.1-flash-abliterated-fast": {
          "name": "DeepSeek V4.1 Flash Abliterated Fast"
        },
        "deepseek-v4.1-flash-abliterated": {
          "name": "DeepSeek V4.1 Flash Abliterated"
        }
      }
    }
  },
  "model": "outrun/claude-opus-5-5"
}
Optional: test with a script (uses credit)Show
Test cURL
curl https://api.outrun.to/v1/chat/completions \
  -H "Authorization: Bearer $OUTRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-5","messages":[{"role":"user","content":"Reply with OK only."}],"max_tokens":16}' 

If something goes wrong

Key missing or rejected (401)

Copy your current key from API keys. Paste it only into the app’s key field or your local key variable, then save and reopen the app.

Not enough available credit (402)

Check Balance and the key’s spending cap. Another request may have temporarily reserved credit; read the message before adding funds.

Wrong URL, model or limit (400/404)

Copy the exact values above. Do not add an operation such as /chat/completions to a Base URL. For GLM, context is 1000000 and maximum output is 65536.

Busy or rate limited (429)

Wait for the active request to finish or the rate limit to reset. Avoid repeatedly submitting the same request.

Interrupted request or uncertain charge

Check Activity first. Keep the request ID for support; never include your key in a message or screenshot.

Model choices and service notes

OpenCode connects through the OpenAI-compatible provider package. The config sets up every Outrun text model (Claude, GPT, Gemini, Grok, DeepSeek, Kimi, MiniMax, GLM and Uncensored) with one key. The default is claude-opus-5-5; pick another with /models. If a request returns 402, check your account balance and key spending cap. For 429, read the error: wait for the active request to finish or the rate limit to reset. If a paid request is interrupted or its outcome is uncertain, check Activity before trying again; do not automatically repeat it. Choose an available model from Models & Pricing; paused models cannot be used.

Contact @outrunsupport