Fim98/CLIProxyAPI

Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Davin as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini Series, GPT Series, Grok Series, Claude model through API

★ 0Forks 0GoGitHub ↗Compare

README

CLI Proxy API

English | 中文 | 日本語

If you want to use CLIProxyAPI on your desktop, we recommend our EasyCLIProxyAPI desktop client. It provides a graphical configuration UI, automatic updates, system tray integration, and one-click start/stop for the CLIProxyAPI service.

CLIProxyAPI is a proxy server that provides OpenAI/Gemini/Claude/Codex/Grok compatible API interfaces for CLI.

You can access the following providers locally and with multiple CLI accounts through any OpenAI (including Responses), Gemini (including Interactions), or Claude-compatible client or SDK.

Provider Description
Kimi Kimi series models (Kimi K3, Kimi K2.7 Code, etc.). Kimi K3 is Moonshot AI’s most capable model and the world’s first open 3T-class model. With 2.8 trillion parameters, native vision, and a 1-million-token context window, K3 is built for long-horizon coding, knowledge work, and reasoning. CLIProxyAPI supports Kimi through OAuth or compatible API interfaces. Try a Kimi Code plan (中文站 | Global), or get an API key from the Kimi Open Platform (中文站 | Global). Thanks to Kimi for supporting CLIProxyAPI and the open-source community!
OpenAI OpenAI GPT series models (GPT 5.6, GPT 5.5, etc.). GPT-5.6 sets a new quality and efficiency baseline for complex production workflows. GPT-5.6 is especially token-efficient and improves frontend aesthetics, including layout, visual hierarchy, and design judgment.
Anthropic Anthropic Claude series models (Claude Fable, Claude Opus, Claude Sonnet, etc.). Claude Fable 5 is Anthropic's most capable widely released model, built for the most demanding reasoning and long-horizon agentic work.
Antigravity Google Gemini series models (Gemini 3.5 Flash, Gemini 3.1 Pro, etc.). Gemini 3.5 Flash provides sustained frontier-level intelligence optimized for real-world tasks at a higher speed and lower cost. Designed for the agentic era, it excels at sub-agent deployment, multi-step workflows, and long-horizon tasks at scale. This model is particularly effective for rapid agentic loops involving complex coding cycles and iterations.
xAI xAI Grok series models (Grok 4.5, Grok Composer 2.5 Fast, etc.). Grok 4.5 is SpaceXAI's frontier model built for coding, agentic tasks, and knowledge work. It was trained in SpaceXAI's data centers in Memphis with new datasets spanning science, engineering, and math.

Sponsor

https://www.packyapi.com/register?aff=cliproxyapi

Thanks to PackyCode for sponsoring this project!

PackyCode is a reliable and efficient API relay service provider, offering relay services for Claude Code, Codex, Gemini, and more.

PackyCode provides special discounts for our software users: register using this link and enter the "cliproxyapi" promo code during recharge to get 10% off.


