@@ -552,6 +552,11 @@ <h2><i class="fas fa-table"></i> Detailed Breakdown</h2>
552552 'gpt-4o-mini' : { input : 0.15 , output : 0.60 } ,
553553 'gpt-4o' : { input : 2.50 , output : 10.00 } ,
554554 'gpt-5.2' : { input : 1.75 , output : 14.00 } ,
555+ // ElevenLabs TTS models (priced per character, stored in prompt_tokens)
556+ 'eleven_flash_v2_5' : { input : 100.00 , output : 0 } , // $0.10 per 1K chars
557+ 'eleven_turbo_v2_5' : { input : 300.00 , output : 0 } , // $0.30 per 1K chars
558+ 'eleven_multilingual_v2' : { input : 300.00 , output : 0 } , // $0.30 per 1K chars
559+ 'eleven_monolingual_v1' : { input : 300.00 , output : 0 } , // $0.30 per 1K chars
555560 // Gemini models (text/summarization)
556561 'gemini-2.5-flash' : { input : 0.15 , output : 0.60 } ,
557562 'gemini-2.5-flash-preview-tts' : { input : 0.15 , output : 0.60 } ,
@@ -567,16 +572,31 @@ <h2><i class="fas fa-table"></i> Detailed Breakdown</h2>
567572 output : 0.40
568573 } ;
569574
575+ // Audio transcription pricing (per second)
576+ const AUDIO_PRICING_PER_SECOND = {
577+ 'whisper-1' : 0.0001 , // $0.006 per minute / 60
578+ 'voxtral-mini-latest' : 0.00005 , // $0.003 per minute / 60
579+ } ;
580+
570581 function calculateCost ( summary ) {
571582 let totalCost = 0 ;
572583
573584 summary . by_provider_model_feature . forEach ( item => {
574585 const model = item . model ;
575586 const feature = item . feature ;
576587 const provider = item . provider ;
577- let pricing = MODEL_PRICING [ model ] ;
588+ const audioDuration = item . total_audio_duration_seconds || 0 ;
589+
590+ // Check if this model uses per-second audio pricing
591+ if ( AUDIO_PRICING_PER_SECOND [ model ] && audioDuration > 0 ) {
592+ const cost = audioDuration * AUDIO_PRICING_PER_SECOND [ model ] ;
593+ totalCost += cost ;
594+ console . log ( `${ provider } /${ model } /${ feature } : ${ ( audioDuration / 60 ) . toFixed ( 2 ) } minutes = $${ cost . toFixed ( 4 ) } ` ) ;
595+ return ;
596+ }
578597
579598 // Special handling for Gemini audio transcription
599+ let pricing = MODEL_PRICING [ model ] ;
580600 if ( provider === 'gemini' && feature === 'transcription' ) {
581601 pricing = GEMINI_AUDIO_PRICING ;
582602 console . log ( `Using Gemini audio pricing for ${ model } transcription` ) ;
@@ -803,9 +823,18 @@ <h2><i class="fas fa-table"></i> Detailed Breakdown</h2>
803823 const feature = item . feature ;
804824 const model = item . model ;
805825 const provider = item . provider ;
806- let pricing = MODEL_PRICING [ model ] ;
826+ const audioDuration = item . total_audio_duration_seconds || 0 ;
827+
828+ // Check if this model uses per-second audio pricing
829+ if ( AUDIO_PRICING_PER_SECOND [ model ] && audioDuration > 0 ) {
830+ const cost = audioDuration * AUDIO_PRICING_PER_SECOND [ model ] ;
831+ featureCosts [ feature ] = ( featureCosts [ feature ] || 0 ) + cost ;
832+ featureCalls [ feature ] = ( featureCalls [ feature ] || 0 ) + item . call_count ;
833+ return ;
834+ }
807835
808836 // Special handling for Gemini audio transcription
837+ let pricing = MODEL_PRICING [ model ] ;
809838 if ( provider === 'gemini' && feature === 'transcription' ) {
810839 pricing = GEMINI_AUDIO_PRICING ;
811840 }
0 commit comments