最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

OpenAI's Token Usage confusion with Cached Input Tokens - Stack Overflow

programmeradmin5浏览0评论

Should I subtract the CachedInputTokens with InputTokens when I receive the 'Usage' object back from OpenAI response?

Im trying to calculate how much the response costs in total.

I get back values:

  • Input: 1204
  • Cached input: 1024
  • Output: 12

OpenAI Pricing:

  • Input: $0.150 / 1M tokens
  • Cached input: $0.075 / 1M tokens
  • Output: $0.600 / 1M tokens

I have tried using their official website to find the solution but didn't.

I was expecting Input to be lower (automatically subtracted with the cached input, so result would be 180). Not sure if I should subtract or not, when calculating everything.

发布评论

评论列表(0)

  1. 暂无评论