Skip to content

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

feat(lockdown): Update Lockdown Billing (#3424)

Abimael Martell8af5b1fda8da
diff --git a/apps/api/src/lib/scrape-billing.ts b/apps/api/src/lib/scrape-billing.ts
index f4f07653b..f5607a113 100644
--- a/apps/api/src/lib/scrape-billing.ts
+++ b/apps/api/src/lib/scrape-billing.ts
@@ -41,7 +41,8 @@ export async function calculateCreditsToBeBilled(
// Bill for DNS resolution errors
if (
error instanceof TransportableError &&
- error.code === "SCRAPE_DNS_RESOLUTION_ERROR"
+ (error.code === "SCRAPE_DNS_RESOLUTION_ERROR" ||
+ error.code === "SCRAPE_LOCKDOWN_CACHE_MISS")
) {
creditsToBeBilled = 1;
}
@@ -49,11 +50,12 @@ export async function calculateCreditsToBeBilled(
return creditsToBeBilled;
}
+ let creditsToBeBilled = 1; // Assuming 1 credit per document
+
if (options.lockdown) {
- return 5;
+ creditsToBeBilled += 4;
}
- let creditsToBeBilled = 1; // Assuming 1 credit per document
const changeTrackingFormat = hasFormatOfType(
options.formats,
"changeTracking",