Skip to content

Use OpenCode with the Bokyaa router

Bokyaa team ·

OpenCode supports custom providers that speak the OpenAI-compatible format. The Bokyaa router serves that format, so you can add it as a provider.

Before you start

  1. In the Bokyaa app, open Router and add at least one provider connection.
  2. Create a router key. Router keys need a plan that includes them; see the pricing page. The key is shown once, so copy it then.

Configure the provider

Set the key in your shell so it never sits in a file:

export BOKYAA_API_KEY=sk-bky-...

Then define the provider in opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "providers": {
    "bokyaa": {
      "name": "Bokyaa router",
      "env": ["BOKYAA_API_KEY"],
      "package": "@opencode/ai/providers/openai-compatible",
      "settings": { "baseURL": "https://api.bokyaa.com/v1" },
      "models": { "auto": { "name": "Bokyaa auto" } }
    }
  }
}

Select the model as bokyaa/auto. This is the configuration format of OpenCode V2. OpenCode V1 uses a different schema, so follow the V1 documentation if you run V1.

Source

opencode.ai/docs/providers, custom provider section, read 2026-11-08. Tools change; if a step no longer matches, follow the tool's own page.