AICodeMirror Thanks to AICodeMirror for sponsoring this project! AICodeMirror provides official high-stability relay services for Claude Code / Codex / Gemini, with enterprise-grade concurrency, fast invoicing, and 24/7 dedicated technical support. Claude Code / Codex / Gemini official channels at 38% / 2% / 9% of original price, with extra discounts on top-ups! AICodeMirror offers special benefits for CLIProxyAPI users: register via this link to enjoy 20% off your first top-up, and enterprise customers can get up to 25% off!
APIKEY.FUN Thanks to APIKEY.FUN for sponsoring this project! APIKEY.FUN is a professional enterprise-grade AI relay platform dedicated to providing stable, efficient, and low-cost AI model API access for enterprises and individual developers. The platform supports popular mainstream models such as Claude, OpenAI, and Gemini, with prices as low as 7% of the official price. Register through this project's exclusive link to enjoy a special permanent 5% top-up discount.
CyberPay CyberPay was founded in 2021. We are committed to providing stable, efficient, and secure payment settlement solutions for AI industry merchants. Working with us helps your website platform solve Alipay and WeChat payment collection needs. We support business cooperation for selling GPT, Gemini, Claude, and Codex accounts, relay platforms, and other related services, helping merchants address payment collection challenges. Contact us to start your path to growth.
FennoAI FennoAI is a stable and efficient API relay service provider, currently focused on Codex relay services. It is compatible with OpenAI and Anthropic protocols and can flexibly integrate with mainstream coding tools such as Codex, Claude Code, and OpenCode. It can reliably support enterprise-grade demand of hundreds of billions of tokens per day, with B2B settlement and invoicing available for both domestic and overseas entities. FennoAI offers an exclusive benefit for CLIProxyAPI users: purchase a subscription through the exclusive link and receive $50 worth of Coding Plan credits for just $1.99. Referral rewards are also available: earn up to 20% commission when invited friends make a purchase. The more friends you invite, the greater the rewards.
Qiniu Cloud AI Thanks to Qiniu Cloud AI for sponsoring this project! Qiniu Cloud AI is an enterprise-grade large-model MaaS platform under Qiniu Cloud (02567.HK). It provides one-stop access to 150+ mainstream global models, is compatible with protocols from major global model providers, and covers full-modal processing capabilities for text, image, audio, video, and files. It serves more than 1.69 million enterprise and developer users. Exclusive benefits: enterprise users can claim 12 million free tokens, and invite friends to earn up to tens of billions of tokens.
Cubence Thanks to Cubence for sponsoring this project! Cubence is a reliable and efficient API relay service provider, offering relay services for Claude Code, Codex, Gemini, and more. Cubence provides special discounts for our software users: register using this link and enter the "CLIPROXYAPI" promo code during recharge to get 10% off.
Bestproxy Bestproxy provides high-purity residential IPs with dedicated one-IP-per-account support. 🟡Residential Proxy - $0.5/GB;🟡Static Residential Proxy - Starting at $3/IP;🟡Unlimited Residential Proxy - Starting at $67/Day. ✅Get Free Trial.
APIMart Thanks to APIMart for sponsoring this project! APIMart is a low-cost API platform for AI image & video generation — GPT-Image-2 from $0.006/image, 160+ images per dollar. One async API covers both image and video: submit a task, get an ID, fetch results via polling or callback. Batch tens of thousands of images without timeouts, switch models without changing code. Pay-as-you-go with no monthly fee — sign up here to get started.
AxisNow Protect and accelerate websites and APIs while optimizing access from both mainland China and the rest of the world. Extend acceleration and security to native and mobile apps through client SDKs — self-hosted private CDN | subscription-based DDoS-protected CDN | independently controlled, flexibly composable CDN networks.
Swiftproxy Swiftproxy provides 90M+ clean residential IPs across 220+ locations, supporting HTTP(S)/SOCKS5, IP rotation, Sticky Sessions, and precise location targeting. It helps AI API tools and automation workflows access online services reliably from different locations, making it ideal for API requests, web access, data collection, and location-based testing. Residential proxies from $0.7/GB. Free testing is available, with 10% off using code PROXY90. Try Swiftproxy Now
Aiberm This project is sponsored by Aiberm — a unified, discounted AI API for developers. One endpoint for Claude, GPT, Grok, DeepSeek, GLM, Kimi, and MiniMax: 85–90% off Claude, 90% off GPT, and 80% off Grok. Image generation included, with GPT Image 2 and Nano Banana. Visit Aiberm.
RapidProxy RapidProxy is a high-performance proxy provider built for automation and multi-account operations, offering clean residential proxies and native static ISP IPs. With 90M+ residential IPs worldwide, smart rotation, stable sessions, and high-concurrency support, RapidProxy is ideal for web scraping, browser automation, social media account management, e-commerce operations, bulk account registration, and more. Residential proxies start at just $0.55/GB, with traffic that never expires. Use code RAPID10 for 10% off, and start your free trial today.
PatewayAI PatewayAI is an API relay service provider for experienced AI developers, with full support for the Claude and Codex model families. All models come from high-quality official channels, with no dilution or counterfeiting, and transparent, verifiable billing details. Economy mode starts at just 5% of the official price. Register through this link to receive trial credits and participate in occasional promotions for free credits. The platform also supports enterprise-grade concurrency, a dedicated management dashboard, formal contracts and invoices, and two-way referral rewards of up to $150.
FluxA & Baidu AI Cloud Thanks to FluxA & Baidu AI Cloud for supporting this project! FluxA and Baidu AI Cloud jointly launched AgenticPlan, enabling AI Agents to autonomously purchase, manage, and use models, APIs, and tools. It includes Baidu Qianfan TokenPlan at prices as low as 60% of the standard rate, with access to flagship models such as DeepSeek V4, GLM 5.2, and Kimi. It also includes FluxA AgentMarket API call credits, unlocking 1,000+ paid APIs for search, data scraping, social media, finance, cryptocurrency, image generation, video, and more.

