Settings > AI Providers > Connect provider. If it is not, or you run your own gateway, add it as a custom OpenAI-compatible provider in your workspace’s opencode.jsonc.
Local provider setup. A custom provider can stay entirely in your workspace. OpenWork remains free, and you do not need to sign in to OpenWork Cloud. To give a whole team the same provider without sharing keys by hand, see Share a provider with your team.
Option 1: Bring your own API key for a catalog provider
OpenWork lists every provider in the OpenCode model catalog that accepts an API key.- Create an API key in the provider’s console. Copy it once and treat it like a password.
- In OpenWork, open
Settingsand chooseAI Providers. - Click
Connect provider. - Type the provider’s name in
Search providers(for example,openrouter,mistral, orfireworks) and select it. - Paste the key into the
API keyfield and save. - Choose one of the provider’s models in the chat model picker.
Option 2: Add any OpenAI-compatible endpoint
Use this for an AI gateway (LiteLLM, a hosted router, or one you built), an Azure OpenAI or Azure AI Foundry deployment, a self-hosted model server, or any provider not in the catalog. The endpoint must speak the OpenAI Chat Completions API. Because OpenWork is built on OpenCode, anything you can configure in an OpenCode config file works here. Keep the setting with the workspace rather than in your global~/.config/opencode/opencode.json.
-
Collect the endpoint’s base URL (usually ending in
/v1), the model IDs it serves, and an API key if it needs one. -
Open your workspace folder and edit
opencode.jsoncin its root. Create it if it does not exist. -
Add a provider entry:
-
Make
MY_GATEWAY_API_KEYavailable to OpenWork: openSettings > Environment, clickAdd variable, save the key, and apply the change. Secrets saved there stay on this device. You can also set the variable in your shell before starting OpenWork. OmitapiKeyif the endpoint does not need one. -
Run
Reload OpenCode configfrom the command palette, or restart OpenWork. - Pick the new model in the chat model picker and send a short test prompt.
models for every model ID the endpoint exposes.
Examples
For Ollama, the built-in
Settings > Ollama screen writes this config for you. See Use local models.
Share a provider with your team
If several people need the same provider, have an OpenWork Cloud admin add it once instead of passing keys around:- Managed LLM provider: a catalog provider with one shared org key.
- Custom LLM provider: any OpenAI-compatible endpoint, including your own gateway, entered as a base URL plus model IDs.
- Per-member LLM credentials: one provider, a separate key per member (for example, LiteLLM virtual keys).
- OpenWork AI Gateway: route providers through OpenWork with per-team model access, limits, and usage tracking.
Settings > AI Providers > Cloud providers. Admins can also block locally added providers with desktop policies so everyone uses the approved setup.
FAQ
Can I use OpenRouter with OpenWork?
Can I use OpenRouter with OpenWork?
Yes. OpenRouter is in the provider catalog: open
Settings > AI Providers > Connect provider, search for OpenRouter, and paste your key.Can I use my company's own AI gateway?
Can I use my company's own AI gateway?
Yes, if it exposes an OpenAI-compatible endpoint. Add it with Option 2 for yourself, or ask an admin to add it once as a custom LLM provider for the team.
Where does OpenWork store my API key?
Where does OpenWork store my API key?
Keys entered in
Connect provider are stored by the local OpenCode engine on your computer. Values saved in Settings > Environment stay on this device. Org-managed keys are stored in OpenWork Cloud and synced to the workspaces that are allowed to use them.The model shows up but tool calls fail.
The model shows up but tool calls fail.
Some models or gateways do not support tool calling. Try a model that advertises tool or function calling support, and check the gateway passes tool definitions through.
I see 'Custom providers are disabled by your organization'.
I see 'Custom providers are disabled by your organization'.
Your admin has blocked locally added providers. Use the providers your organization shares (see
Settings > AI Providers > Cloud providers), or ask your admin to add the one you need.