Skip to main content
The SLA (Service Level Agreement) earnings backtester lets you answer a practical question before you list: if clients had rented with reliability target r and I offered SLA at confidence p, how would that have affected my earnings on this machine over the last few months? Console hosts: use Set Pricing → SLA in the web console to preview SLA charges — you do not need this API. API hosts: this endpoint replays historical earnings through SLA math to estimate SLA charges and worst-day credit risk before listing. (r = reliability level used as both claim and target in the simulation; p = host confidence — both defined in Query parameters below.) It replays your machine’s real historical compute earnings and reliability through the same SLA settlement math used in production, then compares the simulated result to what you actually earned from SLA (if anything). See Choose your path below.
Don’t want to use the API? The backtester is optional. Use the web console SLA preview and the economics walkthrough on SLA Offers to evaluate SLA before listing. The backtester is for hosts who want historical replay via the API.

Choose your path

When to use it

Use the backtester before you enable SLA on a listing, or when you want to tune parameters. The machine needs at least a few weeks of rental history. If has_data is false, widen the date range or pick a machine with more rental activity. Use the backtester to:
  • Pick a reliability claim and confidence before you enable SLA on a listing
  • Compare how SLA charge and worst-case credit change across targets
  • Stress-test a lower reliability assumption before you commit
  • Compare to history — each day includes historical_sla, your machine’s realized SLA earnings on that day (zero if you were not offering SLA)
For how SLA offers work once listed, see SLA Offers.

How it works

  1. You choose a machine, date range, reliability level (r), and confidence (p).
  2. The API loads per-day earnings from your machine’s rental history.
  3. For each active day, it computes GPU, storage, and bandwidth earnings plus simulated SLA host earnings.
  4. It returns a day-by-day breakdown and summary totals.
Simulated vs listing parameters. In the backtester, reliability claim and client target are both set to r. That is a conservative what-if: it pretends every client targeted your claim. When you list, you set only sla_r_claim (and sla_sigma_x); clients choose their own target_reliability at search/rent time. Workflow: backtest worst_day_loss at a candidate claim level, then verify visible SLA charges in Set Pricing → SLA (or dph_total in search at realistic client targets) before listing. Active vs idle days. Idle days are days with no rental earnings on the machine (no active compute rental). These days typically produce no SLA charge or credit in the simulation. Days with no rental activity appear in the results as zero-filled rows but do not count toward covered_days. Only days with actual earnings are replayed through SLA math.
Simulation vs live listing
  • The backtester sets claim equal to target and may show higher SLA charges than live listing when clients choose targets below your claim.
  • For client-visible pricing (dph_total), use Set Pricing → SLA in the console or search with a realistic target_reliability.
  • For tail risk, trust worst_day_loss, not headline total_sla.
  • Timescale mix (β) is derived from r (weights recent vs longer-term uptime in settlement). Hosts cannot set β via the listing API.

Before you start

Prerequisites: API key with machine_read permission, machine ID from the Host Machines page, and curl (or Postman). On Windows, use WSL or Postman. This is the same numeric machine ID as machid on the earnings API and machine in listing requests.
  1. Open Account → API Keys in the console and create a key with machine_read enabled.
  2. Copy the token and use Authorization: Bearer YOUR_API_KEY in the examples below. See Create API Key and Authentication.
  3. Find your machine ID on the Host Machines page. The machine must have at least a few weeks of rental activity — new or idle machines should use the console Set Pricing → SLA preview instead (the backtester returns has_data: false without sufficient history).
  4. Run the baseline request in Example request and check has_data in the response.

API reference

The backtester is available through the REST API only. You must own the machine and use an API key with machine_read permission. Python SDK (vastai package) support is not yet available — use the curl examples below.
Requires Bearer authentication. This endpoint is rate-limited like other host API endpoints — see Rate Limits and Errors for retry guidance.

Query parameters

Limits

Example request

Minimal baseline (default 90-day lookback — no custom dates required):
Custom date range (optional — Jan–Apr 2024 for illustration):
Compare two confidence levels on the same history:
Stress-test with flat 90% uptime:

Reading the response

If you only read three fields: Check has_data (widen dates if false), then summary.worst_day_loss, then summary.total_sla. A successful response looks like this (fields abbreviated):

Top-level fields

Per-day fields (daily_results)

Review sla day by day in daily_results to see which days would have helped or hurt under the chosen parameters. Compare against historical_sla to see how simulated economics differ from reality.

Summary fields

Interpreting results

Mostly positive sla values

Your historical reliability was strong relative to the simulated target. SLA would likely have been a net positive — small SLA charges on strong days, few days with credits.

Negative sla on specific days

Those days had reliability below the simulated target. The magnitude shows how much you would have credited. If you see clusters of negative days, consider a lower claim, wider confidence, or fixing reliability before listing SLA.

total_sla near zero

Break-even territory — SLA charges and credits roughly balance. Typical when your actual reliability matches the simulated target.

total_sla strongly negative

Under the simulated parameters, SLA would have cost you money over this window. Either improve reliability, lower the claim, or widen confidence before listing.

Using reliability override

Setting reliability=0.90 while keeping r=0.99 answers: if every active day had 90% uptime, how bad would SLA credits get? Use this to understand worst-case credit exposure before committing to a high claim.

Confidence values (p)

p and sla_sigma_x use different scales — do not copy numeric values between them. For example, p=0.5 (wide confidence) maps to sla_sigma_x ≈ 1.0, not 0.5. Use the table below to translate between the two.
The backtester accepts p (confidence) instead of sla_sigma_x. The mappings below match common listing values: Tighter confidence (higher p) does not reduce credit owed on a miss — use worst_day_loss and reliability= overrides to model settlement exposure.

Error responses

For missing or invalid API keys and permission denials (machine_read), see Authentication.
  1. Run a baseline backtest on a machine with at least a few weeks of rental history:
    • Check your machine’s uptime history on the Host Machines page, then use the console SLA preview or backtester — do not rely on the dashboard reliability score alone (see Machine reliability score vs SLA reliability).
    • Choose an r at or slightly below the claim you plan to publish.
    • Use normal confidence (p=0.6667).
    • If has_data is false, widen the date range or wait for more rental history.
  2. Check worst_day_loss — can you absorb that credit from a bad day?
  3. Try a higher r (for example 0.99) and see how total_sla changes.
  4. Run a stress test with reliability=0.90 at your intended claim.
  5. List with sla_r_claim — set claim (and sla_sigma_x) on the offer; clients choose their own targets in search (see SLA Offers).

Fleet workflow

This section is for hosts automating fleet review. Console-only hosts can run the baseline curl once per machine instead.
  1. List machine IDs: vastai show machines -q (numeric IDs only) or vastai show machines --raw | jq -r '.machines[].id'.
  2. Run backtests sequentially (one machine at a time):
Expect roughly two seconds per machine minimum (sleep 2 plus request time). For 50 machines, budget at least a few minutes. Run off-peak before a fleet SLA rollout. On 429, back off per Rate Limits and Errors. Parallel requests are not recommended unless you implement backoff.
  1. Compare worst_day_loss and total_sla across machines.
  2. Apply sla_r_claim / sla_sigma_x when listing via the API (see SLA Offers).

When stuck

  • has_data: false — Widen the date range or wait for rental history.
  • 401 — Check API key permissions (machine_read) and Bearer header format.
  • Still stuck — Ask in the host Discord.