Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>OpenCode ModelsNew to Visual Studio Code? Get it now.
OpenCode Models

OpenCode Models

irsooti

|
1 install
| (1) | Free
| Sponsor
Use every model you configured in OpenCode (providers, plugins, stored keys) from VS Code chat, with streaming, tool calling and context-window usage.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

OpenCode Models icon

OpenCode Models for VS Code

Use every model you configured in OpenCode straight from VS Code chat.

VS Code Marketplace Open VSX CI MIT License Support on Ko-fi


OpenCode already knows your providers, your plugins and your API keys. This extension exposes that catalog as a VS Code language model provider, so the same models appear in the chat model picker and work in Ask, Edit and Agent mode. You don't have to configure them twice.

Features

  • Your OpenCode catalog in the picker. Everything OpenCode resolves is listed under the OpenCode group: opencode.json providers, plugin-provided providers (for example an internal LiteLLM gateway) and stored credentials.
  • Streaming responses from OpenAI-compatible and Anthropic providers.
  • Tool calling. Models can call VS Code tools, so they work in Agent mode.
  • Reasoning. Models that think out loud show it as a collapsible Thinking block, and get their reasoning back on later turns.
  • Context-window usage. Each response reports its token counts, so the chat's context indicator stays accurate.
  • Prompt caching for Anthropic. The tools, the system prompt and the conversation so far are marked cacheable, so long Agent-mode sessions don't pay for the whole context on every turn.
  • Resilient requests. Rate limits, overloads and network errors are retried with backoff (honouring Retry-After). Permanent errors fail at once with the provider's own message.
  • Self-cleaning model list. A model that turns out not to support chat (an embeddings or routing model, say) is hidden after its first failure.
  • Image input for models that accept it.
  • No duplicate secrets. Keys stay in OpenCode. A key rotated there is picked up within 30 seconds, or immediately after an authentication error.

Requirements

  • VS Code 1.146 or newer.
  • OpenCode installed, with at least one provider that has an API key (opencode auth). The extension talks to OpenCode's background service through the opencode CLI.

Getting started

  1. Install OpenCode Models from the VS Code Marketplace or Open VSX.
  2. Open the chat view and the model picker. Your OpenCode models are in the OpenCode group.
  3. Run OpenCode: Show Status to see which models are served, hidden or skipped, and why.

The models work in Local sessions. In Copilot CLI sessions they appear through VS Code's bring-your-own-model bridge (chat.agentHost.byokModels.enabled). Added a model or key in OpenCode? Run OpenCode: Refresh Models.

How it works

VS Code chat ──vscode.lm──▶ OpenCode Models ──opencode api──▶ OpenCode (models, providers, keys)
                                   │
                                   └──HTTPS, streaming──▶ provider endpoint
  • The model list comes from opencode api GET /api/model.
  • The endpoint and key for each request come from /api/provider and /api/credential.
  • Requests go directly from the extension to the provider. OpenCode's own text-generation API has no streaming and no tool support, which Agent mode needs.
  • Supported wire formats are OpenAI Chat Completions (openai-compatible, openai) and Anthropic Messages.

Models without a stored key, or from a provider package that isn't supported yet, are skipped. The OpenCode Models output channel explains every skip.

Settings

Setting Default Description
opencodeModels.opencodePath "" Path to the opencode executable. When empty, the extension searches PATH, /opt/homebrew/bin, /usr/local/bin and ~/.opencode/bin.

Commands

Command Description
OpenCode: Refresh Models Re-read OpenCode's catalog, bring back hidden models, and show the output channel.
OpenCode: Show Status Report the OpenCode executable, the models served per provider, and every hidden or skipped model with its reason.

Known limitations

  • Token counting for budgeting is an estimate, calibrated per model against the provider's real counts. The context indicator itself uses the real counts.
  • Output is capped at 32k tokens per request. That much is reserved from the context window.
  • Anthropic thinking is shown but not sent back on later turns, because the chat history doesn't keep its signature.
  • In Copilot CLI sessions, VS Code's bridge reports every provider error as HTTP 502, so Copilot CLI retries even permanent errors. The failing model is still hidden for the next turn.
  • Providers other than OpenAI-compatible and Anthropic (for example Bedrock or Google) are not supported yet. Open an issue if you need one.

Troubleshooting

Open View → Output → OpenCode Models.

  • No models listed. Look for Could not read models from OpenCode. Check that opencode api GET /api/model works in a terminal, or set opencodeModels.opencodePath.
  • A model is missing. Run OpenCode: Show Status. It lists Skipped models (no key, unsupported provider) and Hidden models (failed as non-chat models). Refresh Models brings hidden ones back.
  • Requests fail. The [error] line has the provider's HTTP status and message, for example an exhausted credit balance.
  • The context indicator doesn't move. Every ← line should end with (prompt …, completion …, cached …). If it doesn't, reload the window to load the latest version.

Contributing

Contributions are welcome. Read CONTRIBUTING.md to set up the project and run the tests, including the end-to-end verification harness. This project follows a Code of Conduct.

Support the project

If this extension saves you time, consider buying me a coffee on Ko-fi. It keeps the project maintained.

Buy me a coffee on Ko-fi

License

MIT © irsooti

OpenCode is a project of its respective authors. This extension is an independent community project and is not affiliated with or endorsed by OpenCode.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft