File tree Expand file tree Collapse file tree
apps/chat/src/app/api/chatbots/[chatbotId]/chat Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -915,30 +915,13 @@ export async function POST(
915915 } )
916916 imageDescription = descriptionResult . text
917917
918- // deduct credits for image description generation
918+ // compute image description cost; billed via creditsUsed at finish/abort
919919 if ( descriptionResult . usage ) {
920920 imageDescriptionCost = calcCost (
921921 selectedModelConfig . cost ,
922922 descriptionResult . usage . inputTokens || 0 ,
923923 descriptionResult . usage . outputTokens || 0
924924 )
925- if ( imageDescriptionCost > 0 ) {
926- try {
927- await CreditsService . decrementCredits (
928- participantId ,
929- chatbotId ,
930- imageDescriptionCost
931- )
932- } catch ( creditsError ) {
933- console . error (
934- 'Failed to decrement credits for image description:' ,
935- {
936- requestId,
937- error : creditsError ,
938- }
939- )
940- }
941- }
942925 }
943926 } catch ( error ) {
944927 console . error ( 'Failed to generate image description:' , {
You can’t perform that action at this time.
0 commit comments