Commit Graph

18 Commits

  • feat(claude): add model alias mapping and improve key normalization
    - Introduced model alias mapping for Claude configurations, enabling upstream and client-facing model name associations.
    - Added `computeClaudeModelsHash` to generate a consistent hash for model aliases.
    - Implemented `normalizeClaudeKey` function to standardize input API key configuration, including models.
    - Enhanced executor to resolve model aliases to upstream names dynamically.
    - Updated documentation and configuration examples to reflect new model alias support.
  • feat(auth): add iFlow provider support with multi-account load balancing
    - Integrated iFlow as a new authentication provider with OAuth.
    - Updated README and documentation for iFlow-specific configuration.
    - Enhanced CLI and Docker commands to support iFlow login and server setup.
    - Expanded model routing to include iFlow-supported models.
  • feat(auth): normalize OpenAI compatibility entries and enhance proxy configuration
    - Added automatic trimming of API keys and migration of legacy `api-keys` to `api-key-entries`.
    - Introduced per-key `proxy-url` handling across OpenAI, Codex, and Claude API configurations.
    - Updated documentation to clarify usage of `proxy-url` with examples, ensuring backward compatibility.
    - Added normalization logic to reduce duplication and improve configuration consistency.
  • chore(docs): remove outdated allow-localhost-unauthenticated section from API docs
    - Deleted references to `allow-localhost-unauthenticated` endpoint in `MANAGEMENT_API.md` and `MANAGEMENT_API_CN.md`.
  • feat(auth, docs): add label support for Gemini web token management
    - Added `label` field to the management API for better token identification.
    - Updated request payload and validation logic to include `label` as a required field.
    - Adjusted documentation (`MANAGEMENT_API.md`, `MANAGEMENT_API_CN.md`) to reflect changes.
  • feat(auth): add Gemini Web token saving endpoint
    - Introduced `POST /gemini-web-token` endpoint to save Gemini Web cookies directly.
    - Added payload validation and hashed-based file naming for persistence.
    - Updated documentation to reflect the new management API functionality.
  • feat(usage): add in-memory usage statistics tracking and API endpoint
    - Introduced in-memory request statistics aggregation in `LoggerPlugin`.
    - Added new structures for detailed metrics collection (e.g., token breakdown, request success/failure).
    - Implemented `/usage` management API endpoint for retrieving aggregated statistics.
    - Updated management handlers to support the new usage statistics functionality.
    - Enhanced documentation to describe the usage metrics API.
  • feat(auth): introduce auth.providers for flexible authentication configuration
    - Replaced legacy `api-keys` field with `auth.providers` in configuration, supporting multiple authentication providers including `config-api-key`.
    - Added synchronization to maintain compatibility with legacy `api-keys`.
    - Updated core components like request handling and middleware to use the new provider system.
    - Enhanced management API endpoints for seamless integration with `auth.providers`.
  • feat: introduce custom provider example and remove redundant debug logs
    - Added `examples/custom-provider/main.go` showcasing custom executor and translator integration using the SDK.
    - Removed redundant debug logs from translator modules to enhance code cleanliness.
    - Updated SDK documentation with new usage and advanced examples.
    - Expanded the management API with new endpoints, including request logging and GPT-5 Codex features.
  • Add OAuth support for Gemini CLI, Claude, Codex, and Qwen authentication
    - Implemented new handlers (`RequestGeminiCLIToken`, `RequestAnthropicToken`, `RequestCodexToken`, `RequestQwenToken`) for initiating OAuth flows.
    - Added endpoints for authorization URLs in management API.
    - Extracted `GenerateRandomState` to a reusable utility in `misc` package.
    - Refactored related logic in `openai_login.go` and `anthropic_login.go` for consistency.
    
    Add endpoints for initiating OAuth flows in management API documentation
    
    - Documented new endpoints for Anthropic, Codex, Gemini CLI, and Qwen login URLs.
    - Provided request and response examples for each endpoint in both English and Chinese versions.
  • Add dynamic log level adjustment and "type" field to auth files response
    - Introduced `SetLogLevel` utility function for unified log level management.
    - Updated dynamic log level handling across server and watcher components.
    - Extended auth files response by extracting and including the `type` field from file content.
    - Updated management API documentation with the new `type` field in auth files response.
  • Add JSON annotations to configuration structs and new /config management endpoint
    - Added JSON annotations across all configuration structs in `config.go`.
    - Introduced `/config` management API endpoint to fetch complete configuration.
    - Updated management API documentation (`MANAGEMENT_API.md`, `MANAGEMENT_API_CN.md`) with `/config` usage.
    - Implemented `GetConfig` handler in `config_basic.go`.
  • Update MANAGEMENT_API.md with expanded documentation for endpoints
    - Refined API documentation structure and enhanced clarity for various endpoints, including `/debug`, `/proxy-url`, `/quota-exceeded`, and authentication management.
    - Added comprehensive examples for request and response bodies across endpoints.
    - Detailed object-array API key management for Codex, Gemini, Claude, and OpenAI compatibility providers.
    - Enhanced descriptions for request retry logic and request logging endpoints.
    - Improved authentication key handling descriptions and updated examples for YAML configuration impacts.
  • Add support for Codex API key authentication
    - Introduced functionality to handle Codex API keys, including initialization and management via new endpoints in the management API.
    - Updated Codex client to support both OAuth and API key authentication.
    - Documented Codex API key configuration in both English and Chinese README files.
    - Enhanced logging to distinguish between API key and OAuth usage scenarios.
  • Add management API handlers for config and auth file management
    - Implemented CRUD operations for authentication files.
    - Added endpoints for managing API keys, quotas, proxy settings, and other configurations.
    - Enhanced management access with robust validation, remote access control, and persistence support.
    - Updated README with new configuration details.
    
    Fixed OpenAI Chat Completions for codex