@codexapi/codexclaude 2.0.11 → 2.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CUSTOMIZATIONS.md +17 -7
- package/README.md +14 -7
- package/bin/codexclaude.js +126 -18
- package/codexclaude.md +45 -21
- package/package.json +5 -3
package/CUSTOMIZATIONS.md
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
## Upstream Runtime
|
|
6
6
|
|
|
7
7
|
- Official package: `@openai/codex`
|
|
8
|
-
- Pinned runtime version: `0.
|
|
9
|
-
- Local launcher version: `2.0.
|
|
8
|
+
- Pinned runtime version: `0.142.2`
|
|
9
|
+
- Local launcher version: `2.0.13`
|
|
10
10
|
|
|
11
11
|
## Launcher Behavior
|
|
12
12
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
The launcher writes a Codex model provider named `codexapi`:
|
|
24
24
|
|
|
25
|
-
- `base_url = "https://codexapi.pro/v1"` for ChatGPT-5.5
|
|
25
|
+
- `base_url = "https://codexapi.pro/v1"` for ChatGPT-5.5, Deepseek v4 Budget, and Google Gemini Flash 3.5, or `https://api-chicago.codexapi.pro/v1` for Opus 4.8.
|
|
26
26
|
- `wire_api = "responses"`
|
|
27
27
|
- `supports_websockets = false`
|
|
28
28
|
- `experimental_bearer_token` set to the customer API username
|
|
@@ -30,16 +30,20 @@ The launcher writes a Codex model provider named `codexapi`:
|
|
|
30
30
|
|
|
31
31
|
## Runtime Defaults
|
|
32
32
|
|
|
33
|
-
- Model: selected by the user, defaulting to `gpt-5.5`; supported launcher choices are `gpt-5.5`, `claude-opus-4-8`,
|
|
33
|
+
- Model: selected by the user, defaulting to `gpt-5.5`; supported launcher choices are `gpt-5.5`, `claude-opus-4-8`, `claude-sonnet-4-6`, `claude-fable-5`, `deepseek-v4-pro`, and `gemini-3.5-flash`.
|
|
34
34
|
- Reasoning effort displayed in Codex: `xhigh`
|
|
35
|
-
- Server-side upstream reasoning effort: `
|
|
36
|
-
- Local model catalog: `~/.codexclaude/model_catalog.json`; this keeps native Codex `/model` limited to the
|
|
35
|
+
- Server-side upstream reasoning effort: `high`, enforced by CodexAPI.pro regardless of client display.
|
|
36
|
+
- Local model catalog: `~/.codexclaude/model_catalog.json`; this keeps native Codex `/model` limited to the six supported CodexAPI.pro choices and prevents fallback metadata warnings for Opus 4.8, Sonnet 4.6, Fable 5, Deepseek v4 Budget, and Google Gemini Flash 3.5.
|
|
37
37
|
- Service tier: omitted by default; `/fast` remains a user-controlled Codex setting and is billed server-side when active.
|
|
38
38
|
- Approval policy: `never`
|
|
39
39
|
- Sandbox mode: `danger-full-access`
|
|
40
40
|
- TUI status line: `model-with-reasoning`, `fast-mode`, `current-dir`
|
|
41
|
-
-
|
|
41
|
+
- Claude-family Responses traffic uses the Claude-compatible CodexAPI.pro endpoint for CodexAPI.pro and ChatPlus accounts, while MyAPI.world accounts keep the MyAPI endpoint.
|
|
42
|
+
- Fable 5 stays visible to the user while the backend applies the custom routed premium path and 5x billing multiplier.
|
|
42
43
|
- Deepseek v4 Budget Responses traffic is routed through CodexAPI.pro's Deepseek-compatible gateway.
|
|
44
|
+
- Google Gemini Flash 3.5 Responses traffic keeps the user-visible Gemini model id while CodexAPI.pro routes it internally through Sonnet 4.6 with the configured server effort.
|
|
45
|
+
|
|
46
|
+
Current backend state verified on 2026-06-25: Admin Manage Models controls runtime routing server-side. This operational routing must not change the launcher-visible model ids, model catalog, or customer-facing labels.
|
|
43
47
|
|
|
44
48
|
## Wallet Display
|
|
45
49
|
|
|
@@ -54,3 +58,9 @@ The same wallet lookup is available through:
|
|
|
54
58
|
```bash
|
|
55
59
|
codexclaude status
|
|
56
60
|
```
|
|
61
|
+
|
|
62
|
+
Recent token usage is available through:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
codexclaude usage
|
|
66
|
+
```
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# codexclaude
|
|
2
2
|
|
|
3
|
-
`codexclaude` is the CodexAPI.pro launcher for customers who want one coding CLI that can use ChatGPT-5.5, Opus 4.8,
|
|
3
|
+
`codexclaude` is the CodexAPI.pro launcher for customers who want one coding CLI that can use ChatGPT-5.5, Opus 4.8, Sonnet 4.6, Fable 5, Deepseek v4 Budget, or Google Gemini Flash 3.5 against the same Token Wallet.
|
|
4
4
|
|
|
5
|
-
Version `2.0.
|
|
5
|
+
Version `2.0.13` launches the official OpenAI Codex CLI `0.142.2` package and applies account, wallet, model, and Full Access defaults before Codex starts.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -48,7 +48,7 @@ Switch model:
|
|
|
48
48
|
codexclaude model
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
Available model labels are `ChatGPT-5.5`, `Opus 4.8`,
|
|
51
|
+
Available model labels are `ChatGPT-5.5`, `Opus 4.8`, `Sonnet 4.6`, `Fable 5`, `Deepseek v4 Budget`, and `Google Gemini Flash 3.5`. All six use a Responses-compatible endpoint and the same customer Token Wallet.
|
|
52
52
|
|
|
53
53
|
Show current launcher changes:
|
|
54
54
|
|
|
@@ -70,17 +70,24 @@ You can also check this without starting Codex:
|
|
|
70
70
|
codexclaude status
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
+
Show recent wallet-billed token usage:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
codexclaude usage
|
|
77
|
+
```
|
|
78
|
+
|
|
73
79
|
## Preserved CodexAPI.pro Customizations
|
|
74
80
|
|
|
75
81
|
- Dashboard username or email plus password login.
|
|
76
|
-
- ChatGPT-5.5, Opus 4.8,
|
|
82
|
+
- ChatGPT-5.5, Opus 4.8, Sonnet 4.6, Fable 5, Deepseek v4 Budget, or Google Gemini Flash 3.5 model selection.
|
|
77
83
|
- CodexAPI.pro Responses-compatible provider at `https://codexapi.pro/v1`.
|
|
78
84
|
- Full Access defaults: approval policy `never` and sandbox mode `danger-full-access`.
|
|
79
85
|
- xhigh visible reasoning in the local Codex UI while CodexAPI.pro keeps upstream runtime effort server-managed.
|
|
80
|
-
- A local `~/.codexclaude/model_catalog.json` file so native Codex `/model` lists only ChatGPT-5.5, Opus 4.8,
|
|
86
|
+
- A local `~/.codexclaude/model_catalog.json` file so native Codex `/model` lists only ChatGPT-5.5, Opus 4.8, Sonnet 4.6, Fable 5, Deepseek v4 Budget, and Google Gemini Flash 3.5.
|
|
81
87
|
- No default fast service tier. Fast mode is billed only when the user enables it inside Codex.
|
|
82
|
-
- Official Codex `0.
|
|
83
|
-
- Token Wallet balance lookup before launch and in `codexclaude
|
|
88
|
+
- Official Codex `0.142.2` runtime with the current profile-compatible config enabled.
|
|
89
|
+
- Token Wallet balance lookup before launch, in `codexclaude status`, and recent usage in `codexclaude usage`.
|
|
84
90
|
- Opus 4.8 tool-call compatibility through the Chicago CodexAPI.pro Responses gateway.
|
|
91
|
+
- Google Gemini Flash 3.5 is visible to users while CodexAPI.pro routes it server-side through the approved Sonnet 4.6 low-effort bridge.
|
|
85
92
|
- Backend-identifying request headers so CodexAPI.pro can enforce subscription plan rules server-side.
|
|
86
93
|
- npm latest-version checks before coding starts, with an explicit update command when a newer required launcher exists.
|
package/bin/codexclaude.js
CHANGED
|
@@ -10,10 +10,10 @@ import { stdin as input, stdout as output } from "node:process";
|
|
|
10
10
|
|
|
11
11
|
const require = createRequire(import.meta.url);
|
|
12
12
|
|
|
13
|
-
const APP_VERSION = "2.0.
|
|
14
|
-
const CODEX_VERSION = "0.
|
|
13
|
+
const APP_VERSION = "2.0.13";
|
|
14
|
+
const CODEX_VERSION = "0.142.2";
|
|
15
15
|
const DISPLAY_REASONING_EFFORT = "xhigh";
|
|
16
|
-
const SERVER_REASONING_EFFORT = "
|
|
16
|
+
const SERVER_REASONING_EFFORT = "high";
|
|
17
17
|
const API_ORIGIN = (process.env.CODEXCLAUDE_API_ORIGIN || "https://codexapi.pro").replace(/\/+$/, "");
|
|
18
18
|
const API_BASE_URL = `${API_ORIGIN}/v1`;
|
|
19
19
|
const CHICAGO_API_ORIGIN = "https://api-chicago.codexapi.pro";
|
|
@@ -52,12 +52,28 @@ const MODELS = {
|
|
|
52
52
|
label: "Opus 4.8",
|
|
53
53
|
aliases: ["2", "opus", "opus-4.8", "opus-4.7", "claude", "claude-opus-4-8", "claude-opus-4-7"],
|
|
54
54
|
},
|
|
55
|
+
"claude-sonnet-4-6": {
|
|
56
|
+
id: "claude-sonnet-4-6",
|
|
57
|
+
label: "Sonnet 4.6",
|
|
58
|
+
aliases: ["3", "sonnet", "sonnet-4.6", "sonnet-4-6", "claude-sonnet-4-6", "claude-sonnet-4.6"],
|
|
59
|
+
},
|
|
60
|
+
"claude-fable-5": {
|
|
61
|
+
id: "claude-fable-5",
|
|
62
|
+
label: "Fable 5",
|
|
63
|
+
aliases: ["4", "fable", "fable-5", "fabel", "fabel-5", "claude-fable-5", "claude-fabel-5"],
|
|
64
|
+
premium: true,
|
|
65
|
+
},
|
|
55
66
|
"deepseek-v4-pro": {
|
|
56
67
|
id: "deepseek-v4-pro",
|
|
57
68
|
label: "Deepseek v4 Budget",
|
|
58
|
-
aliases: ["
|
|
69
|
+
aliases: ["5", "deepseek", "deepseek-v4", "deepseek-v4-pro", "budget"],
|
|
59
70
|
budget: true,
|
|
60
71
|
},
|
|
72
|
+
"gemini-3.5-flash": {
|
|
73
|
+
id: "gemini-3.5-flash",
|
|
74
|
+
label: "Google Gemini Flash 3.5",
|
|
75
|
+
aliases: ["6", "gemini", "flash", "gemini-flash", "gemini-3.5-flash", "gemini-flash-3.5", "google-gemini-flash-3.5"],
|
|
76
|
+
},
|
|
61
77
|
};
|
|
62
78
|
|
|
63
79
|
async function main() {
|
|
@@ -88,6 +104,10 @@ async function main() {
|
|
|
88
104
|
await status();
|
|
89
105
|
return;
|
|
90
106
|
}
|
|
107
|
+
if (command === "usage") {
|
|
108
|
+
await usage();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
91
111
|
if (command === "model") {
|
|
92
112
|
await modelFlow();
|
|
93
113
|
return;
|
|
@@ -117,12 +137,13 @@ codexclaude ${APP_VERSION}
|
|
|
117
137
|
|
|
118
138
|
Commands:
|
|
119
139
|
codexclaude login Login with CodexAPI.pro username/email and password
|
|
120
|
-
codexclaude model Select ChatGPT-5.5, Opus 4.8,
|
|
140
|
+
codexclaude model Select ChatGPT-5.5, Opus 4.8, Sonnet 4.6, Fable 5, Deepseek v4 Budget, or Google Gemini Flash 3.5
|
|
121
141
|
codexclaude changelog Show the latest CodexAPI.pro launcher changes
|
|
122
142
|
codexclaude setup Rewrite ~/.codex/config.toml with Full Access defaults
|
|
123
143
|
codexclaude start Start Codex with --search
|
|
124
144
|
codexclaude resume Resume with codex resume --search
|
|
125
145
|
codexclaude status Show saved account, selected model, and wallet balance
|
|
146
|
+
codexclaude usage Show wallet balance and recent token usage
|
|
126
147
|
codexclaude logout Remove saved codexclaude account state
|
|
127
148
|
|
|
128
149
|
Any other command is passed through to official Codex CLI ${CODEX_VERSION} after config is applied.
|
|
@@ -218,16 +239,17 @@ async function ensureReady() {
|
|
|
218
239
|
async function askModel(rl, current) {
|
|
219
240
|
const currentLabel = MODELS[current]?.label || MODELS["gpt-5.5"].label;
|
|
220
241
|
console.log("\nChoose your coding model:");
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
242
|
+
Object.values(MODELS).forEach((model, index) => {
|
|
243
|
+
const premium = model.premium ? " (5x premium billing)" : "";
|
|
244
|
+
console.log(` ${index + 1}. ${model.label}${premium}`);
|
|
245
|
+
});
|
|
224
246
|
const answer = (await rl.question(`Model [${currentLabel}]: `)).trim().toLowerCase();
|
|
225
247
|
if (!answer) {
|
|
226
248
|
return MODELS[current] ? current : "gpt-5.5";
|
|
227
249
|
}
|
|
228
250
|
const match = Object.values(MODELS).find((model) => model.aliases.includes(answer));
|
|
229
251
|
if (!match) {
|
|
230
|
-
throw new Error("Unknown model choice.
|
|
252
|
+
throw new Error("Unknown model choice. Run codexclaude model and choose one of the numbered options.");
|
|
231
253
|
}
|
|
232
254
|
return match.id;
|
|
233
255
|
}
|
|
@@ -360,6 +382,14 @@ async function getJsonAuth(pathname, config, options = {}) {
|
|
|
360
382
|
}
|
|
361
383
|
}
|
|
362
384
|
|
|
385
|
+
async function tryGetJsonAuth(pathname, config, options = {}) {
|
|
386
|
+
try {
|
|
387
|
+
return await getJsonAuth(pathname, config, options);
|
|
388
|
+
} catch {
|
|
389
|
+
return null;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
363
393
|
function updateRequiredMessage(metadata) {
|
|
364
394
|
if (typeof metadata === "string") {
|
|
365
395
|
return metadata;
|
|
@@ -500,9 +530,18 @@ function modelCatalogDescription(modelId) {
|
|
|
500
530
|
if (modelId === "claude-opus-4-8") {
|
|
501
531
|
return "CodexAPI.pro Opus 4.8 coding route with local Codex tools and wallet billing.";
|
|
502
532
|
}
|
|
533
|
+
if (modelId === "claude-sonnet-4-6") {
|
|
534
|
+
return "CodexAPI.pro Sonnet 4.6 coding route with local Codex tools and wallet billing.";
|
|
535
|
+
}
|
|
536
|
+
if (modelId === "claude-fable-5") {
|
|
537
|
+
return "CodexAPI.pro Fable 5 premium coding route with local Codex tools and wallet billing.";
|
|
538
|
+
}
|
|
503
539
|
if (modelId === "deepseek-v4-pro") {
|
|
504
540
|
return "CodexAPI.pro Deepseek v4 Budget coding route with local Codex tools and wallet billing.";
|
|
505
541
|
}
|
|
542
|
+
if (modelId === "gemini-3.5-flash") {
|
|
543
|
+
return "CodexAPI.pro Google Gemini Flash 3.5 coding route with local Codex tools and wallet billing.";
|
|
544
|
+
}
|
|
506
545
|
return "CodexAPI.pro ChatGPT-5.5 coding route with local Codex tools and wallet billing.";
|
|
507
546
|
}
|
|
508
547
|
|
|
@@ -555,6 +594,46 @@ async function status() {
|
|
|
555
594
|
}
|
|
556
595
|
}
|
|
557
596
|
|
|
597
|
+
async function usage() {
|
|
598
|
+
const config = readConfig();
|
|
599
|
+
if (!config?.username) {
|
|
600
|
+
console.log("Not logged in. Run: codexclaude login");
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
console.log(`Logged in as: ${config.username}`);
|
|
604
|
+
console.log(`API: ${config.apiOrigin || API_ORIGIN}`);
|
|
605
|
+
try {
|
|
606
|
+
const wallet = await walletSnapshot(config);
|
|
607
|
+
console.log(`Token Wallet: ${formatUsd(wallet.balance)}`);
|
|
608
|
+
} catch (error) {
|
|
609
|
+
console.log(`Token Wallet: unavailable (${error.message})`);
|
|
610
|
+
}
|
|
611
|
+
const usagePayload = await usageSnapshot(config);
|
|
612
|
+
if (!usagePayload) {
|
|
613
|
+
console.log("Usage: unavailable from this account endpoint.");
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
const summary = usagePayload.summary || {};
|
|
617
|
+
const totalUsd = summary.totalChargedUsd || summary.totalUsd || summary.chargedUsd || null;
|
|
618
|
+
if (totalUsd !== null && totalUsd !== undefined) {
|
|
619
|
+
console.log(`Recent usage total: ${formatUsd(numericWalletValue(totalUsd))}`);
|
|
620
|
+
}
|
|
621
|
+
const transactions = Array.isArray(usagePayload.transactions) ? usagePayload.transactions.slice(0, 10) : [];
|
|
622
|
+
if (!transactions.length) {
|
|
623
|
+
console.log("No token usage transactions are recorded yet.");
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
console.log("\nRecent token usage:");
|
|
627
|
+
for (const item of transactions) {
|
|
628
|
+
const when = item.createdAt || item.created_at || "";
|
|
629
|
+
const model = item.model || item.modelId || item.service || "model";
|
|
630
|
+
const amount = item.chargedUsd ?? item.charged_usd ?? item.amountUsd ?? item.amount_usd ?? "0";
|
|
631
|
+
const inputTokens = item.inputTokens ?? item.input_tokens ?? 0;
|
|
632
|
+
const outputTokens = item.outputTokens ?? item.output_tokens ?? 0;
|
|
633
|
+
console.log(`- ${when} · ${model} · ${formatUsd(numericWalletValue(amount))} · in ${inputTokens} / out ${outputTokens}`);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
558
637
|
async function runCodex(args) {
|
|
559
638
|
const config = requireConfig();
|
|
560
639
|
let wallet = null;
|
|
@@ -647,12 +726,10 @@ function resolveBundledCodexLaunch() {
|
|
|
647
726
|
}
|
|
648
727
|
|
|
649
728
|
async function walletSnapshot(config) {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
payload = await getJsonAuth("/api/v1/me", config, { timeoutMs: 20000 });
|
|
655
|
-
}
|
|
729
|
+
const payload =
|
|
730
|
+
await tryGetJsonAuth("/api/v1/wallet/status", config, { timeoutMs: 10000 }) ||
|
|
731
|
+
await tryGetJsonAuth("/api/v1/me", config, { timeoutMs: 20000 }) ||
|
|
732
|
+
await getJsonAuth("/api/me", config, { timeoutMs: 20000 });
|
|
656
733
|
const user = payload?.user || {};
|
|
657
734
|
const balance = numericWalletValue(
|
|
658
735
|
payload?.tokenWalletBalancePreciseUsd ??
|
|
@@ -671,6 +748,10 @@ async function walletSnapshot(config) {
|
|
|
671
748
|
};
|
|
672
749
|
}
|
|
673
750
|
|
|
751
|
+
async function usageSnapshot(config) {
|
|
752
|
+
return await tryGetJsonAuth("/api/v1/billing/token-usage?limit=25&days=30", config, { timeoutMs: 20000 });
|
|
753
|
+
}
|
|
754
|
+
|
|
674
755
|
function numericWalletValue(value) {
|
|
675
756
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
676
757
|
return value;
|
|
@@ -690,9 +771,18 @@ function modelStatusName(model) {
|
|
|
690
771
|
if (model === "claude-opus-4-8") {
|
|
691
772
|
return "opus-4.8";
|
|
692
773
|
}
|
|
774
|
+
if (model === "claude-sonnet-4-6") {
|
|
775
|
+
return "sonnet-4.6";
|
|
776
|
+
}
|
|
777
|
+
if (model === "claude-fable-5") {
|
|
778
|
+
return "fable-5";
|
|
779
|
+
}
|
|
693
780
|
if (model === "deepseek-v4-pro") {
|
|
694
781
|
return "deepseek-v4 budget";
|
|
695
782
|
}
|
|
783
|
+
if (model === "gemini-3.5-flash") {
|
|
784
|
+
return "gemini flash 3.5";
|
|
785
|
+
}
|
|
696
786
|
return "gpt-5.5";
|
|
697
787
|
}
|
|
698
788
|
|
|
@@ -704,6 +794,15 @@ function normalizeConfig(config) {
|
|
|
704
794
|
if (normalized.model === "claude-opus-4-7") {
|
|
705
795
|
normalized.model = "claude-opus-4-8";
|
|
706
796
|
}
|
|
797
|
+
if (["claude-sonnet-4.6", "sonnet-4.6", "sonnet-4-6"].includes(normalized.model)) {
|
|
798
|
+
normalized.model = "claude-sonnet-4-6";
|
|
799
|
+
}
|
|
800
|
+
if (["claude-fabel-5", "fable-5", "fabel-5"].includes(normalized.model)) {
|
|
801
|
+
normalized.model = "claude-fable-5";
|
|
802
|
+
}
|
|
803
|
+
if (["gemini-flash-3.5", "gemini-flash-3-5", "google-gemini-flash-3.5"].includes(normalized.model)) {
|
|
804
|
+
normalized.model = "gemini-3.5-flash";
|
|
805
|
+
}
|
|
707
806
|
if (!MODELS[normalized.model]) {
|
|
708
807
|
normalized.model = "gpt-5.5";
|
|
709
808
|
}
|
|
@@ -714,7 +813,7 @@ function normalizeConfig(config) {
|
|
|
714
813
|
|
|
715
814
|
function providerBaseUrlForConfig(config) {
|
|
716
815
|
const normalized = normalizeConfig(config);
|
|
717
|
-
if (normalized.
|
|
816
|
+
if (isCodexApiOrigin(normalized.apiOrigin) && normalized.model.startsWith("claude-")) {
|
|
718
817
|
return CHICAGO_API_BASE_URL;
|
|
719
818
|
}
|
|
720
819
|
return `${normalized.apiOrigin || API_ORIGIN}/v1`;
|
|
@@ -722,12 +821,21 @@ function providerBaseUrlForConfig(config) {
|
|
|
722
821
|
|
|
723
822
|
function providerOriginLabel(config) {
|
|
724
823
|
const normalized = normalizeConfig(config);
|
|
725
|
-
if (normalized.
|
|
726
|
-
return
|
|
824
|
+
if (isCodexApiOrigin(normalized.apiOrigin) && normalized.model.startsWith("claude-")) {
|
|
825
|
+
return "CodexAPI.pro Claude-compatible Responses endpoint";
|
|
727
826
|
}
|
|
728
827
|
return normalized.apiOrigin || API_ORIGIN;
|
|
729
828
|
}
|
|
730
829
|
|
|
830
|
+
function isCodexApiOrigin(origin) {
|
|
831
|
+
try {
|
|
832
|
+
const host = new URL(origin || API_ORIGIN).hostname.toLowerCase();
|
|
833
|
+
return host === "codexapi.pro" || host.endsWith(".codexapi.pro") || host === "chatplus.chat" || host.endsWith(".chatplus.chat");
|
|
834
|
+
} catch {
|
|
835
|
+
return false;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
731
839
|
function formatUsd(value) {
|
|
732
840
|
return `$${Number(value || 0).toLocaleString("en-US", {
|
|
733
841
|
minimumFractionDigits: 2,
|
package/codexclaude.md
CHANGED
|
@@ -9,8 +9,8 @@ there is no supported configuration or API boundary that can solve the issue.
|
|
|
9
9
|
## Current Release
|
|
10
10
|
|
|
11
11
|
- Launcher package: `@codexapi/codexclaude`
|
|
12
|
-
- Launcher version: `2.0.
|
|
13
|
-
- Official Codex runtime dependency: `@openai/codex@0.
|
|
12
|
+
- Launcher version: `2.0.13`
|
|
13
|
+
- Official Codex runtime dependency: `@openai/codex@0.142.2`
|
|
14
14
|
- Public install command: `npm install -g @codexapi/codexclaude@latest`
|
|
15
15
|
- Default API origin: `https://codexapi.pro`
|
|
16
16
|
- Normal Responses base URL: `https://codexapi.pro/v1`
|
|
@@ -19,16 +19,21 @@ there is no supported configuration or API boundary that can solve the issue.
|
|
|
19
19
|
- Generated Codex config: `~/.codex/config.toml`
|
|
20
20
|
- Generated Codex model catalog: `~/.codexclaude/model_catalog.json`
|
|
21
21
|
|
|
22
|
+
State verified on 2026-06-25: the launcher pins official Codex CLI `0.142.2`. Backend routing is server-controlled by Admin Manage Models and must not collapse the launcher model list or rename customer-selected model ids.
|
|
23
|
+
|
|
22
24
|
## Required User-Facing Model Behavior
|
|
23
25
|
|
|
24
|
-
`codexclaude` supports exactly
|
|
26
|
+
`codexclaude` supports exactly six visible model choices:
|
|
25
27
|
|
|
26
28
|
- `gpt-5.5` displayed as `ChatGPT-5.5`
|
|
27
29
|
- `claude-opus-4-8` displayed as `Opus 4.8`
|
|
30
|
+
- `claude-sonnet-4-6` displayed as `Sonnet 4.6`
|
|
31
|
+
- `claude-fable-5` displayed as `Fable 5`
|
|
28
32
|
- `deepseek-v4-pro` displayed as `Deepseek v4 Budget`
|
|
33
|
+
- `gemini-3.5-flash` displayed as `Google Gemini Flash 3.5`
|
|
29
34
|
|
|
30
|
-
The launcher command `codexclaude model` must list only those
|
|
31
|
-
The native Codex `/model` picker must also list only those
|
|
35
|
+
The launcher command `codexclaude model` must list only those six options.
|
|
36
|
+
The native Codex `/model` picker must also list only those six options. This
|
|
32
37
|
is enforced by writing `model_catalog_json` in `~/.codex/config.toml` and
|
|
33
38
|
creating a complete Codex-compatible catalog at
|
|
34
39
|
`~/.codexclaude/model_catalog.json`.
|
|
@@ -53,7 +58,7 @@ because the request body model is how CodexAPI.pro snapshots routing and
|
|
|
53
58
|
billing before generation starts. The correct fix is to provide valid metadata
|
|
54
59
|
for `claude-opus-4-8`.
|
|
55
60
|
|
|
56
|
-
`bin/codexclaude.js` writes a local catalog with full metadata for all
|
|
61
|
+
`bin/codexclaude.js` writes a local catalog with full metadata for all six
|
|
57
62
|
supported slugs. Each entry must include, at minimum:
|
|
58
63
|
|
|
59
64
|
- `slug`
|
|
@@ -72,7 +77,7 @@ supported slugs. Each entry must include, at minimum:
|
|
|
72
77
|
- `input_modalities`
|
|
73
78
|
- `additional_speed_tiers`
|
|
74
79
|
|
|
75
|
-
Keep `visibility = "list"` for the
|
|
80
|
+
Keep `visibility = "list"` for the six supported entries. Do not include any
|
|
76
81
|
other list-visible models in this catalog.
|
|
77
82
|
|
|
78
83
|
## Reasoning Display Versus Server Runtime
|
|
@@ -84,19 +89,18 @@ The user-facing Codex UI must show `xhigh` reasoning. The generated
|
|
|
84
89
|
model_reasoning_effort = "xhigh"
|
|
85
90
|
```
|
|
86
91
|
|
|
87
|
-
The API server must continue to enforce
|
|
92
|
+
The API server must continue to enforce the Admin-selected server reasoning before upstream runtime.
|
|
88
93
|
This is handled in the CodexAPI.pro backend by normalizing Responses requests
|
|
89
|
-
to `settings.agent_default_effort`, currently `
|
|
94
|
+
to `settings.agent_default_effort`, currently `high`. Do not change the server
|
|
90
95
|
setting just because the launcher displays `xhigh`.
|
|
91
96
|
|
|
92
97
|
The launcher keeps both concepts explicit:
|
|
93
98
|
|
|
94
99
|
- `DISPLAY_REASONING_EFFORT = "xhigh"`
|
|
95
|
-
- `SERVER_REASONING_EFFORT = "
|
|
100
|
+
- `SERVER_REASONING_EFFORT = "high"`
|
|
96
101
|
|
|
97
102
|
The status output should show `xhigh`. The server effort line in
|
|
98
|
-
`codexclaude status` may show
|
|
99
|
-
must not say `low`.
|
|
103
|
+
`codexclaude status` may show the configured server effort for transparency, but normal launch status must not imply the user-visible model is downgraded.
|
|
100
104
|
|
|
101
105
|
## Fast Mode Behavior
|
|
102
106
|
|
|
@@ -138,7 +142,7 @@ terminal_title = ["project-name", "model-with-reasoning", "run-state"]
|
|
|
138
142
|
```
|
|
139
143
|
|
|
140
144
|
The selected model must remain the user's chosen slug. Do not force the local
|
|
141
|
-
config model to `gpt-5.5` when Opus
|
|
145
|
+
config model to `gpt-5.5` when Opus, Sonnet, Fable, Deepseek, or Gemini is selected. The backend can
|
|
142
146
|
route any selected model through GPT-5.5 or another upstream internally, but the
|
|
143
147
|
client request must preserve the user-facing selected slug for display,
|
|
144
148
|
snapshotting, and billing records.
|
|
@@ -147,14 +151,18 @@ snapshotting, and billing records.
|
|
|
147
151
|
|
|
148
152
|
`gpt-5.5` uses the configured API origin, normally `https://codexapi.pro/v1`.
|
|
149
153
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
Claude-family codexclaude models use the CodexAPI.pro Claude-compatible Responses endpoint for CodexAPI.pro and ChatPlus accounts. MyAPI.world accounts keep their own configured `api.myapi.world` Responses endpoint.
|
|
155
|
+
|
|
156
|
+
`claude-fable-5` is a premium customer-visible model. The backend bills it at the configured 5x multiplier and routes it through the Admin-selected Fable 5 route while preserving `claude-fable-5` in client-visible status and usage records.
|
|
153
157
|
|
|
154
158
|
`deepseek-v4-pro` uses the configured API origin. The backend currently routes
|
|
155
159
|
this through the CodexAPI.pro-compatible path according to the active server
|
|
156
160
|
policy.
|
|
157
161
|
|
|
162
|
+
`gemini-3.5-flash` uses the configured API origin. The backend must keep
|
|
163
|
+
`gemini-3.5-flash` visible to the user and usage records while routing the
|
|
164
|
+
request internally through `claude-sonnet-4-6` at the configured server effort.
|
|
165
|
+
|
|
158
166
|
The launcher must send these headers for every model:
|
|
159
167
|
|
|
160
168
|
- `X-CodexAPI-Client: codexclaude`
|
|
@@ -196,7 +204,7 @@ If that endpoint fails, fall back to:
|
|
|
196
204
|
/api/v1/me
|
|
197
205
|
```
|
|
198
206
|
|
|
199
|
-
Wallet lookup failures must not block a local coding session.
|
|
207
|
+
`codexclaude usage` reads `/api/v1/billing/token-usage` from the same configured account origin. Wallet and usage lookup failures must not block a local coding session.
|
|
200
208
|
|
|
201
209
|
## Upgrade Checklist
|
|
202
210
|
|
|
@@ -205,14 +213,14 @@ When upgrading official `@openai/codex`:
|
|
|
205
213
|
1. Update `CODEX_VERSION` in `bin/codexclaude.js`.
|
|
206
214
|
2. Update `package.json` and `package-lock.json` to the same official Codex version.
|
|
207
215
|
3. Keep the launcher package version higher than the last published version.
|
|
208
|
-
4. Preserve the
|
|
209
|
-
5. Preserve `DISPLAY_REASONING_EFFORT = "xhigh"` and `SERVER_REASONING_EFFORT
|
|
216
|
+
4. Preserve the six-model `MODELS` map and aliases.
|
|
217
|
+
5. Preserve `DISPLAY_REASONING_EFFORT = "xhigh"` and keep `SERVER_REASONING_EFFORT` aligned with the server default.
|
|
210
218
|
6. Preserve `writeModelCatalog()` and the `model_catalog_json` line in generated config.
|
|
211
219
|
7. Preserve Full Access defaults: `approval_policy = "never"` and `sandbox_mode = "danger-full-access"`.
|
|
212
220
|
8. Preserve `wire_api = "responses"` and `supports_websockets = false`.
|
|
213
221
|
9. Preserve bearer username auth with the CodexAPI.pro API username.
|
|
214
222
|
10. Preserve the `X-CodexAPI-*` headers.
|
|
215
|
-
11. Preserve
|
|
223
|
+
11. Preserve Claude-family endpoint routing unless operations changes it.
|
|
216
224
|
12. Preserve update enforcement through `/api/v1/codexclaude/version` and npm latest metadata.
|
|
217
225
|
13. Update this file with a new release section explaining what changed.
|
|
218
226
|
14. Run the validation commands below before publishing.
|
|
@@ -225,7 +233,7 @@ Run syntax validation:
|
|
|
225
233
|
node --check bin/codexclaude.js
|
|
226
234
|
```
|
|
227
235
|
|
|
228
|
-
Create a temporary home, write config, and verify Codex can parse the
|
|
236
|
+
Create a temporary home, write config, and verify Codex can parse the four
|
|
229
237
|
model catalog entries without making a model call:
|
|
230
238
|
|
|
231
239
|
```bash
|
|
@@ -244,6 +252,7 @@ The JSON output must contain exactly:
|
|
|
244
252
|
- `gpt-5.5`
|
|
245
253
|
- `claude-opus-4-8`
|
|
246
254
|
- `deepseek-v4-pro`
|
|
255
|
+
- `gemini-3.5-flash`
|
|
247
256
|
|
|
248
257
|
The Opus entry must have `default_reasoning_level = "xhigh"` and must not use
|
|
249
258
|
fallback metadata.
|
|
@@ -262,6 +271,21 @@ python3 -m py_compile app/main.py app/openai_compat.py app/config.py app/postgre
|
|
|
262
271
|
/root/codexapi/.venv/bin/pytest -q tests/test_openai_compat.py tests/test_main_helpers.py
|
|
263
272
|
```
|
|
264
273
|
|
|
274
|
+
## Version 2.0.13 Changes
|
|
275
|
+
|
|
276
|
+
- Updated the official OpenAI Codex runtime dependency to `@openai/codex@0.142.2`.
|
|
277
|
+
- Added Sonnet 4.6 and Fable 5 as visible launcher and native Codex `/model` choices.
|
|
278
|
+
- Added `codexclaude usage`, which reads wallet and recent token usage from the signed-in account origin, including CodexAPI.pro, ChatPlus, or MyAPI.world compatible endpoints.
|
|
279
|
+
- Kept Fable 5 customer-visible while the backend applies its custom routed premium path and 5x billing multiplier.
|
|
280
|
+
- Preserved Full Access defaults, xhigh visible reasoning, server-managed high runtime effort, wallet auth, and local model catalog metadata.
|
|
281
|
+
|
|
282
|
+
## Version 2.0.12 Changes
|
|
283
|
+
|
|
284
|
+
- Updated the official OpenAI Codex runtime dependency to `@openai/codex@0.141.0`.
|
|
285
|
+
- Added Google Gemini Flash 3.5 as a fourth visible launcher and native Codex `/model` choice.
|
|
286
|
+
- Kept Gemini visible in client config, response metadata, and usage records while the backend routes it through Sonnet 4.6 low effort.
|
|
287
|
+
- Preserved the CodexAPI.pro launcher layer, Full Access defaults, xhigh visible reasoning, server-managed low runtime effort, wallet auth, and Opus 4.8 Chicago routing.
|
|
288
|
+
|
|
265
289
|
## Version 2.0.11 Changes
|
|
266
290
|
|
|
267
291
|
- Updated the official OpenAI Codex runtime dependency to `@openai/codex@0.140.0`.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codexapi/codexclaude",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "CodexAPI.pro coding CLI launcher for ChatGPT-5.5, Opus 4.8,
|
|
3
|
+
"version": "2.0.13",
|
|
4
|
+
"description": "CodexAPI.pro coding CLI launcher for ChatGPT-5.5, Opus 4.8, Sonnet 4.6, Fable 5, Deepseek v4 Budget, and Google Gemini Flash 3.5, powered by official Codex CLI 0.142.2.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"node": ">=20"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@openai/codex": "0.
|
|
20
|
+
"@openai/codex": "^0.142.2"
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
"claude",
|
|
28
28
|
"opus",
|
|
29
29
|
"deepseek",
|
|
30
|
+
"gemini",
|
|
31
|
+
"flash",
|
|
30
32
|
"budget",
|
|
31
33
|
"codexapi",
|
|
32
34
|
"coding-cli"
|