See which customers cost more in sandbox compute than they pay

Group your E2B sandboxes by the customer they belong to, work out what each one really costs you, and put it next to what that customer actually pays.

App
E2BGoogle SheetsSlackFinanceEngineeringAI ReportsResearch & Monitoring
PromptCreate

Build me an app that shows which of my customers cost more in E2B sandbox compute than they pay me. I run a multi-tenant AI product and I tag every sandbox at creation with the customer it belongs to, so that metadata tag is the join key between my infrastructure bill and my revenue.

Give the app a settings page where I set the numbers everything else depends on. I need a per-vCPU-hour rate and a per-GiB-hour rate that I type in myself, defaulting to E2B's published $0.0504 per vCPU-hour and $0.0162 per GiB-hour but fully editable. I also need to choose which sandbox metadata key holds the customer identifier, because every team tags differently: mine might be customerId, someone else's is userId or orgId. Finally let me point at the Google Sheet and tab that holds my plan prices, choose the sheet the monthly ledger gets appended to, and pick the Slack channel for month-end posts. Persist all of this.

The main screen is a table of customers. Build it by calling E2B List Sandboxes with a metadata filter on the configured key, then grouping the results by that key's value. Each row shows the customer identifier, how many sandboxes they have, their total compute hours, the estimated compute cost, their monthly plan price, and the resulting margin in both dollars and percent. Read the plan prices from my pricing tab with Google Sheets Get Values and match them to the customer identifier. Let me sort by thinnest margin so whoever is underwater floats to the top, and style negative-margin rows so they are obvious at a glance.

E2B does not return dollar figures anywhere in its API, so cost has to be derived rather than fetched. For each sandbox, take its CPU and memory allocation and multiply by how long it actually ran: vCPU count times hours times my per-vCPU-hour rate, plus memory in GiB times hours times my per-GiB-hour rate. Get the allocation from Get Sandbox, and the CPU, memory and disk numbers from List Sandboxes Metrics for the batch view and Get Sandbox Metrics for a single sandbox. Work out real lifespan from List Team Sandbox Lifecycle Events by pairing each created event with its matching paused, resumed or killed event, so a sandbox that was up for twenty minutes is not billed as if it ran all week.

Clicking a customer opens their sandbox history in detail: every sandbox they have ever had, with template, current state, created and ended times, lifespan, peak and average CPU and memory, disk usage, and that sandbox's share of their bill. Show the lifecycle event history too, so I can see the actual pattern of starts, pauses and resumes.

Put an "Explain this account" button on every customer row and on their detail page. It kicks off a background agent that reads that customer's sandboxes, metrics and lifecycle events, then writes a plain-English explanation of what actually drove their bill, covering things like long-running sessions, oversized templates, or sandboxes left paused for weeks, along with concrete recommendations. Save the write-up back into the app so it shows on the customer's page with the date it was generated, and show progress while it runs.

Give me two finish-of-month actions. One appends the whole margin ledger to a Google Sheet using Append Values, one row per customer with sandbox count, compute hours, estimated cost, plan price and margin. The other posts the list of underwater accounts to Slack with Send a Message, formatted so I can read it on my phone.

One cost nuance worth baking in: paused sandboxes stop billing compute, but their filesystem and memory snapshot keeps consuming storage until they are deleted, and E2B retains them for up to thirty days. A customer sitting on a pile of forgotten paused sandboxes is a real margin leak, so surface paused sandbox counts and their age on the customer page, and have the agent call it out when it applies.

What does this prompt do?

  • Groups every sandbox you run by the customer it belongs to, using the tag you already attach when the sandbox is created.
  • Works out what each customer actually costs you in compute, applying your own hourly rates to how much processor and memory each sandbox held and how long it really ran.
  • Puts that cost next to what the customer pays you every month, so you can sort by thinnest margin and see exactly who is underwater.
  • Gives you a one click explanation of any account, written in plain English, covering what drove the bill and what to do about it.

What do I need to use this?

  • An E2B account, with sandboxes tagged at creation with a customer or user identifier.
  • A Google Sheets file with a tab listing each customer and their monthly plan price.
  • The per hour rates you want to price processor and memory time at. E2B's published rates work as a starting point.
  • A Slack workspace, if you want the month end summary posted to a channel.

How can I customize it?

  • Change the tag the app groups by, so it matches however your team labels sandboxes, whether that is customer, user or organization.
  • Set your own hourly rates for processor and memory time, and update them whenever your pricing changes.
  • Choose which spreadsheet holds your plan prices, where the monthly ledger gets appended, and which Slack channel hears about underwater accounts.

FAQs

Why can't I just use the E2B dashboard for this?
E2B can show you what your team is spending overall, but it has no idea who your customers are or what they pay you. This app joins your sandbox usage to your own plan prices, so you see margin per paying customer rather than one total bill.
Where do the dollar figures come from?
E2B does not publish dollar amounts through its API, so the app calculates them. You enter your own rate per processor hour and per memory hour, and the app multiplies those by how much each sandbox held and how long it actually ran.
What if my team tags sandboxes differently?
The tag is configurable. If you label sandboxes with a user or organization identifier instead of a customer one, set that in settings and the whole app regroups around it.
Does this work if some sandboxes are paused rather than running?
Yes, and it is worth paying attention to. Paused sandboxes stop costing you compute but keep taking up storage until they are deleted, for up to thirty days. The app surfaces how many paused sandboxes each customer is sitting on.
What does the explain button actually give me?
A short written summary of why that customer's bill looks the way it does, pointing at things like long running sessions, oversized templates or forgotten paused sandboxes, along with recommendations. It saves onto the customer's page so you can come back to it.

Related templates

Prospecting desk that builds account lists from the live web

Stop buying stale lists. Reps run a saved search, work the results like an inbox, and only the accounts they approve ever reach your CRM.

Hyperbrowser
HubSpot
Google Sheets
App
Influencer campaign roster board with AI creator briefs

Drag creators through Sourced to Wrapped on a board grouped by campaign, with audience stats on every card and a one-click brief for each creator.

HypeAuditor
Google Sheets
Notion
App
Browse and shortlist creators without burning audit credits

Search creators for free, shortlist the best with your team, and spend an audit credit only when you decide someone is worth a closer look.

HypeAuditor
Airtable
Slack
App
Morning repricing console for Shopify with margin-safe rules

Pick a repricing rule, send an assistant out to check competitor pages, then approve the new prices that clear your margin floor.

Hyperbrowser
Shopify
Google Sheets
App
Pre-flight bounce check before you launch a cold email sequence

See the projected bounce rate for any outbound send before it goes out, and keep the launch button locked until the list is clean enough to be safe.

Hunter
Google Sheets
App
Hiring funnel dashboard for every open Hireflix role

One screen showing invited, completed, and shortlisted counts for every open role, plus the stalled invites that have quietly gone nowhere.

Hireflix
Slack
App

Find out which customers you are losing money on.

Put your real compute cost next to what each customer pays, and stop guessing where your margin is going.