Guide · opencode
Connect opencode to Synap
-
Get a free key
Sign in with Google at synap.linkrra.com — no card. Your key starts with
sk-pool-. -
Install opencode
One npm package. Nothing else to set up.
npm i -g opencode-ai -
Add Synap as a provider
Drop this
opencode.jsonin your project root. List every model id you want — opencode does not read the catalogue for a custom provider.{ "$schema": "https://opencode.ai/config.json", "provider": { "synap": { "npm": "@ai-sdk/openai-compatible", "name": "Synap", "options": { "baseURL": "https://synap.linkrra.com/v1", "apiKey": "sk-pool-..." }, "models": { "qwen3-coder-30b": { "name": "Qwen3 Coder 30B" } } } }, "model": "synap/qwen3-coder-30b" } -
Give it a job
Headless with
run, or open the TUI and type. It edits your files itself.opencode run "implement fizzbuzz in fizz.py"
Notes, prices and limits
One provider block in opencode.json. Recommended model: qwen3-coder-30b —
$0.0675 in and $0.27 out
per 1M tokens, 98,304-token context.
Run live against this API on opencode-ai 1.19.5: the full agentic loop — it globbed the file, read it, called its own edit tool and wrote working code, and opencode run exited 0.
Models must be listed under provider.synap.models. opencode does not read /v1/models for a custom provider, so add an entry per id you want; opencode models then lists them as synap/<id>.
The top-level model key makes it the default, so -m is optional.
Piped into another command, opencode run can print nothing at all and still exit 0 while it works — and the very first run is slow, because that is when it fetches the provider package. Add --print-logs if you want to see what it is doing.
The same block works in ~/.config/opencode/opencode.json if you would rather set it once for every project. There is no environment-variable shortcut for a custom provider.
On the free tier: every request counts input and output against 100,000 free tokens a day, and answers stop at 4,096 output tokens. Coding agents send long prompts, so the free tier covers a short session; credits cover the rest.
Field names from opencode docs: custom providers, and opencode 1.19.5 run against this API, checked 2026-11-03 20:20 UTC. Prices refresh from /v1/models when this page loads.