Skip to main content
OpenCode is an AI coding agent for the terminal. OpenCode already ships a Venice AI provider, so you connect with one command and pick a model from the full Venice catalog. No config file required.
This guide follows OpenCode 1, which the standard installer sets up. OpenCode 2 also includes Venice AI with a few label changes. See OpenCode 2.

Built-in Provider

Venice AI appears in OpenCode’s /connect list

Full Model Catalog

Every Venice text model is available in /models

No Config Needed

One command connects the account for every project

Prerequisites


Setup

1

Connect Venice AI

Launch OpenCode and run the connect command:
Search for Venice AI and select it.
OpenCode's /connect palette filtered to Venice AI
2

Paste your Venice API key

Paste the key into the API key field and press enter.OpenCode stores the credential in ~/.local/share/opencode/auth.json, so it stays available in every project.
3

Pick a model

Run the model command and choose a Venice model:
z-ai-glm-5-3-flash is a good default for coding: fast, inexpensive, and a 1M-token context window. See Model IDs for other options.OpenCode also lists its own hosted free tier under similar names, for example GLM-5.3-Flash Free from OpenCode next to GLM 5.3 Flash from Venice AI. The provider name in the right column distinguishes them, and the Venice AI row is the one that uses your key and credits.
Send a small task to confirm the round trip, for example:

Pin a default model

After you connect, OpenCode may start new sessions on a routed model such as Claude Sonnet 4.6, which costs more than the models in Model IDs. To choose the model OpenCode starts with, add it to opencode.json in your project root (or ~/.config/opencode/opencode.json for a global default):
Model references use the venice/<model-id> form, and small_model sets the cheaper model for background tasks.

Connect without /connect

The bundled provider also reads VENICE_API_KEY from the environment. Export it before launching OpenCode and Venice AI models appear in /models without running /connect:
On an OpenCode build that predates the bundled provider, or to pin the list of models OpenCode shows, configure Venice as an OpenAI-compatible provider in opencode.json. Keep VENICE_API_KEY exported:
List the models you want inside models. OpenCode only shows entries declared here for this provider. On builds with the bundled provider, the environment variable alone already gives you the full catalog.

OpenCode 2

OpenCode 2 is a separate release line with its own installer:
It ships a native Venice AI provider, and the setup above works with a few differences:
  • The /connect dialog is titled Connect an integration. Search for Venice AI under Services, then paste your key into the Connect Venice AI dialog.
  • Exporting VENICE_API_KEY before launch also enables the provider without /connect.
  • Without a pinned model, OpenCode 2 can also start on a routed model, such as Claude Fable 5.2.
  • The opencode.json examples on this page keep working, because OpenCode 2 still reads the OpenCode 1 config format. In native OpenCode 2 config, set the background model with agents.title.model instead of small_model. See OpenCode’s migration guide for the rest of the native format.

Model IDs

A few Venice models that work well in a coding agent. The catalog changes, so use GET /models?type=text for the current list. Open-weight models such as these run fully private. Routed models from Anthropic, OpenAI, and Google run anonymized, so the upstream lab never sees your identity.

Config Notes

  • Keep baseURL set to https://api.venice.ai/api/v1 in the manual provider block. The bundled provider already points there.
  • The provider ID is venice, so model references use the venice/<model-id> form in both paths.
  • Run /connect again at any time to replace the stored Venice key.
  • Broaden context when the model supports it: several Venice models accept 1M tokens.

Troubleshooting

Update OpenCode to the latest 1.x release with opencode upgrade. The Venice AI provider ships with current builds, so an older install may only offer the manual config path above.
Confirm the key comes from venice.ai/settings/api, then run /connect, select Venice AI, and paste it again. OpenCode reports an auth failure rather than reaching Venice when the stored key is stale.
Copy the ID exactly from Model IDs, the text model catalog, or GET /models, and confirm your Venice account has access to it.
Run the local debugging proxy between OpenCode and Venice to log every request and response, including the model ID, tools, and error body the agent actually sent, plus the last four characters of the key it used.

Resources

Venice Text Models

Available Venice model IDs

OpenCode 1 Provider Docs

Provider list and custom provider reference

OpenCode 2 Provider Docs

Native provider config for OpenCode 2