Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b09217b
First draft for SLA documentation
robertfernandez-vast Jul 6, 2026
2adeff1
Address doc-review feedback for host SLA documentation.
robertfernandez-vast Jul 6, 2026
fea5c76
docs(sla): address doc-review consensus (cycle 1)
robertfernandez-vast Jul 7, 2026
3cddbde
docs(sla): address doc-review consensus (cycle 2)
robertfernandez-vast Jul 7, 2026
998170f
docs(sla): address doc-review consensus (cycle 3)
robertfernandez-vast Jul 7, 2026
314f5a4
docs(sla): address doc-review consensus (cycle 4)
robertfernandez-vast Jul 7, 2026
0e63e1e
docs(sla): address doc-review consensus (cycle 5)
robertfernandez-vast Jul 7, 2026
2c766c0
docs(sla): address doc-review consensus (cycle 6)
robertfernandez-vast Jul 7, 2026
a50dc8d
docs(sla): address doc-review consensus (cycle 7)
robertfernandez-vast Jul 7, 2026
9b2f326
docs(sla): address doc-review consensus (cycle 8)
robertfernandez-vast Jul 7, 2026
c414979
docs(sla): address doc-review consensus (cycle 9)
robertfernandez-vast Jul 7, 2026
5f98819
docs(sla): address doc-review consensus (cycle 10)
robertfernandez-vast Jul 7, 2026
476bdbf
docs(sla): address doc-review consensus (cycle 11)
robertfernandez-vast Jul 7, 2026
38f063f
docs(sla): address doc-review consensus (cycle 12)
robertfernandez-vast Jul 7, 2026
e828ce0
docs(sla): regenerate openapi.yaml from source YAMLs
robertfernandez-vast Jul 7, 2026
f2930aa
docs(sla): align host/client guides to v5 claim model and SLA charge …
robertfernandez-vast Jul 24, 2026
1d24944
docs(sla): address doc-review consensus (cycle 1)
robertfernandez-vast Jul 24, 2026
2300591
docs(sla): address doc-review consensus (cycle 2)
robertfernandez-vast Jul 24, 2026
35e7f01
docs(sla): address doc-review consensus (cycle 3)
robertfernandez-vast Jul 24, 2026
2fc9831
docs(sla): address doc-review consensus (cycle 4)
robertfernandez-vast Jul 24, 2026
f31c033
docs(sla): address doc-review consensus (cycle 5)
robertfernandez-vast Jul 24, 2026
b609096
docs(sla): address doc-review consensus (cycle 6)
robertfernandez-vast Jul 24, 2026
4351fa2
docs(sla): address doc-review consensus (cycle 7)
robertfernandez-vast Jul 24, 2026
ff64958
docs(sla): address doc-review consensus (cycle 8)
robertfernandez-vast Jul 24, 2026
0d55c11
docs(sla): clarify hosts do not set beta; fix navbar FAQ URL
robertfernandez-vast Jul 27, 2026
7898ff3
docs(sla): address doc-review consensus (cycle 1)
robertfernandez-vast Jul 27, 2026
19f05ac
docs(sla): address doc-review consensus (cycle 2)
robertfernandez-vast Jul 27, 2026
cc3a93f
docs(sla): address doc-review consensus (cycle 3)
robertfernandez-vast Jul 27, 2026
406c496
docs(sla): fix weigh wording in sla_max_beta
robertfernandez-vast Jul 27, 2026
7a3534c
docs(sla): address doc-review consensus (cycle 4)
robertfernandez-vast Jul 27, 2026
e0ca362
docs(sla): address doc-review consensus (cycle 5)
robertfernandez-vast Jul 27, 2026
96b86de
docs(sla): address doc-review consensus (cycle 6)
robertfernandez-vast Jul 27, 2026
6d43287
docs(sla): address doc-review consensus (cycle 7)
robertfernandez-vast Jul 27, 2026
4876c76
docs(sla): address doc-review consensus (cycle 8)
robertfernandez-vast Jul 27, 2026
30f7f95
docs(sla): address doc-review consensus (cycle 9)
robertfernandez-vast Jul 27, 2026
5806400
docs(sla): address doc-review consensus (cycle 10)
robertfernandez-vast Jul 27, 2026
12acb2c
docs(sla): address doc-review consensus (cycle 11)
robertfernandez-vast Jul 27, 2026
e0aee51
docs(sla): address doc-review consensus (cycle 12)
robertfernandez-vast Jul 27, 2026
e8eb4a8
docs(sla): address doc-review consensus (cycle 13)
robertfernandez-vast Jul 27, 2026
47cde5f
docs(sla): use vastai in create-instance OpenAPI examples
robertfernandez-vast Jul 27, 2026
565a7b0
docs(sla): address doc-review consensus (cycle 14)
robertfernandez-vast Jul 27, 2026
5e43594
docs(sla): address doc-review consensus (cycle 15)
robertfernandez-vast Jul 27, 2026
f0c0975
docs(sla): fix create-instance example fences (cycle 15 follow-up)
robertfernandez-vast Jul 27, 2026
73c1583
docs(sla): address doc-review consensus (cycle 16)
robertfernandez-vast Jul 27, 2026
8abb9d2
fix(openapi): rebuild combined OpenAPI to sync CI
robertfernandez-vast Jul 28, 2026
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
615 changes: 553 additions & 62 deletions api-reference/openapi.yaml

