Skip to content

Use Claude Code with your ChatGPT, Kimi, Cursor or Grok subscription via a local Anthropic-compatible proxy

Rust

rename KIMI_OAUTH_HOST and KIMI_BASE_URL to CCP_ prefix

Raine Virtae4b3ec658d95
diff --git a/README.md b/README.md
index c400ce9..0916959 100644
--- a/README.md
+++ b/README.md
@@ -472,8 +472,8 @@ directory the auth tokens use, deliberately not `~/Library`) and at
| `XDG_STATE_HOME` | — | `~/.local/state` | Base dir for `proxy.log` |
| `CCP_LOG_STDERR` | `log.stderr` | unset | Also mirror log lines to stderr |
| `CCP_LOG_VERBOSE` | `log.verbose` | unset | Log full request/response bodies + every SSE event |
-| `KIMI_OAUTH_HOST` | `kimi.oauthHost` | `https://auth.kimi.com` | Override Kimi's OAuth host (debugging only) |
-| `KIMI_BASE_URL` | `kimi.baseUrl` | `https://api.kimi.com/coding/v1` | Override Kimi's API base URL |
+| `CCP_KIMI_OAUTH_HOST` | `kimi.oauthHost` | `https://auth.kimi.com` | Override Kimi's OAuth host (debugging only) |
+| `CCP_KIMI_BASE_URL` | `kimi.baseUrl` | `https://api.kimi.com/coding/v1` | Override Kimi's API base URL |
| `CCP_CODEX_MODEL` | `codex.model` | unset | Force all Codex requests to this model (`gpt-5.2`, `gpt-5.3-codex`, `gpt-5.4`, `gpt-5.4-mini`) |
| `CCP_CODEX_EFFORT` | `codex.effort` | unset | Force all Codex requests to this reasoning effort (`none`, `low`, `medium`, `high`, `xhigh`) |
| `CCP_CODEX_ORIGINATOR` | `codex.originator` | `claude-code-proxy` | Override the `originator` header sent to Codex |
diff --git a/src/cli.ts b/src/cli.ts
index 5d6d75c..685519a 100755
--- a/src/cli.ts
+++ b/src/cli.ts
@@ -140,10 +140,10 @@ function printConfigSummary(): void {
if (cfg.env.CCP_LOG_STDERR !== undefined) overrides.push("CCP_LOG_STDERR (env)")
else if (fromFile.log?.stderr) overrides.push("log.stderr (config)")
- if (cfg.env.KIMI_OAUTH_HOST) overrides.push("KIMI_OAUTH_HOST (env)")
+ if (cfg.env.CCP_KIMI_OAUTH_HOST) overrides.push("CCP_KIMI_OAUTH_HOST (env)")
else if (fromFile.kimi?.oauthHost) overrides.push("kimi.oauthHost (config)")
- if (cfg.env.KIMI_BASE_URL) overrides.push("KIMI_BASE_URL (env)")
+ if (cfg.env.CCP_KIMI_BASE_URL) overrides.push("CCP_KIMI_BASE_URL (env)")
else if (fromFile.kimi?.baseUrl) overrides.push("kimi.baseUrl (config)")
if (overrides.length > 0) {
diff --git a/src/config.test.ts b/src/config.test.ts
index 3ab96ba..8444ca9 100644
--- a/src/config.test.ts
+++ b/src/config.test.ts
@@ -141,8 +141,8 @@ describe("empty env-string compatibility", () => {
expect(codexUserAgent("default-ua")).toBe("")
})
- it("empty KIMI_OAUTH_HOST env is a valid value (legacy ?? semantics)", () => {
- setEnv({ KIMI_OAUTH_HOST: "" })
+ it("empty CCP_KIMI_OAUTH_HOST env is a valid value (legacy ?? semantics)", () => {
+ setEnv({ CCP_KIMI_OAUTH_HOST: "" })
expect(kimiOauthHost()).toBe("")
})
diff --git a/src/config.ts b/src/config.ts
index 03edea5..ecf50df 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -205,12 +205,12 @@ export function kimiUserAgent(defaultValue: string): string {
export function kimiOauthHost(): string {
const c = getConfig()
- return c.env.KIMI_OAUTH_HOST ?? c.file.kimi?.oauthHost ?? "https://auth.kimi.com"
+ return c.env.CCP_KIMI_OAUTH_HOST ?? c.file.kimi?.oauthHost ?? "https://auth.kimi.com"
}
export function kimiBaseUrl(): string {
const c = getConfig()
- return c.env.KIMI_BASE_URL ?? c.file.kimi?.baseUrl ?? "https://api.kimi.com/coding/v1"
+ return c.env.CCP_KIMI_BASE_URL ?? c.file.kimi?.baseUrl ?? "https://api.kimi.com/coding/v1"
}
// Additive: error/warn always go to stderr in log.ts; this getter only
diff --git a/src/providers/kimi/auth/constants.ts b/src/providers/kimi/auth/constants.ts
index 8c2553f..58fbf9a 100644
--- a/src/providers/kimi/auth/constants.ts
+++ b/src/providers/kimi/auth/constants.ts
@@ -1,7 +1,7 @@
import { kimiBaseUrl, kimiOauthHost } from "../../../config.ts"
export const CLIENT_ID = "17e5f671-d194-4dfb-9706-5516cb48c098"
-// Read lazily so config.json values apply. KIMI_OAUTH_HOST / KIMI_BASE_URL
+// Read lazily so config.json values apply. CCP_KIMI_OAUTH_HOST / CCP_KIMI_BASE_URL
// env vars still work (env wins over file in the getter).
export function oauthHost(): string {
return kimiOauthHost()