Skip to main content
Use this guide to route OpenCode model calls through Nusabase API. The Nusabase OpenAI-compatible Base URL is https://api.nusabasedigital.com/v1.

When To Use This

  • You want project-level model configuration.
  • You want to use Nusabase through an OpenAI-compatible endpoint.
  • You want different repositories to use different models or API keys.

Prerequisites

  • OpenCode is installed.
  • You have a Nusabase API key: sk-....
  • Your machine can reach https://api.nusabasedigital.com.
  • The example model qwen3.5-flash appears in the current pricing docs. Use GET /v1/models as the source of truth for your account.

Verify Nusabase First

Configure OpenCode

OpenCode uses the provider config key, not providers. Create or update opencode.json in your project root:
To avoid storing the key in project config, reference an environment variable:

Start And Verify

In OpenCode, send:
Success criteria:
  • curl /v1/models returns a model list.
  • curl /v1/chat/completions returns valid JSON.
  • OpenCode can use nusabase/qwen3.5-flash for the first reply.

Troubleshooting

Next, see First Request Example for the underlying API format.

References