mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-06 22:01:44 +08:00
Claude Code injects a dynamic `x-anthropic-billing-header` line at the start of `system` content. Its rotating `cch=` token was forwarded into OpenAI Responses `instructions` and Chat system messages, which broke upstream prefix prompt cache reuse — a stable ~95k-token prefix was getting re-charged on every request. Strip only the leading occurrence in both anthropic_to_openai and anthropic_to_responses; later occurrences are preserved so user-authored prompt text containing the same string is not lost.