{"service":"openai-proxy","description":"OpenAI-compatible API proxy — auto→commandcode, else 50/50 balanced pools, sticky per user, auto fallback","auto":{"provider":"commandcode","base_url":"https://api.commandcode.ai/provider/v1","model":"poolside/laguna-s-2.1-free","note":"model=auto (或未传 model) 统一走该上游；失败时回退到下方池子"},"pools":{"bailian":{"weight":"BAILIAN_WEIGHT% of users (default 50)","providers":["bailian/deepseek-v4-flash-0731 (阿里云百炼 compatible-mode)"]},"nvidia":{"weight":"remaining users","providers":["nvidia/minimaxai/minimax-m3","nvidia/openai/gpt-oss-120b"]}},"stickiness":"same user (Bearer key SHA-256 or client IP) always hits the same pool; a failed pool cools down for 60s and the other pool is tried","fallback":"auto: commandcode → bailian/nvidia pools; within pool: next provider in order; across pools: other pool after all its providers fail","rate_limiting":{"per_minute":"20 (RATE_LIMIT_PER_MINUTE) — queue until next minute window, never errors","daily_requests":"440 (DAILY_REQUESTS) — returns 429 when exceeded","daily_tokens":"0 (DAILY_TOKENS) — disabled by default","identity":"Bearer API key (SHA-256) or client IP"},"endpoints":{"POST /v1/chat/completions":"Chat completions (streaming + reasoning + tool_calls, rate-limited)","GET /v1/models":"List available models","GET /v1/admin/usage":"Daily usage per user (requires ADMIN_KEY)"},"env_optional":["COMMANDCODE_API_KEY","DASHSCOPE_API_KEY","NVIDIA_API_KEY","BAILIAN_WEIGHT (0-100)","RATE_LIMIT_PER_MINUTE","DAILY_REQUESTS","DAILY_TOKENS","ADMIN_KEY"],"bindings":{"QUOTA":"KV namespace, optional — required only for daily quota"},"note":"auto 统一走 commandcode (poolside/laguna-s-2.1-free)；其余模型走 50/50 sticky 池子并支持跨池回退。"}