diff --git a/docs.json b/docs.json index 386dcdd..05ebefd 100644 --- a/docs.json +++ b/docs.json @@ -38,7 +38,8 @@ }, "docs/api-key", "docs/cookbook", - "docs/support" + "docs/support", + "docs/billing" ] }, { diff --git a/docs/billing.mdx b/docs/billing.mdx new file mode 100644 index 0000000..0658d32 --- /dev/null +++ b/docs/billing.mdx @@ -0,0 +1,118 @@ +--- +title: "Billing & pricing" +sidebarTitle: "Billing" +icon: "credit-card" +--- + +E2B uses [usage-based pricing](#usage-based-pricing) - you pay only for what you use. New users receive $100 in free credits to get started. + +[Manage billing in dashboard](https://e2b.dev/dashboard?tab=billing) + +## Plans + +| Feature | Hobby | Pro | Enterprise | +|---------|-------|-----|------------| +| **Base price** | $0/month | $150/month | Custom | +| **Free credits** | $100 (one-time) | $100 (one-time) | Custom | +| **Max session length** | 1 hour | 24 hours | Custom | +| **Concurrent sandboxes** | 20 | 100 - 1,100 | 1,100+ | + + +Pro plan includes 100 concurrent sandboxes. Higher concurrency up to 1,100 is available as a purchasable add-on. + + +Plans have different [API rate limits](/docs/sandbox/rate-limits). + +To upgrade your plan or purchase add-ons, visit the [dashboard billing tab](https://e2b.dev/dashboard?tab=billing). For Enterprise plans, [contact sales](mailto:enterprise@e2b.dev). + +--- + +## Usage-based pricing + +You pay per second for the **allocated compute resources** defined in your template, not actual CPU/RAM usage. Charges accrue for the entire time a sandbox is running. + + +**Important**: You are billed based on the CPU and RAM **allocated** to your sandbox template, regardless of how much your code actually uses. Make sure to kill or pause sandboxes when not in use to avoid unnecessary charges. + + +### Compute costs + +Use the [usage cost calculator](https://e2b.dev/pricing#:~:text=Usage%20Cost%20Calculator) on our pricing page to estimate costs for your specific configuration. + +### Customizing compute resources + +You can customize allocated CPU and RAM when building custom templates by specifying `cpuCount` and `memoryMB` in the build configuration. + + +```js JavaScript & TypeScript +import { Template, defaultBuildLogger } from 'e2b' + +// This template will be billed for 8 vCPU + 4 GB RAM +// whenever a sandbox from it is running +await Template.build(template, { + alias: "my-template", + cpuCount: 8, + memoryMB: 4096, + onBuildLogs: defaultBuildLogger(), +}) +``` +```python Python +from e2b import Template, default_build_logger + +# This template will be billed for 8 vCPU + 4 GB RAM +# whenever a sandbox from it is running +Template.build( + template, + alias="my-template", + cpu_count=8, + memory_mb=4096, + on_build_logs=default_build_logger(), +) +``` + + +See [template quickstart](/docs/template/quickstart) for more details on building custom templates. + + +Higher allocated resources mean higher costs. For example, a sandbox with 8 vCPU and 4 GB RAM costs $0.468 per hour while running. + + +--- + +## Monitoring usage + +Check your usage and costs in the [dashboard usage tab](https://e2b.dev/dashboard?tab=usage). + +--- + +## FAQ + + + + Usage costs accumulate throughout the month as you run sandboxes. Your payment card is charged at the end of each monthly billing cycle for the total accumulated usage. + + + + You're charged for the **allocated** resources defined in your template, not the actual CPU/RAM your code uses. A sandbox with 8 vCPU allocated costs the same whether it uses 10% or 100% of that CPU. + + + + Once credits are exhausted, you'll need to add a payment method to continue using E2B. Existing sandboxes will continue running but you won't be able to create new ones. + + + + Yes, you can set spending limits on the [budget page](https://e2b.dev/dashboard?tab=budget) in your dashboard. + + + + - **Always kill sandboxes when done** - Use `sbx.kill()` to stop billing immediately + - **Allocate only what you need** - Start with default resources (2 vCPU, 1 GB RAM) and increase only if necessary + - **Implement automatic timeouts** - Set max session lengths to prevent forgotten sandboxes from running + - **Monitor actively running sandboxes** - Use the [CLI](/docs/cli/list-sandboxes) or [dashboard](https://e2b.dev/dashboard?tab=usage) to track active sandboxes + - **Use lifecycle events** - Set up [webhooks](/docs/sandbox/lifecycle-events-webhooks) to get notified when sandboxes are created + + + + No. You only pay while a sandbox is actively running. Once a sandbox is killed or times out, billing stops immediately. + +