With user authorization, AI Agents can also use official Visa card payments to independently procure resources, manage API keys, monitor usage, and plan renewals—helping Agents evolve from “autonomously completing tasks” to truly being able to “autonomously plan budgets and complete tasks.” Learn more about AgenticPlan.

Overview

  • OpenAI/Gemini/Claude/Grok compatible API endpoints for CLI models
  • OpenAI Codex support (GPT models) via OAuth login
  • Claude Code support via OAuth login
  • Grok Build support via OAuth login
  • Streaming, non-streaming, and WebSocket responses where supported
  • Function calling/tools support
  • Multimodal input support (text and images)
  • Multiple accounts with round-robin load balancing (Gemini, OpenAI, Claude, Grok)
  • Simple CLI authentication flows (Gemini, OpenAI, Claude, Grok)
  • Generative Language API Key support
  • AI Studio Build multi-account load balancing
  • Claude Code multi-account load balancing
  • OpenAI Codex multi-account load balancing
  • Grok Build multi-account load balancing
  • OpenAI-compatible upstream providers via config (e.g., OpenRouter)
  • Reusable Go SDK for embedding the proxy (see docs/sdk-usage.md)

Getting Started

CLIProxyAPI Guides: https://help.router-for.me/

Management API

see MANAGEMENT_API.md

Usage Statistics

Since v6.10.0, CLIProxyAPI and CPAMC no longer ship built-in usage statistics. If you need usage statistics, use:

Standalone persistence and visualization service for CLIProxyAPI, with periodic data sync, SQLite storage, aggregate APIs, and a built-in dashboard for usage and statistics.

Full CLIProxyAPI management center with request-level monitoring and cost estimates. CPA-Manager tracks collected requests by account, model, channel, latency, status, and token usage; estimates cost with editable model prices and one-click LiteLLM price sync; persists events in SQLite; and provides Codex account-pool operations with batch inspection, quota detection, unhealthy account discovery, cleanup suggestions, and one-click execution for day-to-day multi-account maintenance.

SDK Docs

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Who is with us?

Those projects are based on CLIProxyAPI:

Native macOS menu bar app to use your Claude Code & ChatGPT subscriptions with AI coding tools - no API keys needed

A cross-platform desktop and web app to translate and validate SRT subtitles using your existing LLM subscriptions (Gemini, ChatGPT, Claude, etc.) via CLIProxyAPI - no API keys needed.

CLI wrapper for instant switching between multiple Claude accounts and alternative models (Gemini, Codex, Antigravity) via CLIProxyAPI OAuth - no API keys needed

Native macOS menu bar app that unifies Claude, Gemini, OpenAI, and Antigravity subscriptions with real-time quota tracking and smart auto-failover for AI coding tools like Claude Code, OpenCode, and Droid - no API keys needed.

Windows-native CLIProxyAPI fork with TUI, system tray, and multi-provider OAuth for AI coding tools - no API keys needed.

VSCode extension for quick switching between Claude Code models, featuring integrated CLIProxyAPI as its backend with automatic background lifecycle management.

Windows desktop app built with Tauri + React for monitoring AI coding assistant quotas via CLIProxyAPI. Track usage across Gemini, Claude, OpenAI Codex, and Antigravity accounts with real-time dashboard, system tray integration, and one-click proxy control - no API keys needed.

