ccproxy-api
ccproxy-api copied to clipboard
feat(models): add provider model and effort aliases
Summary
- Add Claude-facing aliases for Opus 4.7 and 1M Sonnet/Opus variants, with local token-limit entries for the 1M aliases.
- Add Codex-facing
gpt-5.5,gpt-5.5-*,gpt-5.4, and explicit Codex model mappings. - Accept
xhigh/maxreasoning efforts in OpenAI-compatible request models, map Responses reasoning effort into Anthropic thinking budgets, and apply Codex model-alias effort defaults. - Normalize Codex-compatible string
inputpayloads, clampmaxtoxhighbefore Codex backend dispatch, preserve detected Codex CLI version in fallback headers, and allowx-api-keyas a shared-secret header for compatible clients.
This is intentionally parallel to #64 and #65. It does not depend on Anthropic tool-history compaction or the Responses fc_* item-id fix.
For 1M Claude aliases, this PR exposes aliases and token limits while relying on the existing Anthropic beta-header merge behavior to preserve client- or CLI-provided long-context beta tags. It does not force long-context beta headers for every account/model combination.
Validation
./Taskfile checkuv run pytest tests/unit/auth/test_auth.py tests/unit/llms/formatters/test_openai_to_anthropic_helpers.py tests/unit/llms/formatters/test_openai_to_openai_reasoning.py tests/plugins/codex/unit/test_adapter.py tests/unit/plugins/test_codex_detection.py tests/unit/utils/test_model_mapper.py tests/plugins/max_tokens/test_service.py tests/plugins/claude_api/integration/test_claude_api_basic.py -q- 115 passeduv run pytest tests/unit tests/plugins/codex/unit/test_adapter.py tests/plugins/max_tokens/test_service.py tests/plugins/claude_api/integration/test_claude_api_basic.py -q- 671 passedgit diff --check
Coordination note for reviewers:
This PR is intentionally parallel to #64 and #65.
- #64 fixes Anthropic compacted tool-history sanitization and context truncation behavior.
- #65 fixes OpenAI Responses protocol compatibility for function-call item IDs (
fc_*item IDs while preservingcall_*call IDs). - #66 adds provider/model/effort aliases for Claude and Codex-compatible clients.
There is no intended dependency between these PRs. They can be reviewed and merged independently; if one lands first, I will rebase the others only if GitHub reports a conflict.