Coding agent config generator base URLs verified 2026-09-17
BYOK in three minutes: every snippet below uses officially documented endpoints and environment variables from the provider's own docs (community-reported exceptions are flagged on the card). Swap one base URL + one key, and your existing agent runs on a model that costs 5–20× less per token. Pair with the price table to pick your target.
Claude Code ANTHROPIC_BASE_URL · ANTHROPIC_AUTH_TOKEN · ANTHROPIC_MODEL
Point Claude Code at any Anthropic-protocol endpoint by exporting three env vars before launching `claude`.
Z.ai GLM (Coding Plan or API)
Z.ai exposes an Anthropic-protocol endpoint. The GLM Coding Plan (subscription, from $18/mo) and pay-as-you-go API both use it.
💰 GLM-5.3 $1.40/$4.40 · GLM-5.3-Flash $0.15/$0.50 per 1M · see table
export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
export ANTHROPIC_AUTH_TOKEN="YOUR_ZAI_API_KEY"
export ANTHROPIC_MODEL="glm-5.3" # or glm-5.3-flash for speed
# then start a NEW shell: claudeℹ️ OpenAI-protocol base URL (for Codex CLI etc.): https://api.z.ai/api/v1 — see the Codex section below.
DeepSeek
DeepSeek officially serves the Anthropic Messages protocol at /anthropic — no proxy needed.
💰 deepseek-flash $0.30/$1.20 peak ($0.15/$0.60 off-peak) per 1M · see table
export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="YOUR_DEEPSEEK_API_KEY"
export ANTHROPIC_MODEL="deepseek-flash"
# then start a NEW shell: claudeℹ️ Legacy model alias deepseek-chat still works. Thinking mode: deepseek-reasoner.
SiliconFlow
SiliconFlow's Anthropic-compatible gateway proxies their whole catalog (DeepSeek, GLM, Kimi) through one base URL.
💰 DeepSeek-V4-Flash $0.13/$0.28 · GLM-5.3-Flash $0.15/$0.50 per 1M · see table
export ANTHROPIC_BASE_URL="https://api.siliconflow.com/"
export ANTHROPIC_AUTH_TOKEN="YOUR_SILICONFLOW_API_KEY"
export ANTHROPIC_MODEL="DeepSeek-V4-Flash" # or GLM-5.3-Flash, Kimi-K2.6
# then start a NEW shell: claudeℹ️ Community-reported endpoint — verify against your SiliconFlow console before use. Get keys at cloud.siliconflow.com/account/ak.
export ANTHROPIC_DEFAULT_SONNET_MODEL="glm-5.3"
export ANTHROPIC_DEFAULT_OPUS_MODEL="glm-5.3"
export ANTHROPIC_SMALL_FAST_MODEL="glm-5.3-flash"ℹ️ Claude Code uses a small fast model for background tasks — pointing it at a flash-tier model cuts bills further.
Codex CLI model_provider · model_providers.<id>.base_url · env_key
Codex reads model providers from ~/.codex/config.toml. Add a provider block, flip two keys, done.
Z.ai GLM
Use Z.ai's dedicated OpenAI Responses protocol endpoint (per the official Codex guide). GLM model metadata must be declared in ~/.codex/models.json (model_catalog_json).
💰 GLM-5.3 $1.40/$4.40 · GLM-5.3-Flash $0.15/$0.50 per 1M · see table
model = "glm-5.3" # or glm-5.3-flash
model_provider = "zai"
model_catalog_json = "~/.codex/models.json" # model metadata, see Z.ai guide
[model_providers.zai]
name = "Z.ai GLM"
base_url = "https://api.z.ai/api/v1"
env_key = "ZAI_API_KEY" # export ZAI_API_KEY=... in your shell
wire_api = "responses"DeepSeek
DeepSeek's main endpoint is OpenAI-compatible out of the box.
💰 deepseek-flash $0.30/$1.20 peak, $0.15/$0.60 off-peak per 1M · see table
model = "deepseek-flash"
model_provider = "deepseek"
[model_providers.deepseek]
name = "DeepSeek"
base_url = "https://api.deepseek.com"
env_key = "DEEPSEEK_API_KEY"
wire_api = "responses"SiliconFlow
One key, whole catalog: DeepSeek, GLM, Kimi, Qwen at aggregator pricing.
💰 DeepSeek-V4-Flash $0.13/$0.28 · Kimi-K2.6 $0.77/$3.40 per 1M · see table
model = "DeepSeek-V4-Flash" # or GLM-5.3-Flash, Kimi-K2.6
model_provider = "siliconflow"
[model_providers.siliconflow]
name = "SiliconFlow"
base_url = "https://api.siliconflow.com/v1"
env_key = "SILICONFLOW_API_KEY"
wire_api = "responses"Cline (VS Code) Provider = OpenAI Compatible · Base URL · API Key · Model ID
Cline is configured in its settings panel — pick “OpenAI Compatible”, then fill in these exact values.
Z.ai GLM
General OpenAI-compatible endpoint (pay-as-you-go API).
💰 GLM-5.3 $1.40/$4.40 per 1M · see table
API Provider: OpenAI Compatible
Base URL: https://api.z.ai/api/paas/v4/
API Key: YOUR_ZAI_API_KEY
Model ID: glm-5.3DeepSeek
Native “DeepSeek” provider also exists in Cline; the OpenAI-compatible route works too.
💰 deepseek-flash $0.30/$1.20 peak per 1M · see table
API Provider: OpenAI Compatible
Base URL: https://api.deepseek.com
API Key: YOUR_DEEPSEEK_API_KEY
Model ID: deepseek-flashSiliconFlow
Values below are from SiliconFlow's official Cline integration guide.
💰 DeepSeek-V4-Flash $0.13/$0.28 per 1M · see table
API Provider: OpenAI Compatible
Base URL: https://api.siliconflow.com/v1
API Key: get it at cloud.siliconflow.com/account/ak
Model ID: DeepSeek-V4-Flash (browse: cloud.siliconflow.com/models)FAQ
- Will my agent still work exactly the same?
- Mostly yes — these endpoints implement the same protocol (Anthropic Messages or OpenAI Chat Completions). Tool/function calling is supported on all three providers above. Reasoning-model behavior differs per model, so budget a day of testing on your real repo.
- Coding Plan vs pay-as-you-go API — which is cheaper?
- Z.ai's GLM Coding Plan starts at $18/month with generous usage quotas — if you code daily, it usually beats API pricing; light users should stay on pay-as-you-go (flash-tier models can cost under $1/month, see the calculator).
- Are these env vars official?
- ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN / ANTHROPIC_MODEL are Anthropic's documented Claude Code settings. DeepSeek and Z.ai publish the exact values above in their own integration guides; SiliconFlow's Claude Code endpoint is community-reported (see note on the card). Codex provider blocks follow Codex CLI's config.toml format.
- Where do I get API keys?
- platform.deepseek.com · z.ai API Keys page · cloud.siliconflow.com/account/ak. Never commit keys — keep them in shell env or a secret manager.