Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Update deep-research-service.ts

Nicolas30c1e92a2e73
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 eb9150d31..74996c81d 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 },