orientxorientx

OpenCode

Terminal coding agent with Anthropic, OpenAI, or Gemini providers

OpenCode talks to custom providers through ~/.config/opencode/opencode.json. Use the Anthropic SDK package for Messages models, or the OpenAI / Google packages for the other two wire formats.

Anthropichttps://api.orientx.ai/v1 (@ai-sdk/anthropic)
OpenAIhttps://api.orientx.ai/v1 (@ai-sdk/openai)
Geminihttps://api.orientx.ai/v1beta (@ai-sdk/google)
AuthapiKey in the provider options
Config~/.config/opencode/opencode.json
Official docsProviders

Install

curl -fsSL https://opencode.ai/install | bash

Confirm with opencode --version.

Add a provider

Register a custom provider (opencode auth login → other), then write the config. Anthropic is the usual choice for coding agents:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "orientx": {
      "npm": "@ai-sdk/anthropic",
      "name": "orientx",
      "options": {
        "baseURL": "https://api.orientx.ai/v1",
        "apiKey": "sk-..."
      },
      "models": {
        "<MODEL_ID>": {
          "name": "<MODEL_ID>"
        }
      }
    }
  }
}

Replace <MODEL_ID> with an id from GET /v1/models. Add more keys under models as needed. For Chat Completions, switch npm to @ai-sdk/openai and keep the same /v1 base URL.

Run OpenCode

opencode

Type /models and pick the orientx provider.

@ai-sdk/anthropic expects the /v1 suffix on baseURL. Claude Code's ANTHROPIC_BASE_URL does not — that CLI appends /v1 itself.

On this page