Concepts

Billing & Credits

Workspace usage is metered and billed through the credits system. This page explains how usage converts to credits.

How billing works

Workspace Running ──► Usage Metrics Collected ──► Converted to Pricing Units ──► Credits Debited
                      (every few seconds)         (cpu_time, memory, disk, net)   (from your balance)
  1. While a workspace is running, the platform collects usage metrics (CPU time, memory, disk I/O, network)
  2. Metrics are collected and converted to pricing units
  3. Credits are debited from your account balance

Pricing units

UnitDescriptionHow measured
cpu_time_minutesCPU time consumedNanoseconds of CPU time → minutes
memory_gb_minutesMemory held over timeAllocated MB × uptime → GB-minutes
disk_io_gbTotal disk I/ORead + write bytes → GB
network_gbTotal network transferInbound + outbound bytes → GB

Credit rates

Credit rates vary by plan and can be checked via the API:

// Check current pricing
const pricing = await client.credits.pricingInfo();

Or from the DashboardCreditsPricing page.

What costs credits

ActivityCredits used
Workspace runningCPU time + memory duration
Disk I/O (reads/writes)Billed per GB transferred
Network trafficBilled per GB in/out
Workspace stoppedNo credits consumed
Workspace pausedMinimal (memory preserved but no CPU)
API callsNot billed separately

Managing costs

Use temporary mode

Auto-expire workspaces to avoid forgetting to stop them:

await ws.create({
  config: { ttl: '1h', ttl_action: 'stop' },
});

Right-size resources

Don't over-provision. Start small and scale up:

// Start with minimum resources
await ws.create({
  config: { cpus: 1, memory_mb: 256 },
});

// Scale up only when needed
await ws.resources.update(id, { cpus: 4, memory_mb: 4096, apply: true });

Pause when idle

Paused workspaces consume far less than running ones:

await ws.pause(id); // Freeze - minimal cost
await ws.resume(id); // Resume when needed

Set namespace quotas

Limit spending per namespace:

await client.credits.setNamespaceQuota('production', {
  quotaLimit: 1000,
  period: 'daily',
});

Monitor usage

Track credit consumption in real-time:

// Credits chart for a workspace
const chart = await ws.usage.creditsChart(id);
console.log(`Total credits burned: ${chart.total}`);

// Account balance
const balance = await client.credits.balance();
console.log(`Available: ${balance.available} credits`);

Plan allowances & credit packages

For current plan credit allowances, pricing, and available credit packages, see the Pricing page.