Custom Provider
Add Venice as a provider in
opencode.jsonOpenAI Compatible
Uses Venice’s
/chat/completions endpointEnvironment Key
Reads your API key from
VENICE_API_KEYPrerequisites
- A Venice API key from venice.ai/settings/api
- OpenCode installed and working on your machine
Setup
Create an OpenCode config file
For a project-specific setup, create
opencode.json in your project root.For a global setup, use ~/.config/opencode/opencode.json instead.Verify the Setup
Inside OpenCode, run:"model": "venice/zai-org-glm-5-1" as shown above, OpenCode should use that Venice model by default. You can change the default by replacing zai-org-glm-5-1 with any model ID from the text model catalog and adding it to the models map.
Config Notes
- Keep
baseURLset tohttps://api.venice.ai/api/v1. OpenCode’s OpenAI-compatible adapter uses this base URL for chat completions. - Keep
npmset to@ai-sdk/openai-compatiblefor Venice’s OpenAI-compatible chat endpoint. - The provider ID is
venice, so model references use thevenice/<model-id>format. - If you prefer OpenCode’s
/connectflow, choose Other, useveniceas the provider ID, paste your Venice API key, and removeoptions.apiKeyfrom the config.
OpenCode already supports custom provider
baseURL values and OpenAI-compatible providers through @ai-sdk/openai-compatible. No OpenCode core provider changes are required for Venice.Resources
Venice Text Models
Available Venice model IDs
OpenCode Provider Docs
Custom provider and base URL reference