Reasonix Integration with CodeGateway: DeepSeek-Compatible Endpoint Setup

(Unofficial)

This guide is independently community-maintained. It is not affiliated with, endorsed by, or sponsored by the vendor of the third-party tool it covers. All third-party trademarks are the property of their respective owners.

Reasonix speaks DeepSeek-compatible endpoints; one baseUrl connects it to CodeGateway (0.53.x and v1.x configs).

Prerequisites

  • Register at codegateway.dev — trial credit included after you bind a card (current amount shown on the signup/pricing page).

  • Create an API key in Dashboard → API Keys (starts with sk-cg-).

  • Check your version first: reasonix --version.

Version check (important)

Reasonix 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).

Option A: Environment variables (0.53.x)

The quickest path — two variables:

bash
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.

Option B: Config file ~/.reasonix/config.json (0.53.x)

json
{
"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.

v1.x (Go rewrite) config

~/.reasonix/config.toml:

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):

bash
CG_KEY=sk-cg-your-key

Reasonix 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.

FAQ

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.

References

Turn this doc into a real API call

Lacking an official key or facing overseas card payment issues? Create an sk-cg- key after signing up, point your base URL at CodeGateway, and keep your existing SDK or CLI unchanged. Pay per token; binding a card adds free credit.

Sign up free
Author:CodeGateway Team