Choose the provider for a new sandbox
Orders the providers the team lists for one new sandbox with CostGraph AutoPilot. providers are ComputeSDK provider names in the team’s order; a repeated name counts once. Send the sandbox size as size_class (xs, sm, md, lg, xl or 2xl), or as vcpus and memory_mib; size_class wins when both are sent. Only the first 20 providers are priced, and a name CostGraph does not recognise is kept without a price. The team’s first provider is the baseline. Providers are compared on expected_cost, the USD cost of one sandbox of the size running for expected_seconds: the run time rounded up to the provider’s billing increment and at least its minimum billed time, at its price per hour. expected_seconds is the median run time, at most 24 hours, of the team’s stopped sandboxes of the same size that started in the last 30 days when there are at least 20, otherwise 600. startup_p50_ms and success_rate come from ComputeSDK’s public burst benchmark (github.com/computesdk/benchmarks, MIT), which starts 100 sandboxes at once: the median milliseconds from a create request to the first command in that sandbox, and the share of the 100 starts that succeeded; both are null for a provider it does not benchmark. When AutoPilot for sandboxes is on, the order follows the team’s policy. cheapest: providers with a price for the size, lowest expected_cost first, then the others; a provider whose startup_p50_ms is more than twice the baseline’s goes after the other priced providers, and a missing start time never holds a provider back. fastest: providers whose expected_cost is no more than the baseline’s, fastest start first, then lower expected_cost, with those without a start time after them by expected_cost, then dearer providers in the same way, then those without a price; the baseline stays first unless a provider starts strictly faster than it. balanced: a provider whose expected_cost is no more than the baseline’s and whose start time is within the baseline’s start time plus the larger of 100 ms and 10% (the limit) scores (baseline expected_cost - its expected_cost) x (limit - its startup_p50_ms); providers scoring above zero come first, highest score first, then faster start, then lower expected_cost; then the other priced providers by start time (none last), then expected_cost; then those without a price; the baseline stays first when no provider scores above zero. In every policy a provider other than the baseline whose success_rate is below 0.95 moves to the end, and remaining ties keep the team’s order. reason is the policy (cheapest, fastest or balanced) when the first provider changed, otherwise no_better_candidate. The order stays the team’s when AutoPilot is off (reason off), when no size is sent (reason no_size) and when the baseline has no price for the size (reason baseline_not_priced). candidates lists every provider in the returned order with its USD price per hour, expected_cost, billing_increment_seconds and minimum_billed_seconds for the size when known. Always answers 200 when the body has at least one provider: when CostGraph cannot choose (rate_limited, billing_required or error), the order is the team’s, candidates is empty and decision_id is empty. When the reason is billing_required, billing_url links to the billing settings. Send decision_id back with the sandbox’s started event.
Authorizations
API key for machine-to-machine authentication
Headers
Tenant ID
Body
The team's providers and the sandbox size