Spaces:
Sleeping
Sleeping
Download apps/api/src/lib/browser-billing.ts from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 380 Bytes
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/lib/browser-billing.ts
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/api/src/lib/browser-billing.ts
-
curl -L -o browser-billing.ts https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/lib/browser-billing.ts
380 Bytes
| export const BROWSER_CREDITS_PER_HOUR = 120; | |
| export const INTERACT_CREDITS_PER_HOUR = 420; | |
| export function calculateBrowserSessionCredits( | |
| durationMs: number, | |
| creditsPerHour = BROWSER_CREDITS_PER_HOUR, | |
| ): number { | |
| const hours = durationMs / 3_600_000; | |
| const minCredits = Math.ceil(creditsPerHour / 60); | |
| return Math.max(minCredits, Math.ceil(hours * creditsPerHour)); | |
| } | |