Large diffs are not rendered by default.

32 changes: 26 additions & 6 deletions api-reference/openapi/yaml/create_instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ paths:

For detailed template usage, see [Creating and Using Templates with API](/api-reference/creating-and-using-templates-with-api).

CLI Usage: `vastai create instance <offer_id> <image> [options]`
**SLA note:** `target_reliability` is REST-only at rent time. The published CLI and SDK cannot pass this field until support ships. Use the web console or `PUT /api/v0/asks/{id}/` with `target_reliability` in the request body to enable SLA coverage — see [SLA Coverage](/guides/instances/choosing/sla-coverage).

CLI Usage: `vastai create instance <offer_id> --image <image> [options]` (no `target_reliability` flag today)
security:
- BearerAuth: []
tags:
Expand Down Expand Up @@ -61,8 +63,21 @@ paths:
disk:
type: number
format: float
minimum: 8
description: |
Size of local disk partition (in GB). Minimum 8 when specified.
target_reliability:
type: number
format: float
minimum: 0
exclusiveMaximum: true
description: |
Size of local disk partition (in GB)
Client SLA coverage target (greater than 0 and less than 1). When set on an SLA-enabled offer
(`sla_r_claim > 0`), locks SLA terms on the new contract. Omit or set to 0 for a non-SLA rental.
Use the same value you used in search when comparing `dph_total`.
Common failures: `invalid_args` when the offer has no SLA or the target is out of range;
`invalid_price` when the quote is stale relative to search (re-search with matching storage
and `target_reliability`, then rent again). See [SLA Coverage](/guides/instances/choosing/sla-coverage).
runtype:
type: string
description: |
Expand Down Expand Up @@ -162,6 +177,8 @@ paths:
description: Mount path for the volume inside the container (e.g., `/workspace`)
example:
image: vastai/base-image:@vastai-automatic-tag
disk: 50
target_reliability: 0.95
responses:
'200':
description: Instance created successfully
Expand All @@ -179,7 +196,10 @@ paths:
description: ID of the newly created instance contract
example: 1234568
'400':
description: Bad Request
description: |
Bad Request. Includes invalid or out-of-range `target_reliability`, renting with SLA on a non-SLA
offer, SSH key requirements, and `invalid_price` when the create request does not match a fresh
search quote (re-search with the same `target_reliability` and disk/storage, then retry).
content:
application/json:
schema:
Expand Down Expand Up @@ -323,6 +343,6 @@ x-cli-commands:
endpoint: /api/v0/asks/{id}/
method: PUT
examples:
- vast create instance 1234567 --image tensorflow/tensorflow:latest-gpu --disk 32
- vast create instance 1234567 --template abc123def456
- vast create instance 1234567 --price 0.4 --disk 100 --env JUPYTER_TOKEN=abc123
- vastai create instance 1234567 --image tensorflow/tensorflow:latest-gpu --disk 32
- vastai create instance 1234567 --template abc123def456
- vastai create instance 1234567 --price 0.4 --disk 100 --env JUPYTER_TOKEN=abc123
113 changes: 99 additions & 14 deletions api-reference/openapi/yaml/list_machine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ paths:
summary: list machine
description: |
Creates or updates ask contracts for a machine to list it for rent on the vast.ai platform.
Allows setting pricing, minimum GPU requirements, end date and discount rates.
Allows setting offer pricing, rental types, end dates, discount rates, and SLA parameters.