A lightweight web admin panel for CLIProxyAPI with health checks, resource monitoring, real-time logs, auto-update, request statistics and pricing display. Supports one-click installation and systemd service.

A Windows tray application implemented using PowerShell scripts, without relying on any third-party libraries. The main features include: automatic creation of shortcuts, silent running, password management, channel switching (Main / Plus), and automatic downloading and updating.

霖君 is a cross-platform desktop application for managing AI programming assistants, supporting macOS, Windows, and Linux systems. Unified management of Claude Code, Gemini, OpenAI Codex, and other AI coding tools, with local proxy for multi-account quota tracking and one-click configuration.

A modern web-based management dashboard for CLIProxyAPI built with Next.js, React, and PostgreSQL. Features real-time log streaming, structured configuration editing, API key management, OAuth provider integration for Claude/Gemini/Codex, usage analytics, container management, and config sync with OpenCode via companion plugin - no manual YAML editing needed.

Browser extension for one-stop management of New API-compatible relay site accounts, featuring balance and usage dashboards, auto check-in, one-click key export to common apps, in-page API availability testing, and channel/model sync and redirection. It integrates with CLIProxyAPI through the Management API for one-click provider import and config sync.

Shadow AI is an AI assistant tool designed specifically for restricted environments. It provides a stealthy operation mode without windows or traces, and enables cross-device AI Q&A interaction and control via the local area network ( LAN). Essentially, it is an automated collaboration layer of "screen/audio capture + AI inference + low-friction delivery", helping users to immersively use AI assistants across applications on controlled devices or in restricted environments.

Cross-platform desktop app (macOS, Windows, Linux) wrapping CLIProxyAPI with a native GUI. Connects Claude, ChatGPT, Gemini, GitHub Copilot, and custom OpenAI-compatible endpoints with usage analytics, request monitoring, and auto-configuration for popular coding tools - no API keys needed.

Ready-to-use cross-platform quota inspector for CLIProxyAPI, supporting per-account codex 5h/7d quota windows, plan-based sorting, status coloring, and multi-account summary analytics.

Native macOS SwiftUI app for monitoring ChatGPT/Codex account quotas in CLIProxyAPI pools. Displays account availability, Plus-base capacity, 5-hour and weekly quota bars, plan weights, and restore forecasts through the Management API.

Multi-agent orchestration for AI coding assistants. Runs CLIProxyAPI as a local sidecar so its agents can drive GPT models through a ChatGPT subscription, pointing Claude Code at an Anthropic-compatible endpoint with no OpenAI API key required.

Windows desktop UI that manages CLIProxyAPI and Perplexity WebUI Scraper from a single interface, inspired by Quotio and VibeProxy. Connect OAuth providers (Claude, Gemini, Codex, Kimi, Antigravity), custom API keys, and Perplexity session accounts, then point any coding agent at the local endpoint.

Cross-platform (Tauri) port of Quotio for Windows, macOS and Linux. Manages a pool of AI accounts (Codex, Claude Code, GitHub Copilot, Gemini, Antigravity, Kiro, Cursor, Trae, GLM) through CLIProxyAPI, with per-account 5-hour/weekly quota bars, Codex rate-limit reset credits with one-click reset, smart scheduling, usage statistics, and multi-instance Codex — no API keys needed.

VS Code extension that brings your Claude, ChatGPT/Codex, Antigravity, Grok, and Kimi subscriptions into GitHub Copilot Chat as native language models — and can power your Git commit messages, chat titles, and summaries too. Runs CLIProxyAPI in a fully managed background lifecycle (download, verify, supervise) shared across all windows, so it's zero-setup. No API keys needed, just OAuth.

A PowerShell-based Windows system tray launcher for CLIProxyAPI. It supports running in the background without a console window, opening the management page, keeping the backend running after the management window closes, and reopening the page from the tray. It also supports checking for CLIProxyAPI updates on startup, SHA-256 verification with rollback, one-click CLIProxyAPI restart and update, PID-validated process management, and safe service shutdown.

