Skip to content

[Bug] Claude 流式请求时 Usage 丢失 cache_tokens相关的参数 #884

@ffflyZzz

Description

@ffflyZzz

使用claude 流式请求的时候,one-hub没有把cache tokens传递出去,导致后面的api无法统计/获取cachetoken的数量

Image Image

复现步骤:
通过 one-hub 代理调用 Claude API,开启 stream: true 和 cache_control
观察返回的 usage 字段
对比 one-hub 日志记录的 prompt_tokens 与实际返回给客户端的值

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions