Add subscription/usage-aware providers: OpenCode Go, MiniMax M3, GLM-5.2 (API cost + limit tracking) #4136
myagizmaktav
started this conversation in
Ideas
Replies: 1 comment
|
It would be great to have at least a basic OpenCode Go integration for quota tracking. Even if full provider support isn’t implemented yet, simply showing the current 5-hour, weekly, and monthly usage/remaining quota in the Management Center would already be very useful. The main benefit would be having OpenCode Go usage visible alongside Claude, Codex, Kimi, etc., without needing to check a separate dashboard. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Add three subscription / pay-as-you-go provider integrations that the proxy currently routes only through generic
openai-compatibilityblocks (PR #3990 already mentionsminimax-m3,kimi-k2.7-code,glm-5.2passing through):For each: API-key auth flow, model alias, pricing/limit metadata, and rate-limit/quota telemetry exposed through the Management API.
Research: API cost, limits, and example calls
1. OpenCode Go
https://opencode.ai/zen/go/v1/chat/completions— OpenAI-compatible (GLM, Kimi, DeepSeek, MiMo)https://opencode.ai/zen/go/v1/messages— Anthropic-compatible (MiniMax, Qwen)https://opencode.ai/zen/go/v1/models— model listglm-5.2,glm-5.1,kimi-k2.7,kimi-k2.6,deepseek-v4-pro,deepseek-v4-flash,mimo-v2.5,mimo-v2.5-prominimax-m3,minimax-m2.7,minimax-m2.5,qwen3.7-max,qwen3.7-plus,qwen3.6-plusopencode-go/<model-id>.Example (OpenAI-compat path):
Example (Anthropic-compat path):
2. MiniMax M3
https://api.minimax.io/v1/text/chatcompletion_v2https://api.minimax.io/v1/modelsminimax/minimax-m3(also served by Parasail MXFP8, Together AI, Novita, SiliconFlow, MiniMax, Makora MXFP8, GMI).Priority tier (
service_tier: "priority", 1.5×): $0.45/$1.80, $0.90/$3.60.GET https://api.minimax.io/v1/dashboard/billing/credit_grantswith the same API key returnsgrants[].remaining,expires_at.Example call:
3. GLM-5.2 (Z.ai / Zhipu AI)
https://api.z.ai/api/paas/v4/chat/completionshttps://open.bigmodel.cn/api/paas/v4/chat/completions/zai-auth-url,/bigmodel-auth-url).Example call:
How to read remaining limits in general
X-RateLimit-*/x-ratelimit-*response headers./v0/management/quota.quota-exceeded.on-payment-required: "disable"(PR feat: add on-payment-required option to auto-disable key on 402 #3978).Proposal
A. Backend —
router-for-me/CLIProxyAPIinternal/runtime/executor/opencode_go/using bothopenai-compatandanthropic-compatpaths.https://opencode.ai/zen/go, models auto-fetched from/v1/modelson start.https://api.minimax.io/v1; first-class aliasesMiniMax-M3,MiniMax-M2.7,MiniMax-M2.5. Optional OpenRouter passthrough config (base_url=https://openrouter.ai/api/v1, headerHTTP-Referer/X-Title).GLM-5.2andGLM-5.2[1m]for 1M context.https://api.z.ai/api/paas/v4; thinking-effort selector (high/max); peak-hour quota multiplier surfaced.service_tier,quota_window(5h/weekly), token totals, and cache hit/miss split.GET /v0/management/usage/limitsreturning per-provider{limit, used, window, reset_at}so CPAMC can render bars (companion to issue 偶尔会弹出无效API key提示,“400 API key not valid. Please pass a valid API key.” #2 of this report).B. UI —
router-for-me/Cli-Proxy-API-Management-Center/v1/modelson the upstream.C. Pricing data
Add a
models-pricing.json(or extend the existing example) with the three model families so CPA-Manager-Plus LiteLLM / OpenRouter sync matches without manual edits.Acceptance criteria
GET /v1/modelssurfacesopencode-go/*,minimax/*,glm-5.2,glm-5.2-1m.curl http://localhost:8317/v1/chat/completions./v0/management/usage/limitsreports at least the OAuth-backed quota providers.All reactions