Nbility logoNbility Docs

Search documentation

Search guides and API reference content

Terminal & Agents

Connect OpenCode to Nbility

This page retains OpenCode V1 installation and provider / npm / options examples. For V2, start with the V2 configuration, reasoning effort, and variant guide, then check the current official Providers documentation for the credential entry and configuration supported by your runtime.

Completion path: create a key → store it with /connect → configure the provider → send a short test request → confirm it in Usage Logs.

Install OpenCode

Official installer:

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

Or use npm or Homebrew:

npm install -g opencode-ai
brew install anomalyco/tap/opencode

Store the credential

Start opencode and run:

/connect

Choose Other, enter nbility as the provider ID, and paste a key created on Token Management. The ID must match the configuration key below.

Configure the provider

Create opencode.json in the project root or at ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "nbility": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Nbility",
      "options": {
        "baseURL": "https://api.nbility.ai/v1"
      },
      "models": {
        "gpt-5.4": {
          "name": "GPT-5.4"
        },
        "claude-sonnet-4-6": {
          "name": "Claude Sonnet 4.6"
        }
      }
    }
  }
}

@ai-sdk/openai-compatible uses /v1/chat/completions. If a model explicitly requires /v1/responses, follow OpenCode's guidance and use @ai-sdk/openai; do not mix the two protocols.

Use Models as the source of truth and add or remove models entries as needed.

Use and troubleshoot

Restart OpenCode, run /models, and select nbility/<model-id>.

  • Provider missing: ensure the /connect ID and config key are both nbility.
  • 401: run opencode auth list, then use /connect to replace the credential.
  • 404: ensure baseURL includes /v1 and the npm adapter matches the endpoint protocol.
  • Tool calls fail: use a model with native tool-calling support. Chat API compatibility alone does not guarantee agent tools.

As an alternative to OpenCode credential storage, set options.apiKey to {env:NBILITY_API_KEY}. Never hardcode the real key.

For multiple models and the version-specific “Custom providers are unavailable on this server” message, see the OpenCode custom-provider troubleshooting guide. The CLI/TUI configuration documented here and the V2 app’s provider editor can have different support status.

Table of Contents