feat: bill OpenAI cache_write_tokens at cache-creation price with zero clamp

Parse OpenAI's native cache_write_tokens (chat prompt_tokens_details /
responses input_tokens_details), bill it at the cache-creation ratio, and
clamp the uncached prompt remainder at zero since cached + cache-write can
exceed prompt_tokens. Propagate the field through chat/responses/claude
format conversions and tiered expression billing (cc variable).
This commit is contained in:
CaIon
2026-07-11 21:18:49 +08:00
parent c36418c863
commit 48068ce923
18 changed files with 158 additions and 20 deletions
@@ -329,7 +329,7 @@ function CommonLogsCard<TData>({
/>
</div>
<div className='grid grid-cols-[minmax(0,1.35fr)_minmax(0,0.75fr)] gap-1.5'>
<div className='grid grid-cols-[minmax(0,1fr)_minmax(0,0.8fr)] gap-1.5'>
<div className='bg-muted/20 min-w-0 rounded-md px-2 py-1.5'>
<MobileLogTimeStatus
createdAt={rowData?.created_at}