CLI Usage: `vastai list machine <machine_id> [options]`
SLA request-body fields (`sla_r_claim`, `sla_sigma_x`, optional `sla_max_beta`) are supported on this REST endpoint. SLA activates when `sla_r_claim > 0`. Host-sent `sla_r_target` / legacy `sla_reliability` are ignored — clients choose coverage at search/rent time. The published CLI and SDK do not yet expose SLA fields — use the host console (**Set Pricing → SLA**) or REST/`curl` until CLI/SDK support ships.

CLI Usage (non-SLA fields): `vastai list machine <machine_id> [options]`
security:
- BearerAuth: []
requestBody:
Expand Down Expand Up @@ -61,6 +63,39 @@ paths:
type: number
format: float
description: Maximum discount rate allowed for prepaid credits
sla_r_claim:
type: number
format: float
minimum: 0
maximum: 0.9999
description: |
Host reliability claim. Values above 0 enable SLA on the offer.
Must be greater than 0 and at most 0.9999 when enabling SLA; exactly 1.0 is rejected.
Set to 0 to disable SLA on new rentals.
sla_sigma_x:
type: number
format: float
description: |
Host confidence spread — how wide your belief is around the claim.
Must be greater than 0 and at most 3.0. Defaults to 0.5 when enabling SLA.
sla_max_beta:
type: number
format: float
description: |
Optional ask term capping how aggressively long-running contracts may weight recent
uptime versus longer history in settlement. Hosts do not set β — the platform derives
β from the client's target_reliability at rent. Leave unset for uncapped. When set,
must be in (0, 1) and at least the default beta derived at your claim.
sla_r_target:
type: number
format: float
description: |
Ignored on asks. Client coverage target is supplied at search/rent time
(`target_reliability`), not set by the host.
sla_reliability:
type: number
format: float
description: Legacy alias for sla_r_target; ignored on asks.
responses:
'200':
description: Successful response
Expand All @@ -71,15 +106,43 @@ paths:
properties:
success:
type: boolean
extended:
type: integer
description: Number of client contracts extended to new end date
msg:
type: string
description: Status message if success is false
you_sent:
type: object
description: Echo of the request body
results:
type: array
items:
type: object
properties:
machine_id:
type: integer
user_id:
type: integer
extended:
type: integer
description: Number of rental contracts extended
new_contracts:
type: array
items:
type: integer
description: IDs of newly created contracts
upd_contracts:
type: array
items:
type: integer
description: IDs of updated contracts
example:
success: true
extended: 2
you_sent:
machine: 12345
sla_r_claim: 0.99
sla_sigma_x: 0.5
results:
- machine_id: 12345
user_id: 67890
extended: 1
new_contracts: []
upd_contracts: [1]
'400':
description: Bad Request
content:
Expand All @@ -89,23 +152,45 @@ paths:
properties:
error:
type: string
example: invalid_args
enum:
- invalid_args
- invalid_sla_params
- sla_not_approved
- sla_daemon_outdated
example: invalid_sla_params
msg:
type: string
example: No such machine(s) for your account
'401':
description: Unauthorized — missing permission or invalid API key
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
example: false
error:
type: string
msg:
type: string
example: Invalid machine id or parameters
example: Your key lacks the machine_write permission group
'403':
description: Forbidden
description: Forbidden — machine locked
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: not_authorized
enum:
- machine_locked
example: machine_locked
msg:
type: string
example: Only machine owner can create ask contracts
example: Machine is decommissioned or migration-locked
tags:
- Machines
components:
Expand Down
11 changes: 7 additions & 4 deletions api-reference/openapi/yaml/schedule_maint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ paths:
sdate:
type: string
format: date-time
description: Start date and time of the maintenance window.
example: '2023-10-30T14:00:00Z'
description: |
Start date and time of the maintenance window as an ISO 8601 UTC datetime
(for example `2026-08-01T02:00:00Z`). The CLI `--sdate` flag accepts Unix epoch seconds
and converts them to this format before calling the API.
example: '2026-08-01T02:00:00Z'
duration:
type: integer
description: Duration of the maintenance window in hours.
Expand Down Expand Up @@ -128,5 +131,5 @@ x-cli-commands:
description: Schedule maintenance for a machine.
endpoint: /api/v0/machines/{machine_id}/dnotify
method: PUT
example: vast-ai schedule maint 12345 --sdate "2023-10-30T14:00:00Z" --duration
2
example: vastai schedule maint 12345 --sdate 1698674400 --duration 2
--maintenance_category software
26 changes: 23 additions & 3 deletions api-reference/openapi/yaml/search_offers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,25 @@ paths:
example: ["RTX_3090", "RTX_4090"]
reliability:
type: object
description: 'Machine reliability score (0-1). Example: {"gte": 0.99}'
description: 'Historical machine reliability score (0-1), not the host SLA claim. Example: {"gte": 0.99}'
target_reliability:
type: object
description: |
Client SLA coverage target. Value must be greater than 0 and less than 1 (exclusive bounds —
same as create-instance). When set, search prices include the SLA charge in dph_total and
returns search.slaPremiumPerHour. Pass the same target again on PUT /api/v0/asks/{id}/ to
enable coverage. Example: {"eq": 0.95}
has_sla:
type: object
description: |
Restrict to offers with SLA enabled (true) or without (false). Example: {"eq": true}
properties:
eq:
type: boolean
expected_reliability:
type: object
description: |
Host SLA claim on the offer (0-1). Example: {"gte": 0.99}
num_gpus:
type: object
description: 'Number of GPUs. Example: {"gte": 4} or {"in": [1, 2, 4, 8]}'
Expand Down Expand Up @@ -266,7 +284,7 @@ paths:
Default is 8GB.
example:
limit: 100
type: on-demand
type: ondemand
verified:
eq: true
rentable:
Expand Down Expand Up @@ -362,7 +380,7 @@ paths:
vram_costperhour: 0.009876
webpage: null
vms_enabled: false
expected_reliability: 0.5
expected_reliability: 0.99
is_vm_deverified: false
resource_type: "gpu"
cluster_id: null
Expand All @@ -381,12 +399,14 @@ paths:
search:
gpuCostPerHour: 0.123456
diskHour: 0.123456
slaPremiumPerHour: 0.008
totalHour: 0.234567
discountTotalHour: 0.01
discountedTotalPerHour: 0.224567
instance:
gpuCostPerHour: 0.01
diskHour: 0.02
slaPremiumPerHour: 0.008
totalHour: 0.03
discountTotalHour: 0.001
discountedTotalPerHour: 0.029
Expand Down
19 changes: 17 additions & 2 deletions api-reference/openapi/yaml/show_earnings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ paths:
description: |
Retrieves the earnings history for a specified time range and optionally per machine.

**Note:** `per_day[]` aggregates SLA earnings across your entire fleet for each UTC day, even when `machid` is set. For machine-scoped SLA totals, use `per_machine[].sla_earn`.

CLI Usage: `vastai show earnings [options]`
security:
- BearerAuth: []
Expand All @@ -28,12 +30,16 @@ paths:
in: query
schema:
type: integer
description: Start day for the earnings report.
description: |
Start day for the earnings report as a UTC day index:
`floor(unix_epoch_seconds / 86400)`. Prefer `last_days` when you do not need an absolute window.
- name: eday
in: query
schema:
type: integer
description: End day for the earnings report.
description: |
End day for the earnings report as a UTC day index:
`floor(unix_epoch_seconds / 86400)` (inclusive end of the window when used with `sday`).
- name: machid
in: query
schema:
Expand Down Expand Up @@ -63,6 +69,9 @@ paths:
type: number
total_bwd:
type: number
total_sla:
type: number
description: Net SLA earnings over the requested window.
username:
type: string
email:
Expand Down Expand Up @@ -107,6 +116,9 @@ paths:
type: number
bwd_earn:
type: number
sla_earn:
type: number
description: Net SLA earnings for this machine over the window.
per_day:
type: array
items:
Expand All @@ -122,6 +134,9 @@ paths:
type: number
bwd_earn:
type: number
sla_earn:
type: number
description: Net host SLA settlement for the UTC day. Positive when the host keeps the SLA charge; negative when the host credits the client.
'400':
description: Bad Request - Invalid input syntax
content:
Expand Down
Loading
Loading