Skip to main content
OpenCode can call Phaseo through a custom OpenAI-compatible provider. Use this setup when you want OpenCode model selection, usage, and routing to go through one Phaseo API key.

Prerequisites

  • A Phaseo API key.
  • OpenCode installed locally.

1) Set your API key

export PHASEO_API_KEY="your_phaseo_api_key"
$env:PHASEO_API_KEY = "your_phaseo_api_key"

2) Add an OpenCode provider

Create or update opencode.json in your project, or your global OpenCode config:
{
  "$schema": "https://opencode.ai/config.json",
  "model": "phaseo/openai/gpt-5.5",
  "provider": {
    "phaseo": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Phaseo",
      "options": {
        "baseURL": "https://api.phaseo.ai/v1",
        "apiKey": "{env:PHASEO_API_KEY}"
      },
      "models": {
        "openai/gpt-5.5": {
          "name": "GPT-5.5"
        },
        "openai/gpt-5.4-mini": {
          "name": "GPT-5.4 Mini"
        },
        "anthropic/claude-sonnet-4.5": {
          "name": "Claude Sonnet 4.5"
        }
      }
    }
  }
}
Add or remove models from the models object to match the Phaseo model ids you want in OpenCode.

3) Start OpenCode

Restart OpenCode after editing the config, then choose the Phaseo model from /models.

Verification

  • Run a small prompt before using file-editing workflows.
  • If a model is rejected, confirm the exact id with the Models endpoint.
  • If authentication fails, confirm PHASEO_API_KEY is set in the same shell that starts OpenCode.

Add docs context

To let OpenCode read Phaseo docs during a session, add the Docs MCP server as well.
Last modified on July 9, 2026