Skip to content
ChatGPT API
Documentation

Documentation

OpenCode integration

Last updated:

Connect OpenCode to ChatGPT API so every OpenCode request uses our OpenAI-compatible endpoint.

Configure OpenCode

1. Install OpenCode

Download and install OpenCode for your operating system from the official website.

Download OpenCode

2. Add the provider configuration

The OpenCode configuration file is located at:

~/.config/opencode/opencode.jsonc

  • If the file does not exist yet, create it along with the required parent directories.
  • If you already have a configuration, open it and add or merge the provider.openai block with your existing settings.
opencode.jsonc
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "openai": {
      "options": {
        "baseURL": "https://api.llm-gate.tech/v1",
        "apiKey": "[Generated key]"
      }
    }
  }
}

3. Start OpenCode

After you save the file, every OpenCode request to the OpenAI provider will go through ChatGPT API. Replace [Generated key] with the key created in your dashboard.

Create API key