An HTTP-only Model Context Protocol server that uses a CLIProxyAPI deployment to provide Grok-powered real-time web search, X/Twitter search, and model discovery to MCP clients. It adds MCP transport, client API-key management, quotas, usage tracking, and a web administration panel.

Native macOS SwiftUI dashboard for AI subscriptions and coding proxies. It manages official CLIProxyAPI releases end to end (download, verify, supervise, update, and roll back), unifies OAuth accounts and live models, and connects one gateway to Codex, Claude Code/Science, OpenCode, or OpenAI/Anthropic/Gemini clients, with optional LAN access.

Run multiple native-feeling Claude Code commands, each powered by a different model (Codex, GLM, Kimi, Gemini, Grok, MiniMax, DeepSeek, Cursor, Copilot, Claude). Every dialect launches the real Claude Code interface with its own isolated config, history, ports, and an embedded CLIProxyAPI instance linked through the Go SDK — no separate proxy install. macOS only. Learn more at claude-dialects.cc.

Browser agent that can connect to CLIProxyAPI's local OpenAI-compatible endpoint as a model provider. See WebBrain's independent setup, security, and account-risk guide for using CLIProxyAPI through EasyCLIProxyAPI.

Native macOS menu bar app that runs a fleet of Claude accounts through CLIProxyAPI's Management API (claude-swap and 9Router too): 5h / 7d / per-model quota gauges, switch / hold / star from the popup, a run-rate forecast of when each window runs out, and an iPhone companion that mirrors it all - no API keys needed.

Self-hosted coding-agent platform built on the Pi SDK, with a web UI, concurrent subagents, and CubeSandbox KVM workspaces. Uses CLIProxyAPI as its provider gateway, keeping provider credentials outside the guest workspaces.

Claude Code status line for CLIProxyAPI: per-account Codex / Grok / Antigravity / Claude quotas (5h / 7d / weekly) and reset countdown for the current instance. Picks the CPA instance from ANTHROPIC_BASE_URL and reads quotas through the Management API.

Cross-platform Electron tray dashboard for CLIProxyAPI. Shows the real OAuth quota windows per account across ChatGPT/Codex, Claude, Gemini/Antigravity, Grok, Kimi and Cursor, estimates usage-queue cost, and tracks OpenAI/Claude service status. Dark terminal-style UI; runs on Windows and Linux.

Note

If you developed a project based on CLIProxyAPI, please open a PR to add it to this list.

More choices

Those projects are ports of CLIProxyAPI or inspired by it:

A Next.js implementation inspired by CLIProxyAPI, easy to install and use, built from scratch with format translation (OpenAI/Claude/Gemini/Ollama), combo system with auto-fallback, multi-account management with exponential backoff, a Next.js web dashboard, and support for CLI tools (Cursor, Claude Code, Cline, RooCode) - no API keys needed.

Never stop coding. Smart routing to FREE & low-cost AI models with automatic fallback.

OmniRoute is an AI gateway for multi-provider LLMs: an OpenAI-compatible endpoint with smart routing, load balancing, retries, and fallbacks. Add policies, rate limits, caching, and observability for reliable, cost-aware inference.

This is a tool built with Tauri 2 + Vue 3 for managing multiple OpenAI Codex desktop accounts. Switch between saved ChatGPT/Codex certification profiles, check 5-hour and weekly quota usage in real time, verify token health, view active account details, and import or save auth.json files without manual copying.

Note

If you have developed a port of CLIProxyAPI or a project inspired by it, please open a PR to add it to this list.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Mirasim 本地登录与多账号管理(Fim98 部署专用)

本节只适用于 Fim98/CLIProxyAPI 这个 fork 的部署方案(Render + mirasim 插件烘进镜像)。 上游 README 的其余部分与插件登录无关,勿混看。

本地登录工具链(已搭好,位于 /tmp/mirasim-local)

/tmp/mirasim-local/
├── CLIProxyAPI      # 本地 arm64 版 CPA 主程序(go build ./cmd/server)
├── mirasim.dylib    # 本地插件(go build -buildmode=c-shared;macOS 上必须 .dylib 后缀)
├── config.yaml      # 登录专用最小配置(端口 18399,auth-dir 指向本地 auths/)
└── auths/           # 登录成功后 mirasim-*.json 凭证落在这里

