1. 07 Apr, 2026 1 commit
    • fix: Claude 流式断流时不再整份覆盖 usage,保留 cache 计费字段 · f7cdc727
      HandleStreamFinalResponse 在 !Done 时调用 ResponseText2Usage 整份覆盖
      claudeInfo.Usage,导致 message_start 已获取的 CacheReadInputTokens、
      CacheCreationInputTokens 等字段丢失,prompt 退化为占位值 1。
      
      修复:
      - 只补缺失的 CompletionTokens/PromptTokens,保留已有 cache 数据
      - PromptTokens 兜底改用 info.GetEstimatePromptTokens()(与其他渠道对齐)
      
      Fixes #4127
      zuiho committed
  2. 06 Apr, 2026 5 commits
  3. 05 Apr, 2026 6 commits
  4. 04 Apr, 2026 4 commits
  5. 03 Apr, 2026 2 commits
  6. 02 Apr, 2026 14 commits
  7. 01 Apr, 2026 7 commits
  8. 31 Mar, 2026 1 commit
    • fix: move image count n to OtherRatio to prevent double-counting · ab99c308
      The previous commit commented out AddOtherRatio("n") in the Ali
      adaptor to fix double-counting but this could cause billing evasion
      when n is specified via extra["parameters"] instead of request.N.
      
      Root cause: ImagePriceRatio in GetTokenCountMeta() already included
      n, AND channel adaptors added OtherRatio("n"), resulting in n²
      billing.
      
      Proper fix:
      - Remove n from ImagePriceRatio (keep sizeRatio * qualityRatio only)
      - In ImageHelper, add default OtherRatio("n") when adaptor hasn't
        set one; set fallback tokens to 1 (base unit)
      - Restore Ali adaptor's AddOtherRatio("n") — it uses actual upstream
        parameters/response count, preventing billing evasion
      CaIon committed