OpenCode
Wire: OpenAI. Base URL: https://sator-api.princep.org/v1. State: verified against OpenCode's provider configuration docs.
Install#
Follow opencode.ai for your platform. Any current version works.
Configure#
Put your key in the environment — OpenCode substitutes {env:…} at load time, so the key never sits in the file:
export SATOR_API_KEY=sk-sator-v1-...Add a sator provider to ~/.config/opencode/opencode.json (or a project's opencode.json). List each model you want under models, with its context and output limits from Models, because OpenCode does not discover limits for a custom provider:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"sator": {
"npm": "@ai-sdk/openai-compatible",
"name": "Princeps Sator",
"options": {
"baseURL": "https://sator-api.princep.org/v1",
"apiKey": "{env:SATOR_API_KEY}"
},
"models": {
"deepseek-v4-flash": {
"name": "DeepSeek V4 Flash",
"limit": { "context": 1000000, "output": 384000 }
}
}
}
},
"model": "sator/deepseek-v4-flash"
}Models are addressed as sator/<model id> — the provider key you chose, a slash, the id from the catalog.
Verify#
Start opencode in a project and ask for something small:
> Reply with exactly: ok
okThe model picker (/models) lists Princeps Sator with the models you configured. The request appears in your dashboard under the key you used, within a minute.
Troubleshooting#
- 404 on every request — the
baseURLis missing its/v1. This wire needs it. Incorrect API key provided—SATOR_API_KEYis not set in the shell OpenCode was started from, or the key was revoked.{env:SATOR_API_KEY}is substituted at startup, so export it before launching.- The model is missing from the picker — the id under
modelsmust match the catalog exactly (deepseek-v4-flash, notDeepSeek-V4-Flash). CheckGET /v1/models. - Responses cut off early —
limit.outputis what OpenCode sends asmax_tokens; set it to the model's max output.