VCodeX
For AI Tools & IDEs

opencode

Configure the opencode TUI agent to route requests through VCodeX.

opencode is an OpenAI-compatible terminal coding agent. Add VCodeX as a provider in its config file.

Prerequisites

  • opencode installed. See opencode.ai.
  • A VCodeX API key (sk-...).

1 · Get your VCodeX key

Dashboard → Settings → External KeysCreate key.

2 · Configure opencode

Edit ~/.config/opencode/config.json (create if missing):

{
  "provider": {
    "vcodex": {
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "https://app.vcodex.ai/v1",
        "apiKey": "sk-..."
      },
      "models": {
        "vcodex/auto": {},
        "anthropic/claude-sonnet-4.5": {}
      }
    }
  }
}

Then select the provider inside opencode with /model vcodex/vcodex/auto.

3 · Verify

Start opencode, type a prompt, and confirm the request lands in Observability → Requests with client_source: opencode.

Troubleshooting

  • Provider vcodex not found — JSON is malformed; run jq . ~/.config/opencode/config.json to validate.
  • Model … not available — add the model id to the models block above, or use vcodex/auto to let the gateway pick.
  • Requests still hit api.openai.com — opencode is using its default provider. Explicitly select /model vcodex/... in the session.

On this page