CLIProxyAPIHome

module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: MIT

README

Home

English | 中文

Home is a comprehensive credential management, scheduling, and distribution service designed for CLIProxyAPI.

It serves as a centralized hub for managing and scheduling API credentials in large-scale CLIProxyAPI cluster deployments. CLIProxyAPI nodes communicate with Home to retrieve necessary API credentials and report usage statistics.

Key Features

  • Scalable Node Management: Supports connecting an unlimited number of CLIProxyAPI nodes for credential distribution, ideal for large-scale deployments.
  • Multi-Provider OAuth2 Support: Manages OAuth2 credentials for various AI model providers, including OpenAI, Gemini, Claude, Codex, and more.
  • High Availability: Supports multi-account management and round-robin load balancing to ensure optimal performance and reliability.
  • Secure Access: Provides a streamlined CLI authentication flow to ensure secure access to APIs.
  • Flexible Upstream Integration: Easily integrate upstream providers via configuration, including:
    • OpenAI-compatible providers (e.g., OpenRouter)
    • OpenAI Responses protocol providers
    • Anthropic Messages protocol providers
    • Google Gemini protocol providers

集群模式

当工作目录中存在 cluster.yaml 时,Home 会启用基于 PGSQL 的集群模式;当 cluster.yaml 不存在时,Home 会保持单节点模式并继续使用本地配置。

可以复制 cluster.example.yamlcluster.yaml 后按实际环境修改。PGSQL 连接必须使用 TCP hostport,不能使用 Unix Socket。集群模式启动并完成迁移后,会删除已经导入的本地凭证文件和 config.yaml,避免后续继续读取旧的本地状态。

集群模式下,Management API 会直接操作 PGSQL 中的数据。默认监听端口来自 cluster.yamlnode.port;也可以通过启动参数 -addr 覆盖监听地址,但实际集群节点端口始终以最终监听端口为准。

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.

License

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

Directories

Path Synopsis
cmd
home command
internal
auth
Package auth provides authentication functionality for various AI service providers.
Package auth provides authentication functionality for various AI service providers.
auth/antigravity
Package antigravity provides the minimal constants needed to refresh Antigravity credentials.
Package antigravity provides the minimal constants needed to refresh Antigravity credentials.
auth/claude
Package claude provides token refresh functionality for Anthropic credentials used by the scheduler.
Package claude provides token refresh functionality for Anthropic credentials used by the scheduler.
auth/codex
Package codex provides authentication and token management for OpenAI's Codex API.
Package codex provides authentication and token management for OpenAI's Codex API.
auth/kimi
Package kimi provides token refresh for Kimi (Moonshot AI) credentials used by the scheduler.
Package kimi provides token refresh for Kimi (Moonshot AI) credentials used by the scheduler.
buildinfo
Package buildinfo exposes compile-time metadata shared across the server.
Package buildinfo exposes compile-time metadata shared across the server.
config
Package config provides configuration management for the CLI Proxy API server.
Package config provides configuration management for the CLI Proxy API server.
registry
Package registry provides model definitions and lookup helpers for various AI providers.
Package registry provides model definitions and lookup helpers for various AI providers.
util
Package util provides utility functions for the CLI Proxy API server.
Package util provides utility functions for the CLI Proxy API server.
watcher
Package watcher watches the config file and auth directory for changes and triggers hot reload callbacks.
Package watcher watches the config file and auth directory for changes and triggers hot reload callbacks.
watcher/diff
auth_diff.go computes human-readable diffs for auth file field changes.
auth_diff.go computes human-readable diffs for auth file field changes.
watcher/synthesizer
Package synthesizer provides auth synthesis strategies for the watcher package.
Package synthesizer provides auth synthesis strategies for the watcher package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL