per-second$500M-1B sandbox market by 2028

Per-Second Billing for Code Execution and Sandboxes

Bill for compute time, not flat fees. Wrap E2B, Modal, AWS Lambda, or any sandbox with per-second metering and automatic budget enforcement.

How it works

TypeScript
import { settlegrid } from '@settlegrid/mcp'

const sg = settlegrid.init({
  toolSlug: 'my-sandbox',
  pricing: { model: 'per-second', costPerSecondCents: 0.5 },
})

const billedExecution = sg.wrap(async (args: { code: string; language: string }) => {
  const startTime = Date.now()
  const result = await e2b.runCode(args.code, { language: args.language })
  const durationMs = Date.now() - startTime
  return {
    content: [{ type: 'text', text: result.output }],
    _meta: { durationMs },
  }
})

Supported providers

SettleGrid works with any provider. Here are the most common ones for code execution & sandboxes.

ProviderPricing
E2BFirecracker sandboxes -- per-second compute
ModalServerless GPU/CPU -- per-second billing
DaytonaDev environments -- per-minute billing
Vercel SandboxEdge compute -- per-invocation
AWS LambdaServerless functions -- per-ms billing
BlaxelManaged sandboxes -- per-second compute
Billing model: per-second

Why per-second billing?

Code execution pricing should reflect actual compute consumed. Per-second billing is fairer than per-invocation because a 200ms script costs less than a 30-second data pipeline. SettleGrid reads the durationMs metadata from your response and bills accordingly, supporting both CPU and GPU rate cards.

$500M-1B

Total Addressable Market

6

Supported Providers

2 min

Setup Time

Frequently asked questions

How does per-second billing work with SettleGrid?
Return a _meta.durationMs field in your sg.wrap() response. SettleGrid multiplies the duration by your configured rate (e.g., 0.5 cents/second) to calculate the charge. Budget caps are enforced before execution starts.
Can I charge different rates for GPU vs CPU?
Yes. Use method-level pricing to define separate rates for gpu_execution and cpu_execution. SettleGrid bills at the rate matching the method name you pass.
What happens if code execution times out?
You control the timeout in your sandbox. If execution is killed, return the partial result with the actual duration. SettleGrid only bills for time consumed, not the full timeout window.
Is there a maximum execution time?
SettleGrid does not impose execution time limits -- that is up to your sandbox configuration. However, budget caps will prevent a user from running up an unlimited bill.

Start billing code execution & sandboxes today

Add per-second billing to your code execution & sandboxes service in under 2 minutes. No upfront costs, no contracts.

SettleGrid Help

AI-powered support

How can I help?

Ask me anything about SettleGrid