> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ppio.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# How Agent Sandbox billing works

> See which sandbox resources are metered, how paused and killed sandboxes are billed, where usage and bills appear, and what an overdue balance does.

Agent Sandbox charges for the vCPU and memory a sandbox uses while it runs, and for the storage that keeps templates, paused sandboxes and snapshots. This page covers what is metered, how the sandbox state changes the bill, and where to check usage and bills.

## Billed resources

> [card] vCPU
>
> Cores used times runtime, billed per second and shown in **AGENT SANDBOX › Usage**.

> [card] Memory
>
> Allocated memory times runtime, billed per second and shown in **AGENT SANDBOX › Usage**.

> [card] Ephemeral storage
>
> Included while running, retained as persistent storage when paused.

> [card] Persistent storage
>
> Templates and snapshots, billed daily and shown in **AGENT SANDBOX › Usage**.

Model calls that an agent makes inside a sandbox are billed separately, at the model's own rate.

## Billing while paused

Once a sandbox is paused, vCPU and memory stop being billed. Only the persistent storage that retains the sandbox data is charged.

| | Running | Paused | Killed |
| - | - | - | - |
| vCPU and memory billing | Per second | Stopped | Stopped |
| Storage billing | Included (ephemeral disk) | Persistent storage | None |
| State kept | Not applicable | Filesystem and memory, including running processes | Deleted |
| Can resume | Not applicable | Yes, typically in about a second | No |

A paused sandbox resumes with its state intact. A killed sandbox and its data are gone. To see how many sandboxes currently count toward the concurrency limit, read `usage` from the [quota API](https://docs.ppio.ai/sandbox/quotas.md). For the SDK calls, see [Pause and resume a sandbox](https://docs.ppio.ai/sandbox/pause-resume.md).

## Where to check usage

**AGENT SANDBOX › Usage** shows the daily vCPU hours, memory hours and usage costs across all sandboxes; see [Usage](https://docs.ppio.ai/sandbox/console.md#usage) for what each figure covers and how it relates to the final bill.

## Prices

> [card] [Agent Sandbox prices](https://ppio.ai/pricing)
>
> Unit prices for vCPU, memory and persistent storage.

## Export a bill

Bill data can be viewed and exported as an `.xlsx` file.

**1. Open the bill**

Open **Billing › Overview** in the [console](https://console.ppio.ai/billing).

**2. Set the query**

Set the time range and how the results are grouped.

**3. Export the bill**

Export the query results as an `.xlsx` file.

## Overdue balance

> [!CAUTION]
>
> If the balance cannot cover the bill, the team is overdue. While a team is overdue, new sandboxes cannot be started and running sandboxes are terminated. Overdue payments result in data loss.

Keep the balance sufficient for the workloads that run. Notification emails are sent after the team becomes overdue. Recharge promptly. Check the balance and top up in **Billing › Overview**.

> [!TIP]
>
> Set up a low balance alert on the [Billing › Overview](https://console.ppio.ai/billing) page. When the balance drops below the alert threshold, a notification email is sent.

Before an overdue event, persist anything that cannot be lost:

> [card] [Push code to Git](https://docs.ppio.ai/sandbox/git.md)

> [card] [Save a snapshot](https://docs.ppio.ai/sandbox/snapshots.md)

> [card] [Copy files out](https://docs.ppio.ai/sandbox/filesystem/download.md)

> [!NOTE]
>
> When the balance cannot cover a new sandbox, the API rejects the request and the SDK raises an exception. See [Errors](https://docs.ppio.ai/sandbox/errors.md) for the class and the message.

## Control the cost of a task

> [card] [Size the template to the workload](https://docs.ppio.ai/sandbox/templates/build.md)
>
> CPU and memory are set when the template is built.

> [card] [Stop paying for idle time](https://docs.ppio.ai/sandbox/idle-timeout.md)
>
> Set an idle timeout, or pause sandboxes between steps.

> [card] [Check what a task spent](https://docs.ppio.ai/sandbox/console.md#usage)
>
> **AGENT SANDBOX › Usage** shows the current day.

To pause a sandbox between steps, see [Pause and resume a sandbox](https://docs.ppio.ai/sandbox/pause-resume.md).


## Related topics

- [Agent Sandbox: secure cloud sandboxes for AI agents](https://docs.ppio.ai/sandbox/overview.md)
- [Pause and resume a sandbox](https://docs.ppio.ai/sandbox/pause-resume.md)
- [Manage sandboxes in the PPIO console](https://docs.ppio.ai/sandbox/console.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.