工具链丢失(如 /tmp 被清理)时重建:

# 1. 构建插件(在 cpa-plugin-mirasim 仓库)
cd ~/Documents/cpa-plugin-mirasim
go build -trimpath -buildmode=c-shared -o /tmp/mirasim-local/mirasim.dylib ./cmd/mirasim

# 2. 构建 CPA(在 CLIProxyAPI 仓库)
cd ~/Documents/CLIProxyAPI
CGO_ENABLED=1 go build -trimpath -ldflags="-s -w" -o /tmp/mirasim-local/CLIProxyAPI ./cmd/server/

# 3. 登录配置(写入 /tmp/mirasim-local/config.yaml)
cat > /tmp/mirasim-local/config.yaml << 'YAML'
host: ""
port: 18399
auth-dir: "/tmp/mirasim-local/auths"
api-keys:
  - "local-login-only"
remote-management:
  allow-remote: false
  disable-control-panel: true
debug: false
plugins:
  enabled: true
  dir: "/tmp/mirasim-local"
  configs:
    mirasim:
      enabled: true
YAML
mkdir -p /tmp/mirasim-local/auths

前提:go(brew install go)和 Xcode 工具链(c-shared 需要 C 编译器)。

登录一个账号

邮箱验证码登录(推荐,无浏览器依赖)

cd /tmp/mirasim-local
./CLIProxyAPI -config config.yaml --mirasim-login --mirasim-login-email <邮箱>
# 终端提示 Enter the Mirasim sign-in code: 时,输入邮箱收到的验证码,回车
# 成功输出: Authentication saved to /tmp/mirasim-local/auths/mirasim-usr_*.json

注意:邮箱验证码登录不走浏览器,纯终端完成。第一次跑只发码;如果终端无法交互, 可先跑一次发码,再带码重跑:--mirasim-login-email <邮箱> --mirasim-login-code <验证码>。

GitHub/Google OAuth 浏览器登录

cd /tmp/mirasim-local
./CLIProxyAPI -config config.yaml --mirasim-login
# 弹浏览器 → 授权 → 回调自动落到本机 127.0.0.1 监听器 → 凭证自动落盘

多账号

  • 每跑一次登录就多一个 mirasim-*.json(文件名含账号 ID,互不覆盖)
  • 登录产生的设备身份(device key)每份凭证独立;relay 若对某设备限流(429 region blocked),新登录一个账号即换新设备身份,通常可绕开
  • 本地测试多账号:把多个 json 一起放进 auths/ 再启动即可

上传凭证到 Render(存 Postgres,重启/重部署不丢)

