CLIProxyAPIHome

module
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 13, 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 Mode

Home enables PGSQL-backed cluster mode when cluster.yaml exists in the working directory. When cluster.yaml is absent, Home keeps the single-node mode and continues using local configuration.

Copy cluster.example.yaml to cluster.yaml, then adjust it for the target environment. PGSQL connections must use a TCP host and port; Unix sockets are not supported. After cluster mode starts and completes migration, Home deletes the imported local credential files and config.yaml so it will not keep reading stale local state.

In cluster mode, the Management API operates directly on data stored in PGSQL. The default listen port comes from node.port in cluster.yaml; the startup -addr flag can override the listen address, but the effective cluster node port always follows the final listen port.

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