A terminal window showing OpenCode connected to Venice AI

Run a Private Coding Agent With OpenCode and Venice

OpenCode ships a Venice AI provider, so one /connect gives you a terminal coding agent on private models with no client allowlists. Setup, model picks, and real costs.

Venice.aiVenice.ai

OpenCode is an open-source coding agent that runs in your terminal, and it ships a Venice AI provider. You connect with one command, pick a model, and the agent runs against Venice's API. No config file is required, and nothing about your repository is stored by the model host after the response.

That last sentence is the reason to do it. A coding agent is a repository firehose: it reads whole files, diffs, and sometimes history, then sends that context to a model on every turn. Where that context lands is a choice, and the default in most setups is a subscription account that keeps your data.

Short answer

Get a key at venice.ai/settings/api. Your account needs credits, since Venice bills per token rather than by subscription.

What you get that a subscription agent does not

Zero data retention. Venice's API default is zero retention: the prompt and response are not stored and are not used for training. That holds for the whole session, not per message, so the agent can ship as much of the repo as it needs.

No refusals mid-run. A refusal is worse in an agent than in a chat box, because the loop assumes the step completed. Venice hosts open-weight models with no policy layer on top, so glm-5.3, kimi-k2.6, deepseek-v4.1-flash, and the Qwen family run uncensored.

Every model on one key. Text, vision, image, embeddings, and the rest sit behind one credential, and OpenCode lists the text catalog in /models. When a new frontier model lands on Venice the same day it ships, you switch to it without a new account.

No client allowlists. Any OpenAI-compatible tool can point at the same base URL, so the key you use in OpenCode also powers your scripts, your editor, and your CI.

Set it up

1. Install OpenCode

OpenCode also installs through npm (npm install -g opencode-ai), Homebrew, and package managers on each platform. See the install docs for your system.

2. Connect Venice

Launch opencode in a project and run:

Search for Venice AI, select it, and paste your API key. OpenCode stores the credential in ~/.local/share/opencode/auth.json, so the connection follows you into every project rather than being re-declared in each one.

/connect, type venice, and the only provider left is Venice AI.

3. Pick a model

Type glm 5.3 flash and two entries appear with nearly the same name: GLM-5.3-Flash Free served by OpenCode, and GLM 5.3 Flash served by Venice AI. The free row is OpenCode's own hosted tier on its own rate limits; the Venice AI row is the account you just connected. Pick the Venice AI one when you want your key, your credits, and zero retention.

One model name, two servers. The right column tells you which one you are on.

GLM 5.3 Flash is a good default for coding: fast, one of the cheapest entries in the catalog, and a 1M-token context window, which matters when the agent loads a large module.

4. Verify the round trip

Send one small task before you trust it with a refactor:

The footer shows the model it will use next to Venice AI, so confirm that line before you let it touch anything. Here it read a small project and summarized it in about 17 seconds:

The status line under the reply reports the model and the provider it actually billed.

You can also drive it non-interactively, which is the form that belongs in a script or a pre-commit hook:

Pin the model so turns stay predictable

/models changes the selection for the session. For a default that survives restarts, put it in opencode.json in the project root (or ~/.config/opencode/opencode.json to apply it everywhere):

model is what the agent uses for real work. small_model handles the cheap background calls, and pointing it at the same model keeps a session on one bill.

What it costs

Venice publishes per-token rates, and you pay for what you use. There is no monthly floor and no per-seat price, which is why a heavy day here is a couple of dollars rather than a plan upgrade.

ModelVenice IDInput / 1MOutput / 1MContext
GLM 5.3 Flashz-ai-glm-5-3-flash$0.15$0.501M
DeepSeek V4.1 Flashdeepseek-v4-1-flash$0.30$1.201M
Kimi K2.6kimi-k2-6$0.75$3.50256K
GLM 5.3z-ai-glm-5-3$1.75$5.501M

Two realistic sessions on GLM 5.3 Flash, math included:

  • A light day, about 1M input tokens and 100K output, comes to $0.20.
  • A heavy day of long agent loops, about 10M input and 1M output, comes to $2.00.

Repeat context costs less than those input rates because Venice caches the prompt automatically, and cache reads bill below the standard input price. A coding agent re-sends the same file tree every turn, so caching does most of its work here rather than in a chat. Rates move, so check the pricing page before you budget.

Private versus anonymized: know which model you are on

Venice models fall into two routing classes and the difference matters for source code.

  • Private models are open-weight models hosted by Venice, so no third party sees the request at all. Anything in the GLM, Kimi, DeepSeek, MiniMax, and Qwen families qualifies.
  • Anonymized models are frontier models from Anthropic, OpenAI, and Google. Venice strips your identity, but the upstream lab receives the content and stores it under its own policy.

So if the rule is "the repo never leaves the building," stay on open weights. If you want Claude Opus for a hard refactor, you can have it, and you should know the request now reaches Anthropic. The model list marks which is which, and you can see the same split described in best uncensored LLM APIs.

Note that OpenCode is a local agent: it holds your files and your context on your machine. Venice's TEE and E2EE modes are transport-level guarantees, so pointing OpenCode at a private model is the relevant lever rather than an end-to-end encryption claim.

Troubleshooting

Venice AI is missing from /connect. Update OpenCode. Current builds ship the provider, so an older install may only offer a manual config. You can always add it yourself as an OpenAI-compatible provider with baseURL set to https://api.venice.ai/api/v1 and npm set to @ai-sdk/openai-compatible.

401 or invalid key. Confirm the key came from venice.ai/settings/api, then run /connect and paste it again. The stored credential is the thing failing, not the provider.

Empty /models. When you declare a models map in your own config, OpenCode shows only those entries for that provider. Remove the key to get the full catalog back.

Two models with the same name. OpenCode lists its own free tier alongside Venice, so GLM-5.3-Flash Free points at OpenCode's servers while GLM 5.3 Flash points at Venice AI. The provider name in the right column of the picker is what distinguishes them.

Model not found. Copy the ID exactly. The catalog churns, and GET /models?type=text is the current source of truth.

FAQ

Is OpenCode free to use with Venice?

OpenCode is open source and free. Venice bills per token, so you fund an account rather than paying for a seat, and a coding session costs cents at the cheap end of the catalog.

Can OpenCode use models other than Venice?

Yes. Venice is one provider among many in /connect. The advantage here is one key covering the whole catalog plus a zero-retention default, not exclusivity.

Does Venice keep my code?

On its own API, no: zero retention is the default, and inputs are not used for training. The exception is an anonymized frontier model, where the upstream lab receives the prompt and applies its own policy.

Which model should I start with?

GLM 5.3 Flash. It is inexpensive, fast, and has a 1M-token context, so long files fit. Move to GLM 5.3 or Kimi K2.6 when a task is hard enough that quality beats price.

Does this work outside OpenCode?

Anything OpenAI-compatible does: Cursor, Cline, the Codex CLI, your own scripts. Setup guides for each sit in the AI agents docs.

Run /connect, pick GLM 5.3 Flash, and let the agent read the repo. Then check the Venice API docs when you want the config knobs, and the model catalog when you want to know where a request is going.

Back to all posts