Set Up ASI:One in OpenCode
Overview
ASI:One is OpenAI-compatible,
so OpenCode can use it as a custom provider through the
OpenAI-compatible runtime package. You declare the provider, its endpoint, and its
models in opencode.json, then store your API key with OpenCode’s credential
commands.
Custom providers like ASI:One are not loaded from ASI:One’s
GET /v1/models. OpenCode reads the model
list and context limits from your config. Built-in providers on
Models.dev can pull metadata from that catalog; your asi
block is the source of truth for ASI:One.
Prerequisites
- OpenCode v2 installed and on your
PATH. - An ASI:One API key. Create one at asi1.ai/developer.
Keys start with
sk_. - An ASI:One plan that includes
asi1-ultra. The same key also works forasi1andasi1-mini.
Add the provider
Create or edit opencode.json or opencode.jsonc at the root of your project.
OpenCode v2 expects a providers object. Each provider needs
settings.baseURL. Without it, sessions fail with an error about the route
missing an endpoint.
To make ASI:One available in every project, put the same providers.asi block in
~/.config/opencode/opencode.json instead.
Older configs that used provider, npm, and options still load on OpenCode
v2 through migration. New setups should use providers, package, and
settings as above.
OpenCode uses each model’s limit to decide when to compact the conversation.
context is the working window ASI:One publishes for
tools like OpenCode (not the raw API maximum). output is how much room OpenCode
reserves for the assistant reply. Both fields are required whenever a model has a
limit block. If you omit limit, OpenCode falls back to generic defaults that
are too small for asi1-ultra, so always set the limits above. The sample uses
40,000 for output as a safe default; raise it if replies feel cut off before
compaction should kick in.
Optional: reasoning depth
asi1 and asi1-ultra support configurable reasoning
depth. To expose effort levels in OpenCode, replace the existing asi1-ultra
entry under providers.asi.models with the object below (same fields work on
asi1; not needed for a first successful run):
Pick a variant when you start a session, for example opencode -m asi/asi1-ultra#high.
Store the API key
Add the provider block to your config file (opencode.json or opencode.jsonc)
first so OpenCode knows about the asi integration. Then connect your key:
OpenCode prompts for the key without echoing it. The key is stored in OpenCode’s local credential store, not in your project.
Keep the key out of project config when that file lives in a git repository.
Use opencode auth login instead of pasting the key into config.
To see saved integrations:
Verify
List models that come from your config (look for the asi/ prefix):
You should see:
To confirm OpenCode merged the provider block and endpoint:
Then send a request to each model you plan to use:
Each should reply with OK.
Run it
Because the config sets "model": "asi/asi1-ultra", plain opencode starts on
asi1-ultra. To pick a model for one session:
Troubleshooting
Next steps
- OpenWork: use the same models in OpenWork’s task UI
- Codex: the same models in the Codex CLI
- Cursor: the same models in the Cursor editor
- Zed: the same models in the Zed editor
- ASI:One Models: choosing between
asi1,asi1-ultraandasi1-mini - Chat Completions API: the endpoint OpenCode talks to