Coding agents

opencode

Configure a custom Chat Completions provider.

Success — tested

2026-10-10. Windows text smoke test against a local fake gateway. opencode 1.18.35.

opencode is a coding agent with a configurable provider catalog. Use @ai-sdk/openai-compatible for POST /v1/chat/completions.

Before you start

Complete the Quickstart: add credits, create a key, and copy a model ID from Marketplace. Choose a model with tool support for agent tasks. The example ID is claude-sonnet-5-5; replace it with your selection. Install opencode and enter your project directory.

Configure the tool

Set your key in the terminal.

macOS / Linux
export UNUSED_API_KEY='sk-unused-...'
export UNUSED_MODEL='claude-sonnet-5-5'

Create opencode.json at your project root on macOS, Linux, or Windows. Replace the model map key and the model selection together.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "unused/claude-sonnet-5-5",
  "provider": {
    "unused": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "unused.market",
      "options": {
        "baseURL": "https://unused.market/v1",
        "apiKey": "{env:UNUSED_API_KEY}"
      },
      "models": {
        "claude-sonnet-5-5": {
          "name": "claude-sonnet-5-5",
          "limit": { "context": 32000, "output": 4096 }
        }
      }
    }
  }
}

The unused/ prefix is the local provider name. The request uses the canonical model ID after that prefix. Run opencode, then choose this model with /models.

The example chooses a 32000-token context budget and a 4096-token output budget. Adjust them to fit the selected offer; they are not claims about the model's maximum.

Verify the connection

Ask: “Say hello in one sentence without using tools.” Then open Analytics → Requests. Find the new request by time and model. A response and a matching row confirm that traffic reached your account. This checks the connection, not the quality of repository edits.

Limits and troubleshooting

Keep @ai-sdk/openai-compatible: the @ai-sdk/openai provider can use Responses, which is unavailable here. Check the model's displayed context in Marketplace before increasing the example context budget. The current dashboard does not display each offer's output ceiling; reduce the 4096 example output budget if the gateway returns an output-limit error.

SymptomFix
Authentication errorRe-enter your unused.market key.
No usable offerCheck Marketplace, Routing, and the key's allowed models.
Credit or budget errorCheck Credits and the key's monthly limit; reduce the output budget if needed.
Stream stops after output startsFind the failure in Requests. A started stream is not retried on another offer.

Sources and verification

Version checked: 1.18.35, 2026-10-10. Official sources: custom providers, configuration.

On this page