管理面板(https://cpa.fim98.dpdns.org/management.html)→ Auth Files → 上传 mirasim-*.json;或:

curl -X POST "https://cpa.fim98.dpdns.org/v0/management/auth-files" \
  -H "Authorization: Bearer <MANAGEMENT_KEY>" \
  -F "file=@/tmp/mirasim-local/auths/mirasim-usr_xxx.json"

上传后插件自动刷新 token(15 分钟周期)并写回 Postgres,无需再管。

常见坑

症状 原因与处理
429 "云端中转未在当前网络区域提供服务" relay 对设备/账号的临时限流。等冷却(几分钟到几小时),或换号/换 IP 重试。桌面客户端不受影响是因为它的设备票据还热着
本地 /v1/models 返回空 凭证未加载或 relay 限流中;看 server.log 里 models for auth ... failed 行
Render 上模型列表为空但插件已注册 Postgres 配置缺 plugins: 段(管理面板配置页加上 plugins.enabled: true / dir: "plugins" / mirasim enabled: true 后重启服务)
macOS 构建插件后 CPA 不加载 插件文件名必须是 .dylib(Linux 才是 .so)
凭证文件放哪 /tmp 会丢;长期备份放 ~/.cli-proxy-api/ 或私密网盘,勿放公开目录

版本对应

  • 插件 release:Fim98/cpa-plugin-mirasim(fork 自 KIDA-MNESIA,加了国产模型支持)
  • Render 镜像里的插件版本由 Dockerfile 的 ARG MIRASIM_VERSION 控制(当前 1.3.1)
  • 改插件代码后发版:git tag vX.Y.Z && git push fork vX.Y.Z,GitHub Actions 自动构建发布

Zed 账号插件(浏览器一键 OAuth)

plugin/zed/ 是随本仓库一起构建的 CLIProxyAPI 原生插件:用 Zed 账号登录后, 把 Zed 云端 AI(Claude / GPT / Gemini / Grok 全系)代理成 OpenAI/Claude/Gemini 兼容接口。 Docker 构建时自动编译进镜像(plugins/zed.so),无需手动下载。

登录方式:浏览器一键 OAuth(专为 Render 远程部署设计)

Zed 的登录回调固定跳到 http://127.0.0.1:端口/...(浏览器所在机器),远程部署收不到。 插件在 CPA 里自托管了一个中转页来完成闭环:

  1. 管理面板(https://cpa.fim98.dpdns.org/management.html)→ OAuth 登录 → 选 zed (或 GET /v0/management/zed-auth-url)
  2. 面板会打开插件中转页 → 点「打开 Zed 登录页面」→ 在 zed.dev 完成授权
  3. 授权后浏览器跳到 http://127.0.0.1:.../?user_id=...&access_token=...(打不开是正常的)
  4. 把地址栏完整网址复制 → 粘贴回中转页输入框 → 点「完成登录」
  5. 页面显示保存了几个组织的凭据,管理面板里立即出现 zed-<用户名>-<组织>.json

按组织区分:Zed 按 organization 计费。一个账号属于多个组织时,一次登录会自动 保存每个组织一份凭据(默认组织排最前),调度器可在组织间轮换。只想登录某一个 组织时在配置里加 organization-id: <组织ID>。

本机部署(浏览器和 CPA 同机)时回调自动落盘,粘贴这步可以直接跳过。

验证

# 插件已注册(Render 部署后看日志):
#   pluginhost: plugin registered plugin_id=zed plugin_name=Zed Provider
curl -H "X-Management-Key: <MANAGEMENT_KEY>" \
  "https://cpa.fim98.dpdns.org/v0/management/zed-auth-url"    # 返回中转页 URL

# 测试调用(省 token:Claude 系用最便宜的 haiku)
curl "https://cpa.fim98.dpdns.org/v1/chat/completions" \
  -H "Authorization: Bearer <API_KEY>" -H "Content-Type: application/json" \
  -d '{"model":"claude-haiku-4-5","messages":[{"role":"user","content":"hi"}],"max_tokens":16}'

配置(plugins.configs.zed)

键 默认 说明
public-url 空 本部署公网地址(entrypoint 用 RENDER_EXTERNAL_URL 自动填);不填面板用相对路径也能打开中转页
organization-id 空 登录时只保存这个组织;不填保存全部组织
client-version 1.23.0 上报的 Zed 客户端版本(User-Agent / x-zed-version)
server-url / cloud-url zed.dev / cloud.zed.dev 官方端点,一般不动

注意

  • Postgres 存配置时:DB 里的配置会覆盖文件。若部署后 /zed-auth-url 404, 在管理面板配置页确认 plugins: 段包含 zed: {enabled: true}(public-url 可留空)。
  • Zed 凭据没有 refresh token,长期有效;插件每 6 小时自动校验一次。若校验开始 返回 401,重新走一遍上面的登录流程即可。
  • 插件代码在 plugin/zed/(嵌套 Go module),改完直接 push,Render 重新构建即生效。

Contributors

luispaterhkfiressususu98LTbinglingfengben-vargassoilSpoonkdcokennynothing-7011edlshwykk-12138Fim98HEUDavidlyd123qw2008RaviTharumaTTTPOBRGBadminVooDisssDragonFSKYanpicassohuynguyen03devlzt4047RPHaikins01dcrdevMonsterQiuhuahai0202dacsang97lhpqaqdinhkarateHuiCheng

Issues