Skip to content
Docs · 2026-05-25

TL;DR — Add jusInfer as a custom "openai" provider in ~/.opencode/config.json with base_url https://api.jusinfer.com/v1 and your jinf_ key. Set jusInfer-auto as the default model.

Use jusInfer with OpenCode

OpenCode is an open-source terminal coding agent from SST — Claude Code's open-source cousin. It supports any OpenAI-compatible endpoint, which makes jusInfer a one-line config change.

Why route OpenCode through jusInfer?

  • Cheaper. jusInfer picks the most cost-effective capable model per call. You stop paying frontier prices for tasks that don't need it.
  • Same UX. OpenCode behaves identically — autocomplete, edits, multi-file refactors all work.
  • Vendor-independent. Switch underlying models without touching OpenCode config.

30-second setup

1. Mint a jusInfer key

Sign in at jusinfer.com/logindashboardKeys tab → Mint key → copy the jinf_… token (shown once).

2. Configure OpenCode

OpenCode reads provider config from ~/.opencode/config.json. Add jusInfer as a custom OpenAI-compatible provider:

{
  "providers": {
    "jusinfer": {
      "type": "openai",
      "base_url": "https://api.jusinfer.com/v1",
      "api_key": "jinf_your_key_here",
      "models": ["jusInfer-auto"]
    }
  },
  "default_provider": "jusinfer",
  "default_model": "jusInfer-auto"
}

The model name jusInfer-auto is a virtual identifier — jusInfer picks the actual underlying model. You can also pass any provider-prefixed model id (e.g. anthropic/claude-sonnet) and jusInfer will honor it.

3. Run

opencode

Verify spend on your jusInfer dashboard → Usage tab.

Pinning a specific model

If you want to override the auto-selector for a session:

opencode --model "anthropic/claude-sonnet-4.5"
# or
opencode --model "openai/gpt-5"

jusInfer normalizes provider prefixes — you don't need accounts at each upstream provider.

What works

  • ✅ Streaming responses
  • ✅ Tool use (OpenCode's edit / shell / read primitives)
  • ✅ Multi-file context
  • ✅ System prompts
  • ✅ Image inputs (auto-routes to vision-capable model)

Limits

  • 60 RPM per key, 600 RPM per tenant (raisable in dashboard)
  • No model fallback at the SDK level — jusInfer handles upstream failures internally and retries with a different provider transparently.

Agent-readable raw markdown: /docs/opencode.md