From 6ed031c632b4c7a4c83cf682639225383057a653 Mon Sep 17 00:00:00 2001 From: octo-patch <266937838+octo-patch@users.noreply.github.com> Date: Fri, 31 Jul 2026 20:28:13 +0800 Subject: [PATCH] Add MiniMax provider bridge backend --- docs/reference/commands.md | 27 +++- docs/reference/public-api.md | 8 +- index.ts | 3 + lib/index.ts | 1 + lib/local-bridge.ts | 252 ++++++++++++++++++++++++---------- lib/providers/minimax.ts | 103 ++++++++++++++ lib/usage/ledger.ts | 1 + lib/usage/redaction.ts | 2 +- lib/usage/types.ts | 2 +- test/local-bridge.test.ts | 142 +++++++++++++++++++ test/minimax-provider.test.ts | 69 ++++++++++ 11 files changed, 528 insertions(+), 82 deletions(-) create mode 100644 lib/providers/minimax.ts create mode 100644 test/minimax-provider.test.ts diff --git a/docs/reference/commands.md b/docs/reference/commands.md index 6f471542a..86dd2e7cd 100644 --- a/docs/reference/commands.md +++ b/docs/reference/commands.md @@ -367,11 +367,11 @@ reports neutral account labels and does not expose raw account emails. ## Local bridge commands -The optional local bridge exposes only `/health`, `/v1/models`, and -`/v1/responses` on loopback. Forwarded bridge requests require a bearer token -by default. When a runtime client API key is configured for the bridge, inbound -auth must remain enabled (`requireAuth=true`); the bridge rewrites outbound -auth for the rotation proxy and strips inbound cookies / proxy-auth headers. +The optional local bridge exposes `/health`, `/v1/models`, and `/v1/responses` +on loopback. A MiniMax backend also exposes `/anthropic/v1/messages` and +`/anthropic/v1/messages/count_tokens`. Forwarded bridge requests require a +local client token by default. Clients can send it as a bearer token or +`x-api-key`; the bridge replaces inbound credentials before forwarding. ```bash codex-multi-auth bridge token create [--label