[错误] 在粘性会话中,在账号故障切换后计费出现错误
The reason is that I found that for the same request, the cost billing on my side is lower than the actual consumption on the upstream (the billing rate of my account is consistent with the rate on the upstream, and the token price is also consistent), which may lead to losses without realizing it. By observing the token count on my side and the token count on the upstream in the same request, I found that I counted the input token count on the upstream in the cache count on my side, resulting in the cost that should belong to the input token being billed as a cache token. As a result, I charged less to the downstream. After the AI analysis, it was found that during the session of this request, the original account had a failure, so sub2api automatically switched accounts and converted the input token of the previous account into a cache token for counting. I don't know if this is a bug or a deliberate design by the author. In any case, this will result in the charge to the downstream being less than the actual charge, and the problem is particularly obvious for accounts of the Anthropic type.
内容来源: Wei-Shaw/sub2api