Connect OpenCode with Zeldoc.ai
Zeldoc.ai is available as a provider in OpenCode. This guide walks you through getting access to Zeldoc.ai and connecting it to OpenCode using your API key.
Prerequisites
- OpenCode installed on your machine
- A Zeldoc.ai API key, either issued to you directly or generated from your Zeldoc.ai account
Choose your access flow
Zeldoc.ai access may be provided in one of two ways:
- You received an API key directly: You do not have a Zeldoc.ai dashboard user unless the team also created one for you. The API key cannot be used to sign in to the dashboard. Skip the invitation and key generation sections below and go directly to Connect Zeldoc.ai to OpenCode.
- You received a dashboard invitation: Sign in with the user account from your invitation, then generate an API key as described below.
Do not enter your API key on the Zeldoc.ai sign-in page. An API key authenticates OpenCode and other tools with the Zeldoc.ai API; it is not a username or password and does not create a dashboard user.
Get an invitation to Zeldoc.ai
You only need this step if you want or need a Zeldoc.ai dashboard user. Zeldoc.ai is currently invitation-only. To get an account:
- Request an invitation from the Zeldoc.ai team.
- Once your invitation is accepted, you'll receive access to your Zeldoc.ai account.
Generate an API key
Skip this section if the Zeldoc.ai team sent you an API key directly. If you have dashboard access, generate a key as follows:
- Sign in to the Zeldoc.ai dashboard.
- Navigate to the API keys section.
- Create a new API key.
- Copy the key — you'll need it in the next step.
Your API key grants access to Zeldoc.ai. Treat it like a password and never share it or commit it to version control.
Connect Zeldoc.ai to OpenCode
Zeldoc.ai is part of the provider list built into OpenCode. You can connect from the terminal or the desktop app — the credentials are shared across all OpenCode interfaces.
From the terminal
In this command, login means connecting a provider to OpenCode. It stores your API key in OpenCode; it does not sign you in to the Zeldoc.ai dashboard or create a Zeldoc.ai user.
-
Open a terminal.
-
Run the following command:
opencode auth login -
Search for Zeldoc in the provider list.
-
Select Zeldoc.
-
Paste your API key when prompted.
From the desktop app
OpenCode also ships as a desktop app (beta) for macOS, Windows, and Linux. To connect from the desktop app:
- Open the OpenCode desktop app.
- Open Settings and go to the Providers page.
- Click Show more providers and search for Zeldoc in the provider list (it appears under Other).
- Select Zeldoc to open the Connect Zeldoc dialog.
- Paste your API key into the Zeldoc API key field and click Continue.
Once connected, Zeldoc appears under Connected providers with an API key tag.
Next, enable the models you want to use:
- Go to the Models page in Settings.
- Under the Zeldoc category, toggle on the models you want in your model picker, for example ZDev.
With the Zeldoc plugin installed, this list shows exactly the models your API key can use.
If you don't see Zeldoc in the provider list, you may have
enabled_providers
set in your config. Zeldoc is not included in the default enabled_providers
list, so you'll need to add it:
{
"$schema": "https://opencode.ai/config.json",
"enabled_providers": ["zeldoc"]
}
Show your key's models with the Zeldoc plugin
Out of the box, OpenCode shows the Zeldoc.ai models from its built-in catalog, which is the
same for everyone. The opencode-zeldoc
plugin replaces that list with the models your API key can actually use, together with
their context limits, prices, and capabilities (tool calling, reasoning, image and PDF
input) straight from Zeldoc.ai. We recommend it for everyone using Zeldoc.ai with OpenCode.
Add the plugin to your opencode.jsonc (or ~/.config/opencode/opencode.jsonc for a
global setup):
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-zeldoc"]
}
OpenCode installs the plugin automatically the next time it starts. It uses the API key you connected above, so there is nothing else to configure.
opencode.jsoncWe recommend the .jsonc extension over .json so you can add comments to
document your config. OpenCode reads both, but comments make it easier to
explain why each option is set.
What changes with the plugin:
- Only your models: the model picker lists the models your key has access to. If a model is added to or removed from your key, OpenCode shows the change the next time it starts.
- Correct limits: context and output limits come from Zeldoc.ai, so you never have to set them yourself.
- Your prices: the cost OpenCode shows matches what your organization pays.
If Zeldoc.ai can't be reached when OpenCode starts, the plugin keeps OpenCode's built-in list, so you're never left without models.
Use a different key in each project
If you have a Zeldoc.ai API key for each customer, the plugin can use the right one in each project. Save the keys and pin each project to its key with the Zeldoc CLI:
zeldoc auth login --profile acme
cd ~/work/acme-app
zeldoc auth pin acme
In a project with a .zeldoc-profile file, OpenCode then uses that project's key for the
model list and for every request, instead of the key you connected above. Projects without
the file keep using the connected key and don't need the CLI. See
Use several API keys for the details.
Use an environment variable instead of logging in
On servers, in CI, or anywhere you'd rather not run opencode auth login, set the key in
the ZELDOC_API_KEY environment variable. OpenCode and the plugin both read it:
export ZELDOC_API_KEY=your-api-key
Add the export line to your shell profile (e.g. ~/.bashrc or ~/.zshrc)
so the key is available in every new terminal session.
Coming from a provider block in your config?
Earlier versions of this guide had you define Zeldoc.ai yourself under "provider" →
"zeldoc" in opencode.jsonc, including a models list with context limits. Remove that
block when you install the plugin. OpenCode always adds models you define by hand on top
of the plugin's list, so a leftover block keeps showing models your key may no longer have,
with limits that may be out of date.
Recommended config
When using Zeldoc.ai with OpenCode, we recommend locking down your config to
ensure your data stays private and you don't accidentally use a different
provider. Add these two options to your opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"share": "disabled",
"disabled_providers": ["opencode"]
}
"share": "disabled"— Prevents conversations from being shared via share links. Your prompts and responses stay on your machine."disabled_providers": ["opencode"]— Removes the default OpenCode provider so you don't accidentally send requests to a model you didn't intend to use.
Keep web search private
OpenCode 2: the built-in websearch tool can send queries to several
third-party services (Exa, Firecrawl, Parallel, Tavily and TinyFish). The Zeldoc
plugin above routes it through Zeldoc.ai's private search instead, so there is
nothing to configure. See Web search for details, and
for how to turn search off with "websearch": false.
OpenCode 1: the websearch tool sends your search queries to a third-party
service (Exa AI). By default, the tool is only available when using the OpenCode
provider, which we've disabled above, so it's already off. If you want the agent
to search the web, use Zeldoc.ai's private search instead: see
Web search for the tool file and setup.
If you've enabled web search manually
in OpenCode 1 via the OPENCODE_ENABLE_EXA environment variable, explicitly
disable the built-in tool to prevent it from sending queries directly to Exa.
Don't do this in OpenCode 2, where it would block Zeldoc.ai search too:
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"websearch": "deny"
}
}
Either way, Zeldoc.ai search sends your queries to Zeldoc.ai, which queries the configured search providers. See the search privacy and retention notes before sending sensitive information.
The webfetch tool fetches a specific URL you provide and doesn't send your
data to a third party. It can stay enabled if you want the agent to be able to
read web pages.
These options go in the same opencode.jsonc file as the Zeldoc plugin. Merge them
into a single object — don't create a second config file.
Verify the connection
To confirm that Zeldoc.ai is connected, run:
opencode auth list
You should see Zeldoc.ai listed among your authenticated providers. You're now ready to use Zeldoc.ai with OpenCode.