OpenCode CLI
OpenCode is an open-source terminal AI coding agent. It works excellently with Openference.Add the provider
Create or edit~/.config/opencode/opencode.json:
Authenticate and connect
{env:...} syntax (shown above).
Verify flow
OpenCode connects by callingGET /v1/models and /v1/chat/completions. Openference returns an OpenAI-compatible model list filtered by key restrictions.
Model configuration
Add only the models you use. The model keys must match exactly the IDs shown on the Models page or returned by the API.Notes
- Both
buildandplanagents work through Openference. - You can switch agents with
Taband use/undoand/redofreely. - See the Compatibility Matrix for an overview of all clients.

