Commit Graph

11 Commits

  • 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.
  • Refactor translator packages for OpenAI Chat Completions
    - Renamed `openai` packages to `chat_completions` across translator modules.
    - Introduced `openai_responses_handlers` with handlers for `/v1/models` and OpenAI-compatible chat completions endpoints.
    - Updated constants and registry identifiers for OpenAI response type.
    - Simplified request/response conversions and added detailed retry/error handling.
    - Added `golang.org/x/crypto` for additional cryptographic functions.
  • Add support for new GPT-5 model variants
    - Renamed existing GPT-5 variants for consistency (`nano` → `minimal`, `mini` → `low`, etc.).
    - Added metadata definitions for new variants: `gpt-5-minimal`, `gpt-5-low`, `gpt-5-medium`, and updated logic to reflect variant-specific reasoning efforts.
  • Add nil-check for GetRequestMutex across handlers to prevent potential panics
    - Updated all handlers to safely unlock the request mutex only if it's non-nil.
    - Enhanced mutex locking and unlocking logic to avoid runtime errors.
    - Improved robustness of resource cleanup across clients.
    
    Add `GetRequestMutex` method for synchronization across clients
    
    - Introduced a new `GetRequestMutex` method in OpenAICompatibilityClient, CodexClient, GeminiCLIClient, GeminiClient, and QwenClient for request synchronization.
    - Ensures only one request is processed at a time to manage quotas effectively.
  • Add OpenAI compatibility support and improve resource cleanup
    - Introduced OpenAI compatibility configurations for external providers, enabling model alias routing via the OpenAI API format.
    - Enhanced provider logic in `GetProviderName` to handle OpenAI aliases and added new helper functions for compatibility checks.
    - Updated API handlers and client initialization to support OpenAI compatibility models.
    - Improved resource cleanup across clients by closing response bodies and streams using deferred functions.
  • Add request logging capabilities to API handlers and update .gitignore
    Enhance API response handling by storing responses in context and updating request logger to include API responses