diff --git a/apps/api/src/lib/deep-research/deep-research-service.ts b/apps/api/src/lib/deep-research/deep-research-service.ts index eb9150d3..74996c81 100644 --- a/apps/api/src/lib/deep-research/deep-research-service.ts +++ b/apps/api/src/lib/deep-research/deep-research-service.ts @@ -296,7 +296,7 @@ export async function performDeepResearch(options: DeepResearchServiceOptions) { finalAnalysis: finalAnalysis, }); // Bill team for usage based on URLs analyzed - billTeam(teamId, subId, urlsAnalyzed, logger).catch( + billTeam(teamId, subId, Math.min(urlsAnalyzed, options.maxUrls), logger).catch( (error) => { logger.error( `Failed to bill team ${teamId} for ${urlsAnalyzed} URLs analyzed`, { teamId, count: urlsAnalyzed, error },