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. Ifhas_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)
How it works
- You choose a machine, date range, reliability level (
r), and confidence (p). - The API loads per-day earnings from your machine’s rental history.
- For each active day, it computes GPU, storage, and bandwidth earnings plus simulated SLA host earnings.
- It returns a day-by-day breakdown and summary totals.
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 realistictarget_reliability. - For tail risk, trust
worst_day_loss, not headlinetotal_sla. - Timescale mix (
β) is derived fromr(weights recent vs longer-term uptime in settlement). Hosts cannot set β via the listing API.
Before you start
Prerequisites: API key withmachine_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.
- Open Account → API Keys in the console and create a key with
machine_readenabled. - Copy the token and use
Authorization: Bearer YOUR_API_KEYin the examples below. See Create API Key and Authentication. - 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: falsewithout sufficient history). - Run the baseline request in Example request and check
has_datain 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.Query parameters
Limits
Example request
Minimal baseline (default 90-day lookback — no custom dates required):Reading the response
If you only read three fields: Checkhas_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)
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.
Recommended workflow
- 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
rat or slightly below the claim you plan to publish. - Use normal confidence (
p=0.6667). - If
has_dataisfalse, widen the date range or wait for more rental history.
- Check
worst_day_loss— can you absorb that credit from a bad day? - Try a higher
r(for example0.99) and see howtotal_slachanges. - Run a stress test with
reliability=0.90at your intended claim. - List with
sla_r_claim— set claim (andsla_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 baselinecurl once per machine instead.
- List machine IDs:
vastai show machines -q(numeric IDs only) orvastai show machines --raw | jq -r '.machines[].id'. - Run backtests sequentially (one machine at a time):
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.
- Compare
worst_day_lossandtotal_slaacross machines. - Apply
sla_r_claim/sla_sigma_xwhen 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.
Related documentation
- SLA Backtest API — formal API reference for this endpoint
- SLA Offers — listing parameters, economics, and risk scenarios
- SLA Coverage (clients) — how renters choose targets and read
dph_total - API permissions —
machine_readscope required