Coding Agents
Set up Cline, Kilo Code, Roo Code, OpenCode, Aider, Continue, Zed, Cursor and more on deeprelay: base URL, key, model ID and the gotchas for each agent.
deeprelay speaks the OpenAI Chat Completions API, so any coding agent that lets you set a custom OpenAI-compatible base URL can use it as its model provider. This page gives the setup for Cline, Kilo Code, Roo Code, OpenCode, Aider, Continue, Zed, Cursor, VS Code (GitHub Copilot), Pi, Kimi Code, Deep Code, DeepSeek Harness and ZCode. Claude Code and Codex CLI have their own guides: Claude Code and Codex CLI.
For OpenCode, Aider, Continue, Zed, Pi, Kimi Code and DeepSeek Harness,
deeprelay setup writes the configuration for you, and for Deep Code it prints the block to add.
Each of those sections starts with a Quick start; the manual steps follow it.
Claude Code, Codex and OpenCode can also be run one session at a time, with
nothing written to disk and a cost receipt printed on exit: deeprelay launch
claude-code, deeprelay launch codex and deeprelay launch opencode. See
deeprelay launch claude-code,
deeprelay launch codex and
deeprelay launch opencode, or the
per-session subsections in Claude Code
and Codex CLI.
Every agent needs the same three things:
| Base URL | https:/ |
| API key | a deeprelay_live_… key (deeprelay login, or mint one in the dashboard) |
| Model ID | a chat model from GET /, e.g. deeprelay/ |
Wherever the agent supports it, the examples below read the key from the
DEEPRELAY_API_KEY environment variable. Deep Code and ZCode can only read
it from their own config file; their sections say how to keep that file
private. Don't paste a real key into a config file you might commit.
export DEEPRELAY_API_KEY=deeprelay_live_...
Claude Code: deeprelay serves the Anthropic Messages API. Rundeeprelay setup claude-code; the full guide is in claude-code.md. Claude Code's/costshows Anthropic list prices, not deeprelay's; usedeeprelay quota --short(status line) or the dashboard for what you spend. Codex CLI: deeprelay serves the OpenAI Responses API. Rundeeprelay setup codex; the full guide is in codex.md.
Track one agent session
A coding agent can send dozens or hundreds of requests for a single task. To
see what one task cost, tag every request of that session with the same
X-Client-Request-Id header (up to 128 characters). deeprelay stores it on
each row of your request log, which holds metadata only: tokens, cost,
latency, status and error codes, never prompts, code or model output.
Set the header in your agent's custom-headers setting where it has one, or put a proxy in front that adds it, and use a fresh value per task.
Then look at just that session:
- Dashboard: type the id into Session id on the Analytics page. The charts, totals, per-model and failure breakdowns and the Export CSV all narrow to that session. The filter lives in the URL (
/cloud/analytics?client_request_id=), so the view can be bookmarked or shared. - CLI:
deeprelay requests list --client-request-id <session id>
deeprelay requests export --client-request-id <session id> --out session.csv
The CSV export carries no prompts or output, so it is safe to attach to a support request as a diagnostic report.
Picking a model
Coding agents read files, run commands and edit code through tool calls. Use a model that supports them. Some agents (Roo Code, Zed's agent, Continue's Agent mode) won't work at all without tool calling. Others fall back to worse prompt-based editing.
| Model | Context | Why pick it |
|---|---|---|
deeprelay/ | 1M | Recommended default. Fast, strong at tool calls, and covered by the flat plan. deeprelay setup makes it the default. |
deeprelay/ | 1M | The stronger model for harder tasks, with a long context window, at a moderate price. Setup adds it as the second model. |
deeprelay/ | 1M | Supports every tool_choice mode (see Troubleshooting). |
GET /v1/models marks the models tested with coding agents with
recommended_for: ["coding-agents"] and orders them by coding_agent_rank;
setup reads the same two fields. Multi-model setups (OpenCode, Pi, Zed,
Continue, Kimi Code, DeepSeek Harness) also write deeprelay/glm-5.4 and
deeprelay/kimi-k3.1-pro after the two above, plus deeprelay/glm-5.3-flash
and deeprelay/glm-5.3 for a subscriber, so a flat-plan subscriber's agent can pick a plan-covered
model without editing the config.
The flat plan covers deeprelay/deepseek-v4.1-flash,
deeprelay/glm-5.3-flash, deeprelay/glm-5.3, deeprelay/glm-5.4 and
deeprelay/kimi-k3.1-pro, weighted ×1, ×1.75, ×12, ×12 and ×30 against the allowance (see the subscription
tier spec). deeprelay/deepseek-v4-pro,
deeprelay/kimi-k3 and deeprelay/glm-5.2 bill pay-as-you-go at list
rates. Pick
deeprelay/deepseek-v4.1-flash if you want your agent loop drawing on the
plan rather than on credit.
Never take this table's word for it: coverage is live, so a model carries
"plan_covered": true in GET /v1/models only while it is actually on the
plan. Plan coverage explains what that
means and how to check a model before you call it.
Tool support is per model, and the catalog is live, so list the models that
support tools right now before you commit to one:
curl -s https://api.deeprelay.ai/v1/models \
-H "Authorization: Bearer $DEEPRELAY_API_KEY" \
| jq -r '.data[] | select(.supported_parameters | index("tools")) | "\(.id)\t\(.context_length)"'
The catalog publishes each model's context window (context_length) but no
separate output-token cap. The configs below use 32768 as the output limit.
It's a conservative value the recommended models accept, and you can raise it.
Use the full deeprelay/… ID in configs. Some bare aliases (e.g.
deepseek-v4-pro) also resolve, but the full ID is the one GET /v1/models
lists.
Two capabilities vary by model, so check them before you turn an agent's options on. The OpenAI compatibility table has the full list.
- Image input is per model. Only chat models that list
visionin theirsupported_parametersacceptimage_urlcontent parts (see Image input); any other model rejects an image with a400.deeprelay/deepseek-v4.1-flashlistsvision;deeprelay/deepseek-v4-proanddeeprelay/glm-5.3do not. The configs below leave the agent's image support off; turn it on only while the selected model listsvision. response_formatis per model. JSON mode and structured outputs work on models that listresponse_format/structured_outputs(see JSON mode & structured outputs). None of the agents here send it in normal chat or agent use.
Let an agent budget itself
An unattended agent can read the plan's allowance and slow down or move to a
cheaper model before it runs out, instead of finding out from a 429. Four
API-key surfaces cover it:
- Plan, usage and reset:
GET /v1/billing/subscription(scopebilling:read, whichstandardandfull_accesskeys carry; a custom key without it gets403 insufficient_scope). It returnsplan, the limits inquota(monthly and weekly input/output tokens), the weighted tokens used in each window inusage(with a per-model breakdown),usage.week_resets_at, when both weekly caps reset, andcurrent_period_end, when the monthly allowance resets. CLI:deeprelay quota. - Per-response headers: while the org is on a plan, every response carries
x-deeprelay-quota-input-remaining,-output-remaining,-reset, the weekly-remaining/-limitpairs and-weekly-reset(see Subscription quota headers). Both weekly caps reset together once a week, at the weekday and time your subscription started; a weekly-cap429carries that reset asquota_frees_at. Pay-as-you-go keys get only thex-ratelimit-*headers. - Model weights:
GET /v1/modelscarriesusage_factor_million each weighted model (12000means ×12). A missing field means ×1. - Before a call:
GET /v1/inference/preflight?model=answersok,warnorblockfor that model given the remaining allowance and balance.
curl -s https://api.deeprelay.ai/v1/billing/subscription \
-H "Authorization: Bearer $DEEPRELAY_API_KEY" \
| jq '{plan: .plan, quota: .quota, used: .usage, resets: .current_period_end}'
curl -s https://api.deeprelay.ai/v1/models \
-H "Authorization: Bearer $DEEPRELAY_API_KEY" \
| jq '.data[] | select(.usage_factor_milli) | {id, usage_factor_milli}'
Cline
In the Cline panel, open Settings and set:
| Field | Value |
|---|---|
| API Provider | OpenAI Compatible |
| Base URL | https:/ |
| API Key | your deeprelay_live_… key |
| Model ID | deeprelay/ |
Under Model Configuration:
- Set Context Window Size to the model's
context_lengthfromGET /v1/models(1048576for the DeepSeek V4 models). Cline uses it to decide when to condense the conversation. - Leave Supports Images unchecked.
- Input / Output Price are optional and only feed Cline's local cost display. deeprelay bills from its own meter either way.
Cline stores the key in VS Code's secret storage. It has no setting that reads an environment variable.
Kilo Code
From the UI: open Settings (gear icon), then the Providers tab, and click Custom provider at the bottom:
| Field | Value |
|---|---|
| Provider ID | deeprelay |
| Display name | deeprelay |
| Provider API | OpenAI Compatible |
| Base URL | https:/ |
| API key | your deeprelay_live_… key |
| Models | pick from the auto-fetched list. Kilo reads GET /. |
From the config file: put this in your global config under
~/.config/kilo/ (kilo.jsonc):
{
"$schema": "https://app.kilo.ai/config.json",
"model": "deeprelay/deeprelay/deepseek-v4-pro",
"provider": {
"deeprelay": {
"options": {
"apiKey": "{env:DEEPRELAY_API_KEY}",
"baseURL": "https://api.deeprelay.ai/v1"
},
"models": {
"deeprelay/deepseek-v4-pro": {
"name": "DeepSeek V4 Pro (deeprelay)",
"tool_call": true,
"limit": { "context": 1048576, "output": 32768 }
}
}
}
}
}
Gotchas:
- The model selector is
. deeprelay model IDs already contain a slash, so the selector reads/ deeprelay/deeprelay/deepseek-v4-pro. That is expected. - Kilo resolves
{env:…}only in trusted config (the global~/.config/kiloconfig,KILO_CONFIG/KILO_CONFIG_CONTENT, or managed config). A project-level config can't read your environment. Keep the provider block global. - Set
"tool_call": true, or Kilo won't offer tools to the model.
Roo Code
In the Roo Code panel, open Settings → Providers and set:
| Field | Value |
|---|---|
| API Provider | OpenAI Compatible |
| Base URL | https:/ |
| API Key | your deeprelay_live_… key |
| Model | deeprelay/ |
In the model configuration, set Context Window from GET /v1/models and
leave Image Support off.
Roo Code uses native tool calling only, with no XML fallback. A model
without tools in its supported_parameters can't drive Roo Code at all.
Pick one from the table above.
OpenCode
Quick start
deeprelay setup opencode
Adds a deeprelay provider to OpenCode's global config,
~/.config/opencode/opencode.json, and makes it the default. The key stays
out of the file: add the export DEEPRELAY_API_KEY=... line setup prints to
your shell rc (~/.zshrc, ~/.bashrc).
Undo it with deeprelay setup opencode --remove. The manual setup below shows the
same configuration. Full reference:
deeprelay setup opencode.
For a single session with nothing written to disk, use deeprelay launch
opencode instead: it configures a locked-down deeprelay provider through
OPENCODE_CONFIG_CONTENT for that process only, and prints a cost receipt on
exit.
deeprelay launch opencode
Full reference: deeprelay launch opencode.
Manual setup
Add a custom provider to opencode.json in your project root, or to
~/.config/opencode/opencode.json for every project:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"deeprelay": {
"npm": "@ai-sdk/openai-compatible",
"name": "deeprelay",
"options": {
"baseURL": "https://api.deeprelay.ai/v1",
"apiKey": "{env:DEEPRELAY_API_KEY}"
},
"models": {
"deeprelay/deepseek-v4.1-flash": {
"name": "DeepSeek V4.1 Flash 1017",
"limit": { "context": 1048576, "output": 32768 }
},
"deeprelay/glm-5.3": {
"name": "GLM 5.3",
"limit": { "context": 1048576, "output": 32768 }
},
"deeprelay/deepseek-v4-pro": {
"name": "DeepSeek V4 Pro (pay-as-you-go)",
"limit": { "context": 1048576, "output": 32768 }
}
}
}
}
}
Start opencode and run /models to pick one. The keys of the models map
must be exact deeprelay model IDs, because OpenCode sends them unchanged.
deeprelay/deepseek-v4.1-flash and deeprelay/glm-5.3 are covered by the flat
plan; deeprelay/deepseek-v4-pro is not, and bills pay-as-you-go from your
credit balance at list rates.
If you'd rather not keep the key in an environment variable, run /connect,
choose Other, enter the provider ID deeprelay, and paste the key. Then
leave apiKey out of the config.
Community integrations
openchamber-deeprelay-usage
is a community-built extension for OpenChamber that shows your deeprelay plan,
usage windows, credit balance and per-model quotas on OpenChamber's Usage page.
It is third-party and not affiliated with or reviewed by deeprelay. It reads
only GET /v1/billing/subscription and GET /v1/billing/balance, so give it
a key limited to the billing:read scope rather than a full_access key.
Aider
Quick start
deeprelay setup aider
Sets the model and base URL in ~/.aider.conf.yml and adds the model's limits
to ~/.aider.model.metadata.json. The key stays out of both files. Setup
prints an aider() shell function for your shell rc that gives the deeprelay
key to Aider alone, so other OpenAI tools keep their own OPENAI_API_KEY (see
the gotchas below). If OPENAI_API_KEY already holds a non-deeprelay key,
setup warns that Aider would send it to deeprelay.
Undo it with deeprelay setup aider --remove. The manual setup below shows the
same configuration. Full reference:
deeprelay setup aider.
Manual setup
Aider reaches OpenAI-compatible APIs through two environment variables and an
openai/ prefix on the model name:
export OPENAI_API_BASE=https://api.deeprelay.ai/v1
export OPENAI_API_KEY=$DEEPRELAY_API_KEY
aider --model openai/deeprelay/deepseek-v4-pro
The openai/ prefix tells Aider which client to use and is stripped before
the request. deeprelay receives deeprelay/deepseek-v4-pro. Leave the prefix
out and Aider won't route to your base URL.
For a one-shot, non-interactive edit:
aider --model openai/deeprelay/deepseek-v4.1-flash \
--message "Fix the bug in add() in calc.py" calc.py
Gotchas:
- Aider warns about an unknown context window and cost for deeprelay models. The warning is harmless because Aider doesn't enforce the limit. Silence it with
--no-show-model-warnings, or describe the model in.aider.model.metadata.json(home directory or repo root). The limits come fromGET /v1/models, and the costs are per token, so cents per 1M ÷ 100,000,000:
{
"openai/deeprelay/deepseek-v4-pro": {
"max_input_tokens": 1048576,
"max_output_tokens": 32768,
"input_cost_per_token": 0.00000057,
"output_cost_per_token": 0.00000196,
"litellm_provider": "openai",
"mode": "chat"
}
}
Check pricing in GET /v1/models for current prices. The numbers above
are an example and only change Aider's local cost display.
OPENAI_API_KEY/OPENAI_API_BASEapply to everyopenai/model Aider runs in that shell. Scope them to the shell where you run Aider, or putopenai-api-base/openai-api-keyin a project.aider.conf.ymlthat you don't commit.- DeepSeek V4 models stream their reasoning before the answer. Aider shows it in a separate block. That is expected.
Continue
Quick start
deeprelay setup continue
Appends the deeprelay models to ~/.continue/config.yaml. Setup never writes
the key: put DEEPRELAY_API_KEY= in
~/.continue/.env yourself.
Undo it with deeprelay setup continue --remove. The manual setup below shows the
same configuration. Full reference:
deeprelay setup continue.
Manual setup
Add a model to ~/.continue/config.yaml (Windows:
%USERPROFILE%\.continue\config.yaml) with the openai provider and an
apiBase override:
name: My Config
version: 0.0.1
schema: v1
models:
- name: DeepSeek V4 Pro (deeprelay)
provider: openai
model: deeprelay/deepseek-v4-pro
apiBase: https://api.deeprelay.ai/v1
apiKey: ${{ secrets.DEEPRELAY_API_KEY }}
roles:
- chat
- edit
- apply
capabilities:
- tool_use
Then put the key in ~/.continue/.env:
DEEPRELAY_API_KEY=deeprelay_live_...
Gotchas:
- The IDE extension can't see your shell's environment.
export DEEPRELAY_API_KEY=…in a terminal does nothing for Continue inside VS Code or JetBrains. Continue resolves${{ secrets.… }}from a workspace.env,, then/.continue/.env ~/.continue/.env, and only then the process environment. Use~/.continue/.envand keep it out of version control. - Declare
tool_use. Continue doesn't know deeprelay's model IDs, so it won't assume tool support. Withoutcapabilities: [tool_use]the model can't be used in Agent mode. - Don't add
image_input, and don't give a deeprelay chat model theautocompleterole. Autocomplete wants a small, fast fill-in-the-middle model, and a chat model makes a poor one.
Zed
Quick start
deeprelay setup zed
Adds a deeprelay provider to ~/.config/zed/settings.json and makes it the
agent panel's default. The key stays out of the file: paste the output of
deeprelay auth token into the deeprelay provider in Zed's Agent settings, or
start Zed from a shell that exports DEEPRELAY_API_KEY (setup prints the
line).
Undo it with deeprelay setup zed --remove. The manual setup below shows the
same configuration. Full reference:
deeprelay setup zed.
Manual setup
Open the Agent Settings (agent: open settings), click Add Provider under
LLM Providers, and fill in the provider name, API URL, model ID and
context window. Or add it to your settings.json directly:
{
"language_models": {
"openai_compatible": {
"deeprelay": {
"api_url": "https://api.deeprelay.ai/v1",
"available_models": [
{
"name": "deeprelay/deepseek-v4-pro",
"display_name": "DeepSeek V4 Pro (deeprelay)",
"max_tokens": 1048576,
"max_output_tokens": 32768,
"capabilities": {
"tools": true,
"images": false,
"parallel_tool_calls": false,
"chat_completions": true
}
}
]
}
}
}
}
The key comes from an environment variable named after the provider ID,
in upper snake case plus _API_KEY. With the provider ID deeprelay as
above, that is DEEPRELAY_API_KEY, the same variable the rest of this page
uses. You can also paste the key into the provider settings UI. Don't put it
in settings.json.
Gotchas:
- Keep
"chat_completions": true. Set tofalse, Zed calls the Responses API, which deeprelay doesn't serve yet. - Keep
"images": false(see Picking a model). max_tokenshere is the context window, not the output limit. Use the model'scontext_length.
Cursor
Open Cursor Settings → Models, then under API Keys:
- Paste your
deeprelay_live_…key into the OpenAI API Key field. - Turn on Override OpenAI Base URL and enter
https://api.deeprelay.ai/v1. Don't add/chat/completions, because Cursor appends it. - Add a custom model named
deeprelay/deepseek-v4-proand pick it in the chat or agent model picker.
Gotchas:
- Chat and agent only, not Tab. A custom key and base URL apply to chat models. Tab completion keeps using Cursor's built-in models.
- Requests go through Cursor's servers. Cursor builds the final prompt on its backend, so the request to your base URL comes from Cursor's servers, not your machine. The URL has to be publicly reachable.
localhostor a VPN-only host won't work.https://api.deeprelay.ai/v1is public, so this only matters if you front deeprelay with your own proxy. - The override applies to every OpenAI model, not only your custom one. While it's on, Cursor's own OpenAI models also go to deeprelay and fail. Switch it off to use them again.
- Some Cursor modes, agent mode in particular, send OpenAI Responses API payloads. deeprelay now serves
POST /v1/responses, so those requests reach a served endpoint. Cursor's custom-endpoint support for agent mode stays best-effort regardless, because the request still originates from Cursor's own servers, not your machine. Tab completion and Cursor's built-in, Cursor-native models never use a custom endpoint, Responses or otherwise; the override above applies to every other OpenAI model at once. - If you get connection errors that
curldoesn't reproduce, try Cursor Settings → Network → HTTP Compatibility Mode → HTTP/1.1. - Cursor's bring-your-own-key rules depend on your Cursor plan (Teams and Enterprise add a per-token Cursor fee). See Cursor's page linked above.
deeprelay also runs an MCP server that Cursor can connect to. That is a different integration: it gives Cursor's agent deeprelay tools (models, usage, keys), not a model provider.
VS Code (GitHub Copilot)
Copilot Chat supports bring-your-own-key model providers from the chat model
picker. Open the picker, choose Manage Language Models (command: Chat:
Manage Language Models), and pick the Custom Endpoint provider. The
wizard opens a chatLanguageModels.json file for you to edit, not
settings.json; the older github.copilot.chat.customOAIModels setting is
deprecated.
Each provider (or each model within it) takes an apiType: chat-completions
(the default), responses, or messages for the Anthropic Messages format.
If url has no explicit API path, VS Code appends /v1/ itself, so
a url of https://api.deeprelay.ai with apiType: "messages" reaches
deeprelay's /v1/messages.
{
"providers": [
{
"name": "deeprelay",
"vendor": "customendpoint",
"apiType": "messages",
"apiKey": "${input:deeprelayApiKey}",
"models": [
{
"id": "deeprelay/deepseek-v4-pro",
"name": "DeepSeek V4 Pro (deeprelay)",
"url": "https://api.deeprelay.ai",
"toolCalling": true,
"contextWindow": 1048576
}
]
}
]
}
The wizard prompts for deeprelayApiKey and stores the real key in your OS
keychain, not in the file; paste a deeprelay_live_… key when asked. A model
entry also accepts maxOutputTokens and requestHeaders (with a ${apiKey}
token), both optional and set per model.
Constraints worth knowing before you set this up:
- BYOK covers chat and agent mode only. Inline code completions stay on GitHub's own models; there is no override for them.
- Agent mode only lists models that declare
"toolCalling": true. - On Copilot Business or Enterprise, an admin has to enable the BYOK policy on GitHub.com before anyone on the org can add a custom endpoint.
- A Copilot plan is required for the full experience.
There is no per-session launch for VS Code: its model configuration lives in
the app, not a process environment, so deeprelay launch has nothing to
inject. Cline and Continue running inside VS Code remain the extension-based
alternatives documented above.
Pi
Quick start
deeprelay setup pi
Adds a deeprelay provider to ~/.pi/agent/models.json. Its key is a command
that runs deeprelay auth token, so there is nothing to export and no key in
the file.
Undo it with deeprelay setup pi --remove. The manual setup below shows the
same configuration. Full reference:
deeprelay setup pi.
Manual setup
Pi reads custom providers from ~/.pi/agent/models.json.
Add a deeprelay provider:
{
"providers": {
"deeprelay": {
"baseUrl": "https://api.deeprelay.ai/v1",
"api": "openai-completions",
"apiKey": "DEEPRELAY_API_KEY",
"models": [
{
"id": "deeprelay/deepseek-v4-pro",
"reasoning": true,
"contextWindow": 1048576,
"maxTokens": 32768
},
{
"id": "deeprelay/glm-5.3",
"reasoning": true,
"contextWindow": 1048576,
"maxTokens": 32768
}
]
}
}
}
Then start Pi on a deeprelay model, or pick one with /model inside Pi and
press Ctrl+S to make it the default:
pi --provider deeprelay --model deeprelay/deepseek-v4-pro
apiKeyis resolved when Pi starts. A bare name is read from your environment, as above. A value starting with!is run as a shell command and its output is the key, so"apiKey": "!deeprelay auth token"keeps the key in the deeprelay credentials file withdeeprelayon yourPATH. A literal key also works, but then the key sits in the file.contextWindowandmaxTokensdefault to128000and16384when omitted. Set them from the model'scontext_lengthso Pi compacts at the right point.reasoning: trueenables/thinkingfor that model.pi --list-models deeprelayshows what Pi loaded from the file. Pi's/loginis only for its built-in providers and is not needed.
Kimi Code
Quick start
deeprelay setup kimi-code
Adds a deeprelay provider and models to ~/.kimi-code/config.toml and makes
one the default. The key stays out of the file: add the
export DEEPRELAY_API_KEY=... line setup prints to your shell rc.
Undo it with deeprelay setup kimi-code --remove. The manual setup below shows the
same configuration. Full reference:
deeprelay setup kimi-code.
Manual setup
Kimi Code is Moonshot's
open-source terminal agent. Install it with the official script (the older
kimi-cli package on PyPI is unmaintained and only prints a pointer to this
one):
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash
Add a provider and the models you want to ~/.kimi-code/config.toml
($KIMI_CODE_HOME/config.toml if you set that variable):
default_model = "deeprelay/deepseek-v4-pro"
[providers.deeprelay]
type = "openai"
base_url = "https://api.deeprelay.ai/v1"
api_key_env = "DEEPRELAY_API_KEY"
[models."deeprelay/deepseek-v4-pro"]
provider = "deeprelay"
model = "deeprelay/deepseek-v4-pro"
max_context_size = 1048576
max_output_size = 32768
capabilities = ["thinking", "tool_use"]
[models."deeprelay/glm-5.3"]
provider = "deeprelay"
model = "deeprelay/glm-5.3"
max_context_size = 1048576
max_output_size = 32768
capabilities = ["thinking", "tool_use"]
Run kimi doctor to validate the file and kimi provider list to see the
provider, then start kimi. kimi -m deeprelay/glm-5.3 picks a model for
one run.
- A provider takes
api_key_envorapi_key, not both.api_key_envnames the variable to read, so the key stays out of the file. Kimi Code reads credentials only from this file: without one of the two it does not look at your environment at all. capabilitiestells Kimi Code what the model can do, because it can't detect that for a custom provider. Keeptool_use, and leaveimage_inout./loginsigns in to Moonshot's own platform. Skip it; the provider above is all the configuration needed.kimi -p "…"runs one prompt non-interactively. It can't be combined with--auto.
Deep Code
Quick start
deeprelay setup deep-code
Deep Code reads its key only from its settings file, so this command writes
nothing. It checks the model against the deeprelay catalog, prints the
~/.deepcode/settings.json block and the steps to add your key, and exits
non-zero. --remove has nothing to undo. The manual setup below shows the
same configuration. Full reference:
deeprelay setup deep-code.
Manual setup
Deep Code is a community-built terminal agent for DeepSeek models that DeepSeek's API docs link as an integration. It uses the OpenAI Chat Completions client, so it runs on deeprelay with a different base URL.
npm install -g @vegamo/deepcode-cli
Create ~/.deepcode/settings.json for every project, or
./.deepcode/settings.json in a project root for that project only:
{
"env": {
"MODEL": "deeprelay/deepseek-v4-pro",
"BASE_URL": "https://api.deeprelay.ai/v1",
"API_KEY": "deeprelay_live_..."
},
"thinkingEnabled": true
}
Start deepcode in a project. deepcode -x -p "…" runs one prompt without
the TUI.
- Deep Code reads the key only from this file. There is no environment variable, so keep the file at mode
0600, and add a project-level.deepcode/settings.jsonto.gitignore. BASE_URLincludes/v1. Deep Code appends/chat/completionsitself.- To switch models, change
MODEL. Deep Code's/modelmenu is built around DeepSeek's own model names.
DeepSeek Harness
Quick start
deeprelay setup deepseek-harness
Adds a deeprelay model provider to every DeepSeek Harness profile on this
machine (the desktop app, dsh web, dsh --profile headless) and makes one
of its models the default for new sessions. The key stays out of the file:
add the export DEEPRELAY_API_KEY=... line setup prints to your shell rc,
then quit and reopen the app.
Undo it with deeprelay setup deepseek-harness --remove. The manual setup
below shows the same configuration. Full reference:
deeprelay setup deepseek-harness.
Manual setup
DeepSeek Harness is DeepSeek's own
open-source agent. It is a desktop app for macOS and Windows, plus a dsh
command (npm install -g @deepseek-ai/dsh) for a web UI (dsh web) and
one-shot runs (dsh --profile headless "…"). It is not Deep Code (above),
which is a separate community project.
In the app, open Settings → Models → Add model provider and switch the card to Custom model API:
| Field | Value |
|---|---|
| Provider ID | deeprelay |
| Base URL | https:/ (no /) |
| API protocol | Anthropic Messages |
| Models | deeprelay/, deeprelay/ |
The form saves to the profile's cordis.patch.yml: ~/.dsh/profiles/desktop/
for the app, ~/.dsh/profiles/web/ for dsh web. To edit that file directly
instead, add the provider to its llm-pi-ai row and keep any providers
already there:
- id: llm-pi-ai
config:
providers:
deeprelay:
apiKeyEnv: DEEPRELAY_API_KEY
api: anthropic-messages
baseURL: https://api.deeprelay.ai
reasoning: high
models:
- id: deeprelay/deepseek-v4.1-flash
contextWindow: 1048576
reasoningEfforts: { off: none, low: low, medium: medium, high: high }
- id: deeprelay/deepseek-v4-pro
contextWindow: 1048576
reasoningEfforts: { off: none, low: low, medium: medium, high: high }
- id: agent-default-model
config:
provider: deeprelay
model: deeprelay/deepseek-v4.1-flash
Pick a deeprelay model in the model picker, or run
dsh --profile headless "…" for one task.
apiKeyEnvnames the variable to read, so the key stays out of the file. A key typed into the form is stored in~/.dsh/.credentials.yamlinstead. The desktop app reads your login shell's environment when it starts, so an export in~/.zshrcreaches it even when you open it from the Dock.- The base URL has no
/v1: DeepSeek Harness appends/v1/messagesitself, andhttps://api.deeprelay.ai/v1gives a 404 for/v1/v1/messages. reasoningEffortsadds the Effort menu. Without it, a model added by hand never thinks. The form has no field for it, so add it in the file.- Fetch available models in the form lists every deeprelay model, including image and video ones. Tick only chat models; the two above are the ones tested with coding agents.
- Use this custom provider, not the built-in DeepSeek card pointed at deeprelay. That card is your route to DeepSeek's own API. Its requests carry
thinkingin a form deeprelay rejects and DeepSeek-specific session-log fields. ~/.dsh/cordis.patch.yml, if you have one, applies to every profile and wins over the profile files. Keep thellm-pi-airow out of it.
ZCode
ZCode is Z.ai's harness for GLM: a desktop app for macOS, Windows and Linux with a terminal mode. It accepts custom providers in Chat Completions, Responses or Anthropic Messages format. Only Chat Completions is covered here.
In the desktop app, open Model Settings → Add Provider and set:
| Field | Value |
|---|---|
| Name | deeprelay |
| API format | OpenAI (Chat Completions) |
| Base URL | https:/ |
| API Key | your deeprelay_live_… key |
Then click Add Model, enter deeprelay/deepseek-v4-pro, and enable it.
The app stores this in ~/.zcode/v2/provider_config.json, which you can
also write by hand. The minimal form:
{
"schemaVersion": 1,
"config": {
"providerConfigRules": {
"providerRules": [
{
"providerId": "deeprelay",
"providerName": "deeprelay",
"enabled": true,
"config": {
"group": "standard-personal",
"access": { "type": "api-key", "apiKey": "deeprelay_live_..." },
"api": {
"type": "openai-chat-completions",
"baseUrl": "https://api.deeprelay.ai/v1"
},
"personalModelIds": ["deeprelay/deepseek-v4-pro"]
}
}
]
},
"modelConfigRules": {
"providerModelRules": [
{
"providerId": "deeprelay",
"modelId": "deeprelay/deepseek-v4-pro",
"config": {
"enabled": true,
"properties": {
"contextWindow": 1048576,
"supportsToolCall": true,
"inputFormat": { "supportsText": true, "supportsImage": false }
}
}
}
],
"manualProviderModelRules": []
},
"defaultModelSelection": {
"providerId": "deeprelay",
"modelId": "deeprelay/deepseek-v4-pro"
}
}
}
- Inside ZCode the model reference is
providerId/modelId, so the selector is/model deeprelay/deeprelay/deepseek-v4-pro. ThemodelIditself stays the plaindeeprelay/…ID. - The key is stored in the file in plain text. ZCode has no environment variable for it. Keep the file at mode
0600. - ZCode's catalog knows nothing about deeprelay model IDs, which is what the
providerModelRulesentry is for: without it the context window and tool support fall back to defaults. - Terminal use. The desktop app ships the terminal mode. The
zcode-app-clipackage on npm is a community build that bundles the same official runtime behind azcodecommand (npm install -g zcode-app-cli, Node 22.19+). It reads the same provider file; setZCODE_PERSONAL_PROVIDER_CONFIG_FILEto keep a separate one.zcode --prompt "…"runs one prompt without the TUI. AZCode Built-in missingline at startup only means you haven't signed in to Z.ai, which isn't needed. - The first-launch wizard offers Z.ai sign-in. With the provider file in place, press Esc to skip it.
Troubleshooting
401 / "API key is invalid"
{"error":{"message":"API key is invalid, revoked, or expired","type":"authentication_error","code":"unauthorized"}}
That is the message for a key that is well-formed but unknown, revoked or
expired. A malformed key, or one with the wrong prefix, gets the shorter
"API key is invalid".
- Check that the key starts with
deeprelay_live_and has no stray whitespace or quotes. A trailing newline from copy-paste is the usual cause. - Check that the agent reads the key from where you put it: Continue reads
~/.continue/.env, not your shell; Zed reads; Aider reads_API_KEY OPENAI_API_KEY; Pi reads the variable named inapiKeyand Kimi Code the one named inapi_key_env; DeepSeek Harness reads the one named inapiKeyEnv(the desktop app only after a quit and reopen); Deep Code and ZCode read only their own config file. - Check the base URL is
https://api.deeprelay.ai/v1. Keys are per environment, and a production key gets a401on any other host. - Test the key directly. A
200means the key is fine and the agent's config is the problem:
curl -s -o /dev/null -w '%{http_code}\n' https://api.deeprelay.ai/v1/models \
-H "Authorization: Bearer $DEEPRELAY_API_KEY"
A trial key also returns 401 after its expiry date, and any key returns
402 insufficient_balance when credit runs out. See Trial
keys.
model_not_found
{"error":{"message":"Model \"deeprelay/…\" is not available. Try another model — see GET /v1/models for the current list.","type":"invalid_request_error","param":"model","code":"model_not_found"}}
- List what is actually served:
curl -s https://api.deeprelay.ai/v1/models \
-H "Authorization: Bearer $DEEPRELAY_API_KEY" | jq -r '.data[].id'
- Copy the ID exactly, including the
deeprelay/prefix. For Aider, addopenai/in front (openai/deeprelay/deepseek-v4-pro). For Kilo Code's and ZCode's selectors, add the provider ID (deeprelay/deeprelay/deepseek-v4-pro). The ID in the provider's own model list (modelsin Kilo Code,personalModelIdsin ZCode) stays the plaindeeprelay/…ID, with no extra prefix. - The catalog is live, so a model can drop out between refreshes. If an ID that worked yesterday is gone, pick another from the list.
The agent says tools or tool calls are unsupported
- Check the model supports tools. Its
supported_parametersinGET /v1/modelsmust includetools. Use thejqfilter under Picking a model. Sending tools to a model that doesn't list them gives whatever that upstream does. Sometimes that's an error, sometimes the tools are silently ignored. - Check the agent knows the model supports tools. Agents can't detect it on their own for a custom endpoint: set
capabilities: [tool_use]in Continue,"tool_call": truein Kilo Code,"tools": truein Zed,capabilities = ["tool_use"]in Kimi Code, and"supportsToolCall": truein ZCode. deeprelay/glm-5.3accepts onlytool_choice: "auto". An agent that forces a tool ("required"or a named function) gets a400namingtool_choice. Switch todeeprelay/glm-5.2or a DeepSeek V4 model, which accept every mode.parallel_tool_callsis accepted and ignored, so it can't cause this error. A model may still return several calls in one turn.
Still stuck? Email support@deeprelay.ai with the agent name and version,
the model ID, and the exact error body.