• sususu98's avatar
    fix: include Gemini thoughtsTokenCount in output token billing · d21d70a5
    sususu98 authored
    Gemini 2.5 Pro/Flash thinking models return thoughtsTokenCount separately
    from candidatesTokenCount in usageMetadata, but this field was not parsed
    or included in billing calculations, causing thinking tokens to be
    unbilled.
    
    - Add ThoughtsTokenCount field to GeminiUsageMetadata struct
    - Include thoughtsTokenCount in OutputTokens across all 3 Gemini usage
      parsing paths (non-streaming, streaming, compat layer)
    - Add tests covering thinking token scenarios
    
    Closes #554
    d21d70a5
gemini_messages_compat_service.go 97.5 KB