Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions docs/api-reference/sandboxes/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Create a new sandbox.
</ParamField>

<ParamField body="cpuCount" type="integer">
CPU cores. Must match an allowed tier: `1`, `2`, `4`, `8`, or `16`. If omitted but `memoryMB` is set, inferred automatically.
CPU cores. Must match an allowed tier: `1`, `2`, or `4`. If omitted but `memoryMB` is set, inferred automatically.
</ParamField>

<ParamField body="memoryMB" type="integer">
Memory in MB. Must match an allowed tier: `1024`, `4096`, `8192`, `16384`, `32768`, or `65536`. If omitted but `cpuCount` is set, inferred automatically.
Memory in MB. Must match an allowed tier: `1024`, `4096`, `8192`, or `16384`. If omitted but `cpuCount` is set, inferred automatically.
</ParamField>

The allowed CPU/memory combinations are:
Expand All @@ -29,8 +29,6 @@ The allowed CPU/memory combinations are:
| 4096 MB (4 GB) | 1 |
| 8192 MB (8 GB) | 2 |
| 16384 MB (16 GB) | 4 |
| 32768 MB (32 GB) | 8 |
| 65536 MB (64 GB) | 16 |

The 1 GB tier provides 1 vCPU on a best-effort basis. For guaranteed CPU allocation, use the 4 GB tier or above.

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/typescript-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Create a new sandbox.
| `apiUrl` | string | env var | API URL |
| `envs` | Record\<string, string\> | — | Environment variables |
| `metadata` | Record\<string, string\> | — | Arbitrary metadata |
| `cpuCount` | number | — | CPU cores (1, 2, 4, 8, or 16) |
| `memoryMB` | number | — | Memory in MB (1024, 4096, 8192, 16384, 32768, or 65536) |
| `cpuCount` | number | — | CPU cores (1, 2, or 4) |
| `memoryMB` | number | — | Memory in MB (1024, 4096, 8192, or 16384) |
| `image` | Image | — | Declarative image definition (see [Image](#image)) |
| `snapshot` | string | — | Name of a pre-built snapshot |
| `onBuildLog` | `(log: string) => void` | — | Build log callback (when using `image`) |
Expand Down
2 changes: 0 additions & 2 deletions docs/sandboxes/elasticity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ CPU is adjusted proportionally — you only need to specify memory. The permissi
| 4GB | 1 |
| 8GB | 2 |
| 16GB | 4 |
| 32GB | 8 |
| 64GB | 16 |

## Check Current Limits

Expand Down
41 changes: 20 additions & 21 deletions internal/billing/pricing.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import (
)

// TierPricePerSecond maps memory_mb → USD per second.
// Rates were 10×-ed on 2026-04-15 on top of the per-second correction that
// landed earlier the same day. Existing paying orgs are grandfathered via
// orgs.price_locked (see migration 022); cmd/migrate-prices skips locked orgs
// by default so only new signups see these rates.
// Reverted on 2026-04-22 back to the pre-10× rates established by the
// per-second correction on 2026-04-15. Orgs that signed up at the 10× rate
// between 2026-04-15 and 2026-04-22 are migrated onto these rates via
// cmd/migrate-prices (price_locked=FALSE by default).
var TierPricePerSecond = map[int]float64{
1024: 0.00001080246914, // 1GB / 1 vCPU
4096: 0.00005787037037, // 4GB / 1 vCPU
8192: 0.0001350308642, // 8GB / 2 vCPU
16384: 0.0002700617284, // 16GB / 4 vCPU
32768: 0.001929012346, // 32GB / 8 vCPU
65536: 0.005401234568, // 64GB / 16 vCPU
1024: 0.000001080246914, // 1GB / 1 vCPU
4096: 0.000005787037037, // 4GB / 1 vCPU
8192: 0.00001350308642, // 8GB / 2 vCPU
16384: 0.00002700617284, // 16GB / 4 vCPU
32768: 0.0001929012346, // 32GB / 8 vCPU
65536: 0.0005401234568, // 64GB / 16 vCPU
}

// TierMeterKey maps memory_mb → stable key used to derive the Stripe meter
Expand All @@ -37,18 +37,17 @@ var TierMeterKey = map[int]string{
// must then be migrated to the new Price via cmd/migrate-prices — unless the
// org is marked price_locked=TRUE, in which case they are grandfathered.
//
// The suffixes here are bumped one step above the per-second-correction set
// (which established _v2 for most tiers and _v3 for 8GB). This forces
// EnsureProducts to create fresh Prices at the 10×-higher rates below. Every
// org currently paying is locked via migration 022, so migrate-prices skips
// them by default — only new signups subscribe at the 10× rate.
// The suffixes here are bumped one step above the 10× set (_v3 for most tiers,
// _v4 for 8GB) to force EnsureProducts to create fresh Stripe Prices at the
// reverted pre-10× rates below. Orgs still on the 10× Prices are moved onto
// these new Prices via cmd/migrate-prices after deploy.
var TierPriceKey = map[int]string{
1024: "sandbox_1gb_v3",
4096: "sandbox_4gb_v3",
8192: "sandbox_8gb_v4",
16384: "sandbox_16gb_v3",
32768: "sandbox_32gb_v3",
65536: "sandbox_64gb_v3",
1024: "sandbox_1gb_v4",
4096: "sandbox_4gb_v4",
8192: "sandbox_8gb_v5",
16384: "sandbox_16gb_v4",
32768: "sandbox_32gb_v4",
65536: "sandbox_64gb_v4",
}

// Disk overage billing — every GB above DiskFreeAllowanceMB is metered for the
Expand Down