Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

feat(quota-share): beta banner, Responses + codex-WS endpoints in card, plan presets

diegosouzapw831f82858fb2
diff --git a/docs/reference/API_REFERENCE.md b/docs/reference/API_REFERENCE.md
index 34803a7fe5..b208f73741 100644
--- a/docs/reference/API_REFERENCE.md
+++ b/docs/reference/API_REFERENCE.md
@@ -243,6 +243,29 @@ Validates a WebSocket upgrade handshake and returns the wire protocol example me
**Auth:** Bearer API key during handshake.
+### Responses API over WebSocket (codex only)
+
+```bash
+# Same host:port as the HTTP API (default 20128); upgrade the connection:
+wscat -c "ws://localhost:20128/v1/responses?api_key=<OMNIROUTE_API_KEY>"
+# (or: -H "Authorization: Bearer <OMNIROUTE_API_KEY>")
+
+# First frame MUST be response.create:
+{ "type": "response.create", "model": "gpt-5.5", "input": [ { "role": "user", "content": "hi" } ] }
+```
+
+A Responses-API-over-WebSocket proxy is wired **exclusively to `codex`** (ChatGPT
+backend). It listens on the same port as the API/dashboard at paths `/v1/responses`,
+`/responses`, and `/api/v1/responses`. On the first `response.create` frame it
+authenticates + prepares via the internal `codex-responses-ws` bridge, selects a
+codex OAuth connection, and tunnels to `wss://chatgpt.com/backend-api/codex/responses`
+via the `wreq-js` transport. **Non-codex models are rejected** (`codex_ws_provider_required`).
+For quota-share routing use `model: "qtSd/<group>/codex/<model>"`. Implemented in
+`app/server-ws.mjs` + `scripts/dev/responses-ws-proxy.mjs` + `src/app/api/internal/codex-responses-ws/route.ts`.
+
+**Auth:** Bearer API key during handshake. The bundled HTTP server (`server-ws.mjs`)
+must be the active entrypoint (it is, by default, when `app/server-ws.mjs` exists).
+
---
## Quotas & Issues Reporting
diff --git a/src/app/(dashboard)/dashboard/costs/quota-share/QuotaSharePageClient.tsx b/src/app/(dashboard)/dashboard/costs/quota-share/QuotaSharePageClient.tsx
index 4cfeb52d66..dfa3ea7a7c 100644
--- a/src/app/(dashboard)/dashboard/costs/quota-share/QuotaSharePageClient.tsx
+++ b/src/app/(dashboard)/dashboard/costs/quota-share/QuotaSharePageClient.tsx
@@ -396,6 +396,23 @@ export default function QuotaSharePageClient() {
</div>
</div>
+ {/* Beta banner — scoped to this page only */}
+ <div className="flex items-center gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-[12px] text-amber-700 dark:text-amber-200">
+ <span className="material-symbols-outlined text-[16px] text-amber-500 shrink-0">science</span>
+ <span className="flex-1">
+ <span className="font-semibold">{t("betaTitle")}</span> — {t("betaText")}
+ </span>
+ <a
+ href="https://github.com/diegosouzapw/OmniRoute/issues/new?labels=quota-share,beta&title=%5Bquota-share%5D%20"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="shrink-0 inline-flex items-center gap-1 font-medium text-amber-600 dark:text-amber-300 hover:underline"
+ >
+ <span className="material-symbols-outlined text-[14px]">bug_report</span>
+ {t("betaReportLink")}
+ </a>
+ </div>
+
{/* Group bar */}
<div className="flex items-center gap-2 flex-wrap rounded-lg border border-border/40 bg-bg-subtle/20 px-3 py-2">
<span className="text-[11px] uppercase tracking-wide text-text-muted font-semibold shrink-0">
diff --git a/src/app/(dashboard)/dashboard/costs/quota-share/components/QuotaEndpointsCard.tsx b/src/app/(dashboard)/dashboard/costs/quota-share/components/QuotaEndpointsCard.tsx
index 15fec0d288..6ad80d5e70 100644
--- a/src/app/(dashboard)/dashboard/costs/quota-share/components/QuotaEndpointsCard.tsx
+++ b/src/app/(dashboard)/dashboard/costs/quota-share/components/QuotaEndpointsCard.tsx
@@ -135,6 +135,36 @@ export default function QuotaEndpointsCard({
return [...provs].some(isAnthropicProvider);
}, [pools, connections]);
+ // Responses-API providers (codex / github gpt-5.x / openai-compatible *responses*)
+ // are callable on POST /v1/responses (codex is also reachable over the WS proxy
+ // at the same path). conn.provider holds canonical slugs ("codex"/"github").
+ const isResponsesProvider = (provider: string) =>
+ provider === "codex" || provider === "github" || provider.includes("responses");
+
+ const hasResponses = useMemo(() => {
+ const provs = new Set<string>();
+ for (const pool of pools) {
+ for (const cid of pool.connectionIds ?? [pool.connectionId]) {
+ const conn = connections.find((c) => c.id === cid);
+ if (conn) provs.add(conn.provider);
+ }
+ }
+ return [...provs].some(isResponsesProvider);
+ }, [pools, connections]);
+
+ // The Responses-over-WebSocket proxy is wired EXCLUSIVELY to codex, so the WS
+ // endpoint line only shows when a codex connection is in scope.
+ const hasCodex = useMemo(() => {
+ const provs = new Set<string>();
+ for (const pool of pools) {
+ for (const cid of pool.connectionIds ?? [pool.connectionId]) {
+ const conn = connections.find((c) => c.id === cid);
+ if (conn) provs.add(conn.provider);
+ }
+ }
+ return provs.has("codex");
+ }, [pools, connections]);
+
// ── Derive default model list from groups + pools + connections ──────────────
// For each group, collect all pools that belong to it, then for each pool's
// providers (from connectionIds), generate qtSd/<groupSlug>/<provider>/<model>
@@ -323,6 +353,32 @@ export default function QuotaEndpointsCard({
<span className="text-[10px] text-text-muted">({t("endpointsAnthropicNote")})</span>
</div>
)}
+ {hasResponses && (
+ <div className="flex items-center gap-2 flex-wrap">
+ <span className="text-[10px] uppercase tracking-wide text-text-muted font-semibold shrink-0">
+ {t("endpointsBaseUrl")}
+ </span>
+ <code className="text-xs text-primary font-mono">POST /v1/responses</code>
+ <span className="text-xs text-text-muted mx-1">·</span>
+ <code className="text-xs text-text-muted font-mono">
+ model: &quot;qtSd/&lt;group&gt;/&lt;provider&gt;/&lt;model&gt;&quot;
+ </code>
+ <span className="text-[10px] text-text-muted">({t("endpointsResponsesNote")})</span>
+ </div>
+ )}
+ {hasCodex && (
+ <div className="flex items-center gap-2 flex-wrap">
+ <span className="text-[10px] uppercase tracking-wide text-text-muted font-semibold shrink-0">
+ {t("endpointsBaseUrl")}
+ </span>
+ <code className="text-xs text-primary font-mono">WS /v1/responses</code>
+ <span className="text-xs text-text-muted mx-1">·</span>
+ <code className="text-xs text-text-muted font-mono">
+ model: &quot;qtSd/&lt;group&gt;/codex/&lt;model&gt;&quot;
+ </code>
+ <span className="text-[10px] text-text-muted">({t("endpointsWsNote")})</span>
+ </div>
+ )}
</div>
{/* Model listing */}
diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json
index 85836dedee..46314b5e7d 100644
--- a/src/i18n/messages/en.json
+++ b/src/i18n/messages/en.json
@@ -7938,6 +7938,11 @@
"endpointsCollapse": "Collapse",
"endpointsExpand": "Expand",
"endpointsAnthropicNote": "Anthropic-native",
+ "endpointsResponsesNote": "OpenAI Responses — codex/github",
+ "endpointsWsNote": "WebSocket — codex only",
+ "betaTitle": "Beta",
+ "betaText": "Quota Share is functional but bugs are expected. Found one? Please report it.",
+ "betaReportLink": "Report an issue",
"deleteGroup": "Delete group",
"deleteGroupConfirm": "Delete this group? Its pools must be reassigned or removed first.",
"deleteGroupHasPools": "This group still has pools — reassign or delete them first.",
diff --git a/src/i18n/messages/pt-BR.json b/src/i18n/messages/pt-BR.json
index 843146b9dc..dbf4e3d763 100644
--- a/src/i18n/messages/pt-BR.json
+++ b/src/i18n/messages/pt-BR.json
@@ -5427,6 +5427,11 @@
"endpointsCollapse": "Recolher",
"endpointsExpand": "Expandir",
"endpointsAnthropicNote": "nativo Anthropic",
+ "endpointsResponsesNote": "OpenAI Responses — codex/github",
+ "endpointsWsNote": "WebSocket — somente codex",
+ "betaTitle": "Beta",
+ "betaText": "O Quota Share está funcional, mas bugs são esperados. Encontrou um? Reporte, por favor.",
+ "betaReportLink": "Abrir uma issue",
"deleteGroup": "Excluir grupo",
"deleteGroupConfirm": "Excluir este grupo? Os pools dele precisam ser reatribuídos ou removidos antes.",
"deleteGroupHasPools": "Este grupo ainda tem pools — reatribua ou exclua-os primeiro.",
diff --git a/src/lib/quota/planRegistry.ts b/src/lib/quota/planRegistry.ts
index 09e4084dfe..0c2545ff21 100644
--- a/src/lib/quota/planRegistry.ts
+++ b/src/lib/quota/planRegistry.ts
@@ -41,6 +41,26 @@ const KNOWN_PLANS: Record<string, KnownPlanShape> = {
provider: "kimi",
dimensions: [{ unit: "requests", window: "hourly", limit: 1500 }],
},
+ // Kimi "coding" plan connections register under the `kimi-coding` slug, which
+ // exposes no upstream balance API. EPSILON = "unknown, set the real plan limit
+ // manually in the Wizard 'Limite' step" (same convention as glm/minimax).
+ "kimi-coding": {
+ provider: "kimi-coding",
+ dimensions: [
+ { unit: "tokens", window: "5h", limit: Number.EPSILON },
+ { unit: "tokens", window: "weekly", limit: Number.EPSILON },
+ ],
+ },
+ // Xiaomi MiMo exposes no upstream balance API. Default seeds the "lite" plan's
+ // 4.1B-token weekly cap so the Wizard pre-fills a usable fair-share limit;
+ // adjust in the "Limite" step to match the connection's actual plan.
+ "xiaomi-mimo": {
+ provider: "xiaomi-mimo",
+ dimensions: [
+ { unit: "tokens", window: "5h", limit: Number.EPSILON },
+ { unit: "tokens", window: "weekly", limit: 4_100_000_000 },
+ ],
+ },
alibaba: {
provider: "alibaba",
dimensions: [{ unit: "requests", window: "monthly", limit: 90_000 }],
diff --git a/tests/unit/quota-share-bugfixes-v388.test.ts b/tests/unit/quota-share-bugfixes-v388.test.ts
index 56783e9246..5374defad5 100644
--- a/tests/unit/quota-share-bugfixes-v388.test.ts
+++ b/tests/unit/quota-share-bugfixes-v388.test.ts
@@ -159,6 +159,31 @@ test("B5: endpoints default view uses real minted qtSd combos (not placeholders)
);
});
+// ── Responses API endpoint in the card ──────────────────────────────────────
+
+test("endpoints card surfaces POST /v1/responses for codex/github providers", () => {
+ assert.ok(endpointsSrc.includes("const hasResponses"), "must detect Responses providers in scope");
+ assert.ok(endpointsSrc.includes("POST /v1/responses"), "must show the Responses endpoint");
+ assert.ok(
+ /isResponsesProvider[\s\S]*?"codex"[\s\S]*?"github"/.test(endpointsSrc),
+ "Responses detection must cover canonical codex + github slugs"
+ );
+});
+
+// ── planRegistry defaults for no-balance-API providers ───────────────────────
+
+test("planRegistry seeds xiaomi-mimo (4.1B lite cap) and kimi-coding for manual fair-share", async () => {
+ const { getKnownPlan } = await import("../../src/lib/quota/planRegistry.ts");
+ const xiaomi = getKnownPlan("xiaomi-mimo");
+ assert.ok(xiaomi, "xiaomi-mimo must have a known plan so the wizard pre-fills");
+ assert.ok(
+ xiaomi!.dimensions.some((d) => d.unit === "tokens" && d.window === "weekly" && d.limit === 4_100_000_000),
+ "xiaomi-mimo must seed the 4.1B-token weekly lite cap"
+ );
+ const kimiCoding = getKnownPlan("kimi-coding");
+ assert.ok(kimiCoding, "kimi-coding (the coding-plan slug) must have a known plan entry");
+});
+
// ── i18n parity for every new key ────────────────────────────────────────────
test("i18n: new quotaShare keys exist in both en and pt-BR", () => {
@@ -171,6 +196,7 @@ test("i18n: new quotaShare keys exist in both en and pt-BR", () => {
"endpointsCollapse",
"endpointsExpand",
"endpointsAnthropicNote",
+ "endpointsResponsesNote",
];
for (const k of keys) {
assert.ok(en.quotaShare[k], `en.json quotaShare.${k} must exist`);