opencode
opencode can use any OpenAI-compatible backend as a provider, including Otari.
Quick start
Create a key on the dashboard's API keys page.
Add Otari as a provider in your
opencode.jsonc:{ "provider": { "otari": { "npm": "@ai-sdk/openai-compatible", "name": "Otari", "options": { "baseURL": "https://api.otari.ai/api/v1", "apiKey": "{env:OTARI_API_KEY}" }, "models": { "z-ai/glm-5.3": {} } } } }Export the key and run opencode with a model:
export OTARI_API_KEY=<your-otari-key> opencode --model otari/z-ai/glm-5.3
models lists the models opencode offers from this provider, keyed by the name after otari/. A provider with none is not loaded, and opencode answers Provider not found: otari. baseURL ends in /api/v1; opencode adds /chat/completions itself. EU accounts use https://eu.api.otari.ai/api/v1, and a gateway you run uses its URL plus /api/v1. See Base URL.
Choosing a model
opencode names a model <provider id>/<model>, and everything after otari/ goes to Otari unchanged, so write it as Otari spells it. opencode offers only the models listed under models, so add that part as a key there before you use it:
On otari.ai, a catalog id such as
otari/deepseek/deepseek-v4.1-flashlets Otari choose the provider, andotari/anthropic:claude-sonnet-4-6pins one.On your own gateway, use
provider:modelfor a provider it has, such asotari/openai:gpt-4o.
See Model format and Listing available models.
To list only the open-weight models a key can use, ask the catalog for them: GET /api/v1/catalog/models?capability=open_weights. Each entry's selectors are the names to configure.
See also
Last updated
Was this helpful?
