Prerequisites
Register at codegateway.dev — $2 trial credit included.
Create an API key in Dashboard → API Keys (starts with sk-cg-).
Loading…
Reasonix speaks DeepSeek-compatible endpoints; one baseUrl connects it to CodeGateway (0.53.x and v1.x configs).
Register at codegateway.dev — $2 trial credit included.
Create an API key in Dashboard → API Keys (starts with sk-cg-).
reasonix --versionReasonix has two major version lines with different config formats — do not mix them:
0.53.x (current npm mainstream): JSON config ~/.reasonix/config.json with top-level baseUrl / apiKey / model.
v1.x (Go rewrite): TOML config ~/.reasonix/config.toml with [[providers]] tables + api_key_env (keys live in a global .env).
The quickest path — two variables:
export DEEPSEEK_BASE_URL="https://api.codegateway.dev/v1"
export DEEPSEEK_API_KEY="sk-cg-your-key"DEEPSEEK_API_BASE_URL is an accepted alias of DEEPSEEK_BASE_URL. Then just run reasonix.
{
"baseUrl": "https://api.codegateway.dev/v1",
"apiKey": "sk-cg-your-key",
"model": "deepseek-v4-pro"
}baseUrl: CodeGateway's OpenAI-compatible base URL, always https://api.codegateway.dev/v1.
apiKey: your key. If both env vars and config are set, env wins — and they must come as a pair (baseUrl + apiKey from the same source).
model: default model id, matching the model list.
~/.reasonix/config.toml:
[[providers]]
name = "cg"
kind = "openai" # openai | anthropic
base_url = "https://api.codegateway.dev/v1"
models = ["deepseek-v4-pro"]
default = true
api_key_env = "CG_KEY"Put the key in Reasonix's global .env (e.g. ~/.reasonix/.env):
CG_KEY=sk-cg-your-keyReasonix calls through a DeepSeek-compatible endpoint; verified models on CodeGateway's OpenAI surface:
deepseek-v4-pro: first choice, prefix-cache friendly.
deepseek-v4-flash: lighter tasks.
kimi-k2.7-code / glm-5.3: also OpenAI-compatible; swap freely (Reasonix trusts custom-endpoint model namespaces).
Note: GPT-series models are region-restricted upstream; Claude / Gemini models are not OpenAI-compatible — do not configure them here.
Q: How do I know which version I have? reasonix --version. 0.53.x shows x.y.z; the v1.x Go rewrite shows 1.x+.
Q: Both env vars and config are set — which wins? Env vars win, and they work as a pair: if you set the base URL via env, put the key in env too, otherwise the key comes from the config and the endpoint/key mismatch breaks auth.
Q: Auth failure after launch? Reasonix does not pre-validate custom endpoints — the first call reveals problems. Check the key with the models endpoint below.
Q: Can I change only the model? Yes, edit model alone — but the id must exist in the model list.
Model list (Dashboard → Models)