Plugin for OpenCode that adds CoreInfra AI Hub as an external model provider.
Works with OpenCode 1.x (1.4.0 or newer) and OpenCode 2.x (2.0.28 or newer).
Install the plugin
opencode plugin add '@coreinfra/opencode-plugin@latest'Log in by entering the API token
opencode auth login coreinfraInstall the plugin
opencode plugin -g '@coreinfra/opencode-plugin@latest'Log in by entering the API token
opencode providers login --provider coreinfraDuring authentication, you will need a CoreInfra AI Hub API token.
- Up-to-date model list - the catalog is loaded dynamically from the Hub API on every startup and always reflects its current state. Model capabilities (context limits, reasoning, tool use, etc.) are resolved from the models.dev catalog.
- All available models - every model exposed by the Hub is supported.
- Reasoning support -
interleaved thinkingmode is enabled automatically where applicable.
At the moment, OpenCode supports prices in USD only. Because of that, pricing is not overridden yet: OpenCode shows prices from the original OpenAI/Anthropic API.
After installation and authentication, models will be available with the coreinfra/ prefix:
opencode run -m coreinfra/gpt-5.4-nano
opencode run -m coreinfra/claude-sonnet-4-20250514To see the full list of available models:
opencode models coreinfraThe full model list is determined by the Hub contents at startup time. The plugin supports all models listed on this page: https://hub.coreinfra.ai/pricing
| Variable | Default | Description |
|---|---|---|
COREINFRA_API_KEY |
— | On OpenCode 2, an API token to use instead of logging in (a saved login takes precedence). On OpenCode 1 it only authenticates loading the model list; logging in is still required. |
COREINFRA_HUB_BASE_URL |
https://hub.coreinfra.ai |
Base URL of the CoreInfra Hub instance. Overrides the default endpoint for model listings and API proxying. |
Code formatting:
just fmtFull project check:
just check