ccproxy-api icon indicating copy to clipboard operation
ccproxy-api copied to clipboard

feat(models): add provider model and effort aliases

Open saxyguy81 opened this issue 6 months ago • 1 comments

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/max reasoning 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 input payloads, clamp max to xhigh before Codex backend dispatch, preserve detected Codex CLI version in fallback headers, and allow x-api-key as 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 check
  • uv 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 passed
  • uv 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 passed
  • git diff --check

saxyguy81 avatar May 10 '26 06:05 saxyguy81

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 preserving call_* 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.

saxyguy81 avatar May 10 '26 07:05 saxyguy81