API reference
Rent GPU and CPU machines, and manage the machines you rent out, from your own code.
Basics
- Base URL
https://suanzu.ai- OpenAPI file
- /openapi.yaml
- For AI tools
- /llms.txt
Authentication
Create an API key in the console (Console → API keys) and send it on every request: Authorization: Bearer sz_live_.... Only this header is accepted; keys in the query string are ignored. Market endpoints also work without a key.
A key has one or more scopes:
| Scope | Allows |
|---|---|
renter:read | Read your instances, balance, ledger, rent-balance deposits, compute task templates, instance tasks, tags, wallets and variables. |
renter:write | renter:read + rent, stop, change startup command, restart the container, get connection details, manage compute task templates, instance tasks, tags, wallets and variables. |
host:read | Read your machines, GPUs, messages, command results and progress, installable driver versions, tags, templates (and which machines use them), wallets and variables, history charts, fault history, groups, earnings, account, billing (also per day) and service-fee deposits. |
host:write | host:read + set prices (directly or from a template), list / unlist, rename, tag, set compute tasks, overclocking and auto-fan, manage templates (price, compute task, overclocking, auto-fan), tags, wallets and variables, pause / resume / restart compute tasks, fetch task logs. |
host:exec | host:write + reboot machines, upgrade the Agent, install NVIDIA drivers, open remote access (root shell on the machine) and change its password. |
A key can be limited to some device groups and to an IP allowlist. A key without an allowlist works from any IP; with one, requests from other IPs get 403 api_key_ip_denied. Machines and groups outside the key's range behave as if they did not exist (404, or missing from lists). On groups shared with you by another account, your role in that group still applies, and the owner must allow API access for you. A key limited to device groups cannot change account-wide settings: account-wide templates (group_id: null), account-wide wallets and variables, and your tag library (403 group_forbidden); it can still read them and use them on its groups.
Keys see only your own account's money. Balances, ledgers, billing and earnings are always your own account's. On groups shared with you by another account, a key never sees the owner's earnings, whatever your role: earnings fields are null (summary.earnings, groups.<id>.earnings), rental history has show_income: false, and GET /api/v1/host/earnings / earnings/leases with such a group return 404 group_not_found. Machine and status data in those groups is still returned by your role.
Multi-machine writes must stay in one group. With an API key, a host request that names several machines (price, price-template, listing, listing/precheck, tags, tasks/apply, tasks/restart, tasks/redownload, tasks/pause, tasks/resume, oc-template, oc/reapply, autofan-template, commands/reboot, commands/upgrade) must only name machines in the same device group; otherwise the whole request is rejected with 400 cross_group and nothing is done. Ungrouped machines count as one group. Machines you cannot see do not count (they fail one by one with machine_not_found).
Conventions
- Amounts are decimal strings in USDT (for example
"0.053"), never JSON numbers. - Times are UNIX seconds (integers).
- IDs in responses are strings. Integer IDs (leases, ledger rows) are decimal strings, for example
"57". - Errors always look like
{"ok": false, "code": "...", "error": "..."}. Branch oncode;erroris English text for humans and may change. - Every endpoint below can also return 500
internal; it is not listed on each endpoint. - Unknown query parameters, a query parameter sent twice, unknown body fields and out-of-range values are rejected with 400
bad_requeston every endpoint;errornames the parameter. (Onlygpuandcpuof the market list may be repeated.) A body over the size limit gets 413body_too_large. - A request that runs too long (5 seconds for GET, 30 seconds for other methods) gets 503
request_timeout. For a write this means the result is unknown: read the current state before you send it again. - A 200 on a write means the change is saved. Most settings then reach the machine with its next heartbeat. When you need to know that the machine actually applied something (a rental, a command, overclocking, compute tasks), poll the field named in "Async operations and polling" below.
- GPU model names: market endpoints use short names (
CMP 50HX,RTX 4090: the prefixesNVIDIA,GeForceandTeslaremoved). Host endpoints use the full name the driver reports (NVIDIA CMP 50HX,NVIDIA GeForce RTX 4090) ingpus[].name, thegpufilter,gpu_countsand/host/gpus. Price templateprices.gpukeys and overclocking templatemodelskeys use the GPU model name:show_namewhen the GPU has one (for exampleCMP 170HX, which the driver reports asGraphics Device), otherwisename. A generic driver name (Graphics Device,NVIDIA Graphics Device) is not accepted as a template key (400template_invalid).
Pagination
| Style | Endpoints | Next page |
|---|---|---|
cursor + pageSize (default 50, values above 200 count as 200) | GET /api/v1/market/machines | Pass next as cursor with the same filters and sort; next is empty on the last page |
page + per_page | Instances (default 50, history 20, max 1000), instance charges (default 20, max 50), host machines, machine messages and GPUs (default 50, max 1000) | page + 1 until page = total_pages. A page past the end returns the last page (machines, instances) or an empty list (charges) |
page + page_size (default 20, max 100) | Renter ledger, deposits, host ledger, earnings leases | page + 1 until you have total items |
before + limit (default 20, max 100) | GET /api/v1/host/machines/{machine_id}/leases | Pass next_before as before; null on the last page |
limit only (default 10, max 200) | GET /api/v1/host/machines/{machine_id}/timeline | No next page: ask for a larger limit. Only the newest 200 items can be read |
GET /api/v1/account/deposits/pending is not paged (at most 50 items, newest first).
Rate limits
Each key has a per-minute budget for each rate-limit class (see x-rate-limit-class on every endpoint). Over the limit you get 429 rate_limited with a Retry-After header (seconds).
| Class | Requests per minute per key | Used by |
|---|---|---|
read | 120 | Market, host machine list / detail / tasks, GPUs, tags, preset images |
read_pg | 30 | Balances, ledgers, earnings, billing, instance list, checks, groups, precheck, command timeline and progress, driver versions, messages, templates, wallets and variables, history charts, fault history |
write | 30 | Writes: stop, prices, listing, names, tags, templates, task settings and control, task logs, overclocking, auto-fan, wallets and variables, reboot, Agent upgrade, driver install, remote open / close / password |
order | 10 | Rent a machine |
remote | 20 | Fetch connection details with passwords |
read_pg and market requests also share a small server-wide concurrency pool; when it is busy you can get 429 rate_limited with Retry-After: 1 even under your per-minute budget. Limits may change before release.
Key errors
Any request that carries an API key can fail before the endpoint runs: 401 api_key_invalid, 401 api_key_expired (create a new key), 403 api_key_route_not_allowed (this endpoint is not open to API keys), 403 api_key_scope_denied, 403 api_key_ip_denied, 429 rate_limited. A request without a key to an endpoint that needs one gets 401 unauthorized.
Async operations and polling
Machines report a heartbeat about every 15 seconds. A machine is online while its last heartbeat (last_heartbeat_at) is at most 120 seconds old; after that connectivity is offline, status_reasons has offline and the live values are null. Commands and settings normally reach a machine with its next heartbeat; while someone is viewing the machine or its group (the machine list with group, or the machine detail) it is woken within about a second.
| Operation | Poll | Until | Interval | Typical / limit | On failure |
|---|---|---|---|---|---|
| Rent delivery | GET /api/v1/renter/leases (tab=current) | phase is running (pulling → preparing → starting → running) | 10 s | Image pull may take up to 1800 s after the order; preparing and starting together up to 300 s after the pull | The instance leaves the current tab and shows up in tab=history with end_reason: delivery_failed and a fail_code. Nothing is charged. retry_code (during delivery) names a step that failed once and is being retried |
| Stop an instance | GET /api/v1/renter/leases (tab=history) | phase is released | 15 s | At least two machine rounds (about 30 s). No time limit: an offline machine stays stopping until it comes back | Billing ends when you stop, whatever the phase. stopping only means the machine has not confirmed the cleanup yet |
| Startup command | GET /api/v1/renter/leases | startup.rev equals the returned startup_rev and startup.state is not pending | 10 s | Next heartbeat | startup.state: failed or exited with exit_code; read GET .../container-log |
Commands (reboot, upgrade, task_restart, task_logs) | GET /api/v1/host/machines/{machine_id}/timeline | The item with your cmd_id has state ok or error | 10-15 s | Picked up with the next heartbeat (about 15-20 s). An offline machine must come back and start it within 600 s (expire_at) | state: error with note (see the dictionary below); the reason is in latest_title, logs in GET .../messages (payload_gz) |
| Reboot | Same as commands | state: ok, note: rebooted | 15 s | Done when the machine is back online with a newer boot_time | note: timeout when it is not back within 600 s after the reboot started |
| Agent upgrade | Timeline, then GET /api/v1/host/machines/{machine_id} | state: ok, then agent_version shows the new version (next heartbeat after the install) | 15 s | Mostly download time; the download alone may take up to 1800 s | state: error with the reason in latest_title (for example Upgrade failed (exit 1)), or note: timeout when no result arrives by expire_at + 1800 s, or interrupted when the machine rebooted meanwhile |
| Driver install | Timeline; progress in GET /api/v1/host/machines/{machine_id}/commands/{cmd_id}/progress | state: ok, note: rebooted (back online with the new driver_version) | 15 s (progress 5 s) | Download plus install, then one reboot. Limit: 120 min from the start to the reboot, 10 min to come back | state: error, the code in brackets in latest_title ([driver_download_failed], [driver_install_timeout], [driver_reboot_timeout], [driver_version_mismatch], …). Before the reboot the old driver stays; [driver_reboot_required] = the driver was installed but the time limit passed before the reboot, reboot the machine yourself |
| Overclocking | GET /api/v1/host/machines/{machine_id} | oc.applied_revision equals oc.revision. The single-machine calls (/machines/{machine_id}/oc…, /machines/{machine_id}/autofan) return that revision; the batch calls (/machines/oc-template, /machines/oc/reapply, /machines/autofan-template) return only results[], so read oc.revision after the call | 15 s | One or two heartbeats after the save. With deferred: rented only after the rental ends; with deferred: offline when the machine is back | oc.rejected (the whole config was refused), oc.result[].results[].code other than ok / unchanged, oc.verify_error. applied_revision null = the machine never reported |
| Compute tasks | GET /api/v1/host/machines/{machine_id}/tasks (renter: GET .../leases/{lease_id}/tasks) | The states[] item with your binding_id has state: running and its revision equals the task's revision | 15 s | Next heartbeat plus the download of the program package | state retrying, gpu_missing, unsupported, held; exits_1h ≥ 3 means it keeps crashing. Read the task log (renter: GET .../tasks/{binding_id}/log) and latest |
| Task stats (hash rate) | Same | stats_at is set and stats[] has your binding_id | 30 s | Usually 15-35 s after the task reaches running. HiveOS tasks (kind: hive) only; custom tasks report no stats | No stats while the task is not running; they disappear 1200 s after the machine stops reporting them |
syncing: true on the task endpoints means the task list is still being written; read again after a few seconds. Stats and states belong to the task list the machine reported last: after a change, wait until states[] shows the new revision.
Status and code dictionary
Machine status (host endpoints; the "status" filter uses the same values):
status | Meaning | What you can do | What the platform does |
|---|---|---|---|
unpriced | No price set, not listed, no problem | Set a price, then list | Nothing |
unlisted | Priced but not listed, no problem | List it | Nothing |
available | Listed and rentable | Rent-related changes apply to new rentals | Shows it on the market |
noncompliant | Not listed, and it has a problem (status_reasons) | Fix the problem; listing fails with not_eligible | Nothing |
fault | Listed, but it has a problem (status_reasons, offline included) | Fix it; it comes back by itself | Hides it from the market until the problem is gone (you keep the listing) |
rented | Has a rental that is not released yet (delivery and stopping included) | See "Rented machines" below | Stops the rental for problems marked stop |
status_reasons codes. Columns: what happens when the problem shows up before listing / while listed / while rented. reject = listing or renting is refused; hide = hidden from the market (fault); refresh = the listed specs are updated, still rentable; stop = the rental is stopped and the machine unlisted; notice = you are only notified; - = not checked in that state. GET .../checks shows the same as outcome.
| Code | Meaning | Not listed | Listed | Rented |
|---|---|---|---|---|
offline | No heartbeat for 120 s | reject | hide | notice |
offline_rented | Rented machine offline for 600 s (billing stops at the last heartbeat) | - | - | stop |
price_unset | Listed without a price for its unit | reject | - | - |
group_invalid | Its device group was deleted | reject | hide | notice |
gpu_dropped | A GPU is not seen by the driver | reject | hide | stop |
gpu_driver | The driver cannot read a GPU | reject | hide | stop |
gpu_ecc_uncorrected | Uncorrected ECC errors | reject | hide | stop |
gpu_probe_failed | GPU data could not be read (2 rounds in a row) | reject | hide | stop |
gpu_count_low | Fewer GPUs than listed (or than expected_gpu_count) | reject | hide | stop |
gpu_mixed | More than one GPU model | reject | hide | notice |
gpu_changed | GPU model or memory changed since listing | - | hide | stop |
driver_changed | Driver or CUDA version changed since listing | - | hide | stop |
cpu_changed | CPU model or socket count changed | - | hide | stop |
ram_low | Less memory than listed | - | hide | stop |
ram_more | More memory than listed | - | refresh | - |
disk_changed | Disk size changed by more than 1%, or disk type changed | - | hide | stop |
os_changed | OS or kernel changed | - | refresh | stop |
pcie_degraded | A GPU runs at a lower PCIe generation or width than listed | - | refresh | stop |
pcie_changed | PCIe link changed, none lower | - | refresh | notice |
pcie_unstable | PCIe link changed 3 or more times in 24 hours | reject | hide | notice |
docker_down | Docker is not installed or not running | reject | hide | stop |
nvidia_runtime_missing | NVIDIA GPUs but no NVIDIA container runtime | reject | hide | stop |
runc_outdated | runc older than 1.2.8 or unknown | reject | hide | stop |
nvidia_toolkit_outdated | NVIDIA GPUs with an NVIDIA Container Toolkit older than 1.19.1 or unknown | reject | hide | notice |
disk_low | Less than 5 GiB free on the system disk | reject | hide | notice |
collect_invalid | CPU, memory or disk data cannot be read | reject | hide | notice |
rent_env_unsupported | Not a physical machine or VM (container, WSL) | reject | hide | notice |
agent_outdated | Agent older than 1.2.0 | reject | hide | notice |
tools_missing | The Agent tool package is still downloading | reject | hide | notice |
identity_conflict | Two machines report with the same identity | reject | hide | notice |
owner_inactive | The owner account has stopped renting out | reject | hide | notice |
data_invalid | The machine's data is broken | reject | hide | notice |
oc_rental_tampered | Overclocking was changed by something else during a rental | - | - | stop |
rent_container_lost | The renter's container is gone | - | - | stop |
rent_isolation_failed | Network isolation of the rental cannot be checked or restored | - | - | stop |
A code not in this table is handled as hide. CheckRow.result: pass, fail, na (not applicable now), pending (changed this round, confirmed on the next one). CheckRow.outcome is set on every row and says what happens if the rule fails in the machine's current state (null = nothing). The action of GET .../checks is ok, hide or stop.
Instance phase: pulling (downloading the image; progress 0-99), preparing (GPU and overclocking checks), starting (container starting), running (billed), stopping (ended, waiting for the machine to clean up), released (cleaned up). Only running can be used; stopping is allowed in every phase before stopping.
end_reason: renter (you stopped it; cancelled during delivery has fail_code: renter_cancel, not charged), balance_exhausted (your balance could not pay the next minute), offline_rented (the machine was offline for 600 s), verdict (a hardware or driver problem marked stop above), admin (stopped by the platform), delivery_failed (see fail_code).
fail_code: set by the platform: pull_timeout, prepare_timeout, start_timeout, oc_failed, gpu_busy (the host was using the machine; it is unlisted), agent_outdated, renter_cancel; reported by the machine: pull_failed, disk_insufficient, image_too_large, image_no_shell, start_failed, gpu_mismatch, network_isolation_failed, rent_job_failed. Other lowercase codes may appear.
Command state / note (timeline): pending (not started yet), running (started, no result yet), ok, error. note on finished commands: rebooted (reboot done), powered_off, expired (never started within 600 s), timeout (started, no result in time), interrupted (the machine rebooted while it ran), not_delivered (never sent, safe to send again), rebooted_no_gpu / rebooted_gpu_unreadable (driver install done but the machine has no NVIDIA GPU / no GPU can be read, so the version was not checked); null otherwise, also for an error reported by the machine (the reason is in latest_title).
Compute task state (states[].state): running (the program runs), preparing (downloading or starting), retrying (the program exited or preparing failed; it is restarted with back-off up to 60 s), gpu_missing (its GPUs are gone), paused, held (held on the machine itself, for example while GPUs initialize after boot or a driver is installed; see reason), overheat (stopped by fan control), yielded (the machine is rented, host tasks give way), unsupported (the machine lacks a tool, missing), stopped (removed). A task runs when state is running and its revision equals the task's revision. started_at is when the current run started; exits_1h counts exits in the last hour.
Retries and batch operations
| Kind | Endpoints | On timeout or 5xx |
|---|---|---|
| Safe to repeat (same body, same result) | Prices, applying price templates, changing templates and tags (PUT / PATCH), listing, precheck, tags, PUT .../tasks, tasks/apply (replace, clear; add skips tasks already there), task pause / resume, oc/manual-only, rename, wallets / variables PUT, PUT .../startup, stop an instance, rent with the same Idempotency-Key | Send it again |
| Repeat with care | PUT .../oc, oc-template, oc/reapply, PUT .../autofan, autofan-template | Each call raises revision and makes the machine apply the values again (same values, no harm). Read oc.revision first |
| Do not repeat blindly | commands/reboot, commands/upgrade, commands/driver_install, commands/task_restart, commands/task_logs, tasks/restart, tasks/redownload, startup/restart, rebuild, renter task restart / reinstall, password changes, creating templates, wallets / variables or tags | Read the result first: commands in the timeline (your cmd_id, or the newest item of that type with issued_by_mine), the rest in the matching list. 503 command_push_failed is the exception: nothing was sent, send again |
- 429
rate_limited: waitRetry-Afterseconds (the start of the next minute for the per-minute budget, 1 s when the shared pool is busy), plus a random 0-1000 ms so parallel workers do not retry together. - 503
device_index_rebuildingorrequest_timeouton a read: back off 2, 4, 8, 16 s and give up after 5 tries. 503request_timeouton a write: read the state first (see above). - Rent with a new
Idempotency-Keyfor each order and reuse it when you retry that order: the key is kept for good, the same key with the same body returns the same order, a different body 422idempotency_mismatch. - Multi-machine writes with an API key: split
machine_idsbygroup_id(fromGET /api/v1/host/machines) and send one request per group; otherwise the request fails with 400cross_group. Per request at most: 500 machines forprice,price-template,listing,listing/precheck,tasks/apply,tasks/restart,tasks/redownload,tasks/pause,tasks/resume,oc-template,oc/reapply,autofan-template; 1000 fortags; 100 (after removing duplicates) forcommands/rebootandcommands/upgrade; exactly 1 forcommands/task_restart,commands/task_logsandcommands/driver_install. Results are per machine: always checkresults[](orrejected[]), a 200 does not mean every machine was done. - Only one big command (reboot, shutdown, Agent upgrade, network change, driver install) can be open per machine; another is rejected with
command_pendinguntil the first one ends. Compute-task commands are not blocked by it and do not block it.
Business rules
- Prices and commission. The price a host sets (
price_per_gpu_hr/price_per_cpu_hr) is what the host earns. The market and renters see that price plus the platform commission: unit price × (1 + commission), rounded up to 3 decimal places, times the GPU (or CPU socket) count. The commission rate is set by the platform. Both prices are fixed when an order is placed; later price changes apply to new rentals only. - Billing. Rent is charged every minute from when the image is ready (
billing_from) until you stop, only for time the machine is online, rounded up to the cent on the running total. Ordering needs at least one hour of rent in your balance. There is no grace period: when your balance cannot pay the next minute, all your instances are stopped withend_reason: balance_exhausted(you are notified when less than 120 and 30 minutes are left). - No rental duration. An order has no duration; an instance runs until you stop it (
POST .../stop), your balance runs out, or the platform stops it. Stop it from your code when you are done. - Deposits. The API cannot create deposit addresses or move money; deposit in the console. Use
GET /api/v1/account/deposits/pendingto see an incoming deposit andGET /api/v1/account/deposits/GET /api/v1/renter/accountto see it credited. Withdrawals and balance transfers are not available to API keys. - Agent version. The current stable Agent version is the plain text at
https://down.suanzu.ai/VERSION(public, no key), alwaysMAJOR.MINOR.PATCH.commands/upgradebrings a machine to that version. A machine already on it or on a newer release is not changed (Already up to date), but a machine on a beta (-beta.N) is moved to the stable version even when the beta is newer (1.5.8-beta.2becomes1.5.7). So send it only to machines whoseagent_versionis lower than the stable version. Compare as semantic versions:MAJOR,MINORandPATCHone by one as numbers; a-beta.Nversion is below the same version without it and above the release before it (1.5.7<1.5.8-beta.2<1.5.8).agent_versionnull = not reported yet. - Host service fees. Your host account is overdue when
earn_balanceis below 0. Service-fee credit and gift credit pay service fees first, and new deposits, transfers received and gifts are applied to the debt automatically. While overdue,GET /api/v1/host/accounthasoverdue_sinceandfreeze_at(=overdue_since+ 3 days). If it is still overdue then, the account is restricted (restricted: true): compute task, overclocking and wallet / variable changes fail withaccount_overdue_restricteduntil you top up. - Rented machines. While a machine has a rental (
status: rented, delivery and stopping included):commands/reboot,commands/upgrade,commands/driver_install,commands/task_restart,commands/task_logs,tasks/restart,tasks/redownload, opening remote access,oc/reapplyand resuming host tasks (one task ortasks/resume) are rejected withrented; overclocking, overclocking templates, auto-fan andoc/manual-onlyare saved and applied after the rental ends (deferred: rented); host compute tasks can be changed but give way to the renter (state: yielded); prices can be changed (the running rental keeps its price); unlisting is allowed and does not stop the rental.
Compute task templates
A template is custom (your own start command) or hive (a HiveOS custom miner package). Host tasks run on the machine; renter tasks run inside the instance.
- Custom tasks.
custom.start_command(required, at most 16 KiB) runs withbash -c. Withcustom.package_urlthe file is downloaded first:.tar.gz,.tgz,.tar.xzand.tarare unpacked into the working directory whenextractis true (the default); other files (.zipincluded) are saved there unchanged and made executable. When the program exits it is started again after 3 to 60 s; the wait resets once it has run for 300 s. - Variables (
vars, custom tasks only). Each item becomes an environment variable of the program; the value is passed as it is (no shell expansion). At most 64.keymatches^[A-Za-z_][A-Za-z0-9_]*$, does not start withSUANZU_and is none ofCUDA_DEVICE_ORDER,CUDA_VISIBLE_DEVICES,NVIDIA_VISIBLE_DEVICES,BASH_ENV,ENV,PATH.valueis required (it may be empty), at most 4 KiB. A HiveOS template withvarsfails with 400hive_vars_unsupported. - Values from your wallets / variables. Set
refto theidof one of your wallets / variables and sendvalue: "": the value is always replaced with the current value of that wallet / variable, and changing that value restarts the tasks that use it. Anidthat is not yours fails with 400wallet_var_unavailable. For HiveOS,wallet_refdoes the same forhive.wallet(sendwallet: ""). - Set for the program.
SUANZU_TASK_ID,SUANZU_TASK_DIR,SUANZU_WORKER_NAME,SUANZU_GPU_BUSIDS(the task's GPU bus IDs, comma-separated) andCUDA_DEVICE_ORDER=PCI_BUS_ID. When the task uses only some GPUs,CUDA_VISIBLE_DEVICESandNVIDIA_VISIBLE_DEVICEShold their UUIDs. CPU tasks (gpus: []) getSUANZU_TASK_CPU=1and no GPU. - HiveOS fields.
install_urlmust be an http(s) link to a.tar.gz/.tgzpackage with<miner>/h-manifest.confand<miner>/h-run.sh. Leaveminerempty to take it from the file name: drop the extension, then keep what comes before the last-(pearlfortune-1.2.3.tar.gzgivespearlfortune).coinandalgoreach the package asDIGITAL_CASHandCUSTOM_ALGO. Intemplate,url,passanduser_configthe macros%WAL%(the wallet),%WORKER_NAME%,%URL%,%URL_HOST%and%URL_PORT%(from the first address inurl) are replaced; any other%...%is left as it is.%WAL%with an empty wallet and nowallet_reffails with 400hive_wallet_required. - Follow the latest version. When the download link (
hive.install_url/custom.package_url) is a GitHub release file with a version tag, setfollowtolatest(stable releases) orlatest_beta(pre-releases too). When a newer release comes out, SuanZu switches the template's download link to it (with download acceleration on, once the cache is ready, at the latest 1 hour after the release) and sends thetpl.auto_updatednotification. Templates return the version in use ascurrent_tag. - Is it running? A task runs when its
states[]item hasstate: runningand the samerevisionas the task. Only HiveOS tasks report stats (TaskStats, from the package'sh-stats.sh).
{
"ok": false,
"code": "balance_too_low",
"error": "balance is below one hour of rent"
}Common flows
Rent a machine, connect to it, stop it
- 1.GETGet filter values for the market list
Optional. Get the GPU and CPU model names you can filter by.
- 2.GETList machines available for rent
Find a machine. Keep its
machine_idanddevice_no. - 3.GETList preset images
Pick a preset
image_id, or use your own public image. - 4.POSTRent a machine
Rent it with a new
Idempotency-Key. Your balance must cover at least one hour of rent. Keep the returnedid. - 5.GETList your instances
Poll until the instance's
phaseisrunning. - 6.GETGet SSH connection details for an instance
Get the SSH command and password. Treat them as a secret.
- 7.POSTStop an instance
Stop the instance when you are done. Rent is settled up to now.
Price your machines and list them on the market
- 1.GETList your machines
Find the
machine_idof your machines (usegroupto stay in one device group). - 2.POSTSet or clear rent prices
Set
price_per_gpu_hr(GPU machines) orprice_per_cpu_hr(CPU-only machines). - 3.POSTCheck whether machines can be listed
See which machines can be listed;
reasonslists the problems. - 4.GETCheck a machine against the listing rules
Optional. Per-rule details for a machine that failed the check.
- 5.POSTList or unlist machines on the market
Send
listed: trueto put the machines on the market.
Change the startup command, or run it again
- 1.PUTChange the startup command
Save the new command. Saving the same command again does nothing, so you can safely retry this call.
- 2.POSTRestart the container
To run the same command again, restart the container instead. Each call restarts it once, so do not retry automatically.
- 3.GETList your instances
Poll until
startup.revequals the returnedstartup_revandstartup.stateis no longerpending.
Set overclocking on one machine
- 1.GETGet one of your machines
Read
gpus[].busidand the currentoc(revision,cards). - 2.PUTSet overclocking values on one machine
Send all 6 values for each GPU to change. On 409
oc_task_managed, send again withmanual_only: true. - 3.GETGet one of your machines
Poll until
oc.applied_revisionequals the returnedrevision; checkoc.rejectedandoc.resultfor failures.
Upgrade the Agent and track it
- 1.GETList your machines
Find the machines whose
agent_versionis lower than the stable version athttps://down.suanzu.ai/VERSION(see Agent version under Business rules; a newer beta would be moved back to the stable version). Split themachine_idvalues bygroup_id, at most 100 per request. - 2.POSTUpgrade the Agent on machines
Send one request per group. Keep
issued[].cmd_id;rejected[].reasonlists the machines that got no command (for examplerented,command_pending). - 3.GETList the commands and messages of a machine
Poll every 15 s until the item with your
cmd_idhasstateokorerror. Witherror, the reason is inlatest_titleandnote(expired,timeout,interrupted). - 4.GETList the messages of a machine
Optional. For a failed upgrade, read the install log in
payload_gz. - 5.GETList your machines
After
ok,agent_versionshows the new version from the next heartbeat on.
Reboot machines and confirm they are back
- 1.GETList your machines
Find the machines, for example
reason=gpu_dropped. Split them bygroup_id, at most 100 per request. - 2.POSTReboot machines
Keep
issued[].cmd_id. Rented machines are rejected withrented(unlisting withPOST /api/v1/host/machines/listingdoes not end a rental). - 3.GETList the commands and messages of a machine
Poll every 15 s until the item with your
cmd_idhasstate: okandnote: rebooted(the machine is back online and has booted again).note: timeout= not back within 600 s. - 4.GETGet one of your machines
Check that the problem is gone, for example
gpus[].droppedandstatus_reasons.
Watch for offline machines
- 1.GETGet machine totals, overall and per group
Every 5 minutes, read
offlineinalland in each ofgroups. Stop here when it is 0. - 2.GETList your machines
List them with
connectivity=offlineandper_page=1000, followingpageup tototal_pages.last_heartbeat_atsays since when; a machine counts as offline 120 s after its last heartbeat. Rented machines that stay offline for 600 s lose their rental. - 3.GETList the commands and messages of a machine
Optional. Read the newest messages of a machine before it went offline.
List machines across several groups
- 1.GETList your device groups
Get the
idof every group the key can use (yours and those shared with you,shared: true). - 2.GETList your machines
Without
groupyou get every machine the key can see in one list. Withgroup, one request per group; followpageup tototal_pages(per_pageat most 1000). - 3.GETGet machine totals, overall and per group
Optional. Totals per group in one call.
Run a renter task that uses a saved wallet
- 1.POSTSave a wallet or variable
Save the wallet address. Keep
wallet_var.id. - 2.POSTCreate a compute task template
Custom task: add a
varsitem withrefset to thatidandvalue: "". HiveOS task: setwallet_refto thatidandhive.walletto"". Keeptemplate.id. - 3.PUTSet the compute tasks of an instance
Put the template on a
runninginstance. - 4.GETGet the compute tasks of an instance
Poll every 15 s until
states[]has yourbinding_idwithstate: runningand the samerevision. HiveOS tasks then reportstats(hash rate inparams.khs). - 5.PUTChange a wallet or variable
Optional. Changing the value restarts every task that uses it.
Fetch the log of a compute task
- 1.GETList the compute tasks of a machine
Find the task's
binding_id. - 2.POSTFetch the log of a compute task
Send the command for that one machine and task. Keep
issued[0].cmd_id; arejected[].reason(for examplerented,task_not_found) means no command was sent. - 3.GETList the messages of one command
Poll every 10 s until there is an
okorerrormessage. The log is thepayload_gzof theokmessage (gzip + base64, last 500 lines).
Install or change the NVIDIA driver on one machine
- 1.POSTList or unlist machines on the market
If the machine is listed, send
listed: falsefirst (a rented machine cannot install a driver). - 2.GETList the NVIDIA driver versions a machine can install
Pick a
versionfromoptions; a 409codesays why the machine cannot install now. Usecuda: falsewhencuda_blockis not null. - 3.POSTInstall or change the NVIDIA driver on a machine
Send it for that one machine. Keep
issued[0].cmd_id; arejected[].reasonmeans no command was sent. Do not retry blindly. - 4.GETGet the progress and log of a long command
Optional. Every 5 s while it runs, read the stage, download percent and the new log with
offset=next_offset. - 5.GETList the commands and messages of a machine
Poll every 15 s until your
cmd_idhasstateok(note: rebooted, the machine is back with the new driver) orerror(the code is in brackets inlatest_title).
Market
Machines that are listed for rent. Public; no key needed.
/api/v1/market/machinesList machines available for rent
Returns one page of machines that can be rented right now. To get the next page, pass the next value of this page as cursor, with the same filters and sort. All filters are optional and combine with AND; a repeated parameter (gpu, cpu) matches any of its values. Unknown query parameters are rejected with 400.
Example: 8-GPU CMP 50HX machines at most 0.100 USDT per GPU-hour, cheapest first: GET /api/v1/market/machines?gpu=CMP%2050HX&count=8&priceMax=0.100&sort=price_asc
- Scope
- Public
- API key
- Optional
- Rate limit class
read
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| sort | query | string | Optional | Sort order. Ties are broken by machine ID. Values |
| pageSize | query | integer | Optional | Machines per page. Values above 200 are treated as 200. Range |
| cursor | query | string | Optional | The |
| gpu | query | string[] | Optional | GPU model, exactly as returned in Example |
| cpu | query | string[] | Optional | CPU model, exactly as returned in Repeatable |
| cpuOnly | query | string | Optional | Only machines without GPUs. Values |
| count | query | integer | Optional | Exact number of GPUs. 0 = any. Range |
| vramMin | query | integer | Optional | Minimum memory per GPU, in GB. Range |
| cudaMin | query | number | Optional | Minimum CUDA version the driver supports, for example Range |
| priceMax | query | string | Optional | Maximum unit price in USDT per hour (per GPU on GPU machines, per CPU socket on CPU-only machines). Decimal string, up to 3 decimal places. 0 = any. Example |
| minSockets | query | integer | Optional | Minimum number of CPU sockets. Range |
| minCores | query | integer | Optional | Minimum total CPU cores. Range |
| ramMin | query | integer | Optional | Minimum memory, in GB. Range |
| storageMin | query | integer | Optional | Minimum total disk size, in GB. Range |
| storageType | query | string | Optional | Disk type. ( Values |
sortstring· querySort order. Ties are broken by machine ID.
Values
price_ascprice_desctotal_asctotal_desccores_descDefaultprice_ascExampleprice_ascpageSizeinteger· queryMachines per page. Values above 200 are treated as 200.
Range
0 – 200Default50cursorstring· queryThe
nextvalue from the previous page. Omit for the first page. Only valid with the samesort.gpustring[]· queryGPU model, exactly as returned in
gpu_models[].nameofGET /api/v1/market/facets(for exampleCMP 50HX, URL-encoded). Repeat to match any of several models.Example
CMP 50HXRepeatablecpustring[]· queryCPU model, exactly as returned in
cpu_models[].nameofGET /api/v1/market/facets. Repeat to match any of several models.Repeatable
cpuOnlystring· queryOnly machines without GPUs.
Values
1true0falsecountinteger· queryExact number of GPUs. 0 = any.
Range
≥ 0Example8vramMininteger· queryMinimum memory per GPU, in GB.
Range
≥ 0cudaMinnumber· queryMinimum CUDA version the driver supports, for example
12.8.Range
≥ 0priceMaxstring· queryMaximum unit price in USDT per hour (per GPU on GPU machines, per CPU socket on CPU-only machines). Decimal string, up to 3 decimal places. 0 = any.
Example
0.100Pattern^\d{1,7}(\.\d{1,3})?$minSocketsinteger· queryMinimum number of CPU sockets.
Range
≥ 0minCoresinteger· queryMinimum total CPU cores.
Range
≥ 0ramMininteger· queryMinimum memory, in GB.
Range
≥ 0storageMininteger· queryMinimum total disk size, in GB.
Range
≥ 0storageTypestring· queryDisk type. (
USBcan appear in results but cannot be used as a filter.)Values
NVMeSSDHDD
Responses
- 200OK
One page of machines.
Response fields (38)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
request_timeout. Retry shortly. (A failed query is 500internal.)request_timeout
Examples
curl 'https://suanzu.ai/api/v1/market/machines?sort=price_asc&gpu=CMP%2050HX&count=8&priceMax=0.100'/api/v1/market/machines/{machine_id}Get one machine available for rent
Returns the same fields as one item of the market list. Machines that are not listed, not rentable right now, or do not exist all return 404 machine_not_found.
- Scope
- Public
- API key
- Optional
- Rate limit class
read
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idfrom the market list (a UUID). The device number (SZ-000014) is not accepted.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Responses
- 200OK
The machine.
Response fields (34)
- 404Not Found
machine_not_found.machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
request_timeout. Retry shortly. (A failed query is 500internal.)request_timeout
Examples
curl 'https://suanzu.ai/api/v1/market/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58'/api/v1/market/facetsGet filter values for the market list
Returns the GPU and CPU models currently on the market, the range of each numeric filter, and the price range. Cached for up to 10 seconds.
count is the number of machines you can rent right now; it equals total of GET /api/v1/market/machines?gpu=<name> (or ?cpu=<name>). Pass name to the list's gpu / cpu parameter exactly as returned (same case and spaces; URL-encode spaces). A range that has no data is left out of ranges. price_range is null when no machine is on the market.
- Scope
- Public
- API key
- Optional
- Rate limit class
read
Responses
- 200OK
Filter values.
Response fields (11)
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
request_timeout. Retry shortly. (A failed query is 500internal.)request_timeout
Examples
curl 'https://suanzu.ai/api/v1/market/facets'Renter
Rent machines and manage your instances, balance and deposits. Needs renter:read or renter:write.
/api/v1/renter/imagesList preset images
Preset container images you can rent with (image_id in POST /api/v1/renter/leases). gpu: true images are for GPU machines, gpu: false for CPU-only machines. min_cuda is the lowest CUDA version the machine's driver must support (empty = no requirement).
- Scope
renter:read- API key
- Required
- Rate limit class
read
Responses
- 200OK
Preset images.
Response fields (6)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/renter/images' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leasesList your instances
Lists your rented instances, one page at a time (page / per_page). tab=current (default) lists instances that have not ended, including ones still being delivered; tab=history lists ended ones. A page number past the last page returns the last page.
On the current tab, counts and gpu_models cover all your current instances and ignore the filters; hourly_total is the summed hourly price of instances that are being billed. Use phase to tell delivery (pulling → preparing → starting) from running.
- Scope
renter:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| tab | query | string | Optional | Values |
| phase | query | string | Optional | Current tab only. Values |
| gpu | query | string | Optional | Current tab only. Exact GPU model, as in |
| sort | query | string | Optional | Current tab only. Values |
| order | query | string | Optional | Current tab only. Values |
| reason | query | string | Optional | History tab only. Only instances that ended for this Values |
| days | query | integer | Optional | History tab only. Only instances that ended in the last N days. 0 = any. Values |
| tags | query | string | Optional | Comma-separated tag IDs (from Example |
| q | query | string | Optional | Case-insensitive search in device number, GPU model, image and tag names. At most 64 characters. Length |
| page | query | integer | Optional | Range |
| per_page | query | integer | Optional | Default 50 on the current tab, 20 on the history tab. Range |
tabstring· queryValues
currenthistoryDefaultcurrentphasestring· queryCurrent tab only.
delivery= any ofpulling,preparing,starting.Values
runningdeliverypullingpreparingstartinggpustring· queryCurrent tab only. Exact GPU model, as in
gpu_models.sortstring· queryCurrent tab only.
Values
machinegpuModelsimagegpuUtilcpumemoryratestartedstatusDefaultmachineorderstring· queryCurrent tab only.
Values
ascdescreasonstring· queryHistory tab only. Only instances that ended for this
end_reason.Values
renterbalance_exhaustedoffline_rentedverdictadmindelivery_faileddaysinteger· queryHistory tab only. Only instances that ended in the last N days. 0 = any.
Values
073090tagsstring· queryComma-separated tag IDs (from
GET /api/v1/renter/tags); matches instances with any of them.Example
12,15qstring· queryCase-insensitive search in device number, GPU model, image and tag names. At most 64 characters.
Length
≤ 64pageinteger· queryRange
1 – 1000000Default1per_pageinteger· queryDefault 50 on the current tab, 20 on the history tab.
Range
1 – 1000
Responses
- 200OK
One page of instances. The history tab has only
itemsand the paging fields.Response fields (138)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/renter/leases?tags=12,15' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leasesRent a machine
Rents one whole machine. Billing starts when the instance is delivered and is charged every minute. Your balance must cover at least one hour of rent. The new instance starts in phase pulling; poll GET /api/v1/renter/leases for its state.
Idempotency-Key is required with an API key. If a request times out, send it again with the same key and body: you get the same order back (200, same id) instead of renting twice, even if that order has ended since. A failed order does not use up the key.
- Scope
renter:write- API key
- Required
- Rate limit class
order
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | Required | Any unique string you choose, 1-64 visible ASCII characters (no spaces). Use a new one for every new order. Length |
Idempotency-Keystring· headerRequiredAny unique string you choose, 1-64 visible ASCII characters (no spaces). Use a new one for every new order.
Length
1 – 64Exampleorder-20261106-0001Pattern^[\x21-\x7e]{1,64}$
Request bodyapplication/json
Give exactly one of image_id and image. startup_cmd and tasks cannot both be set. Body at most 64 KiB.
| Name | Type | Required | Description |
|---|---|---|---|
| machine_id | string | Required | From the market list. |
| device_no | string | Required | From the market list; must match |
| price_hr | string | Required | The whole-machine price per hour you saw: Pattern |
| image_id | string | Optional | A preset image ID from |
| image | string | Optional | Your own image from a public registry, for example |
| startup_cmd | string | Optional | Shell command run inside the instance after it starts. At most 4096 bytes of UTF-8, no NUL. Length |
| tasks | object[] | Optional | Compute tasks to run after delivery, from your own task templates ( Length |
| tasks[].template_id | string | Required | Template |
| tasks[].gpus | null | Optional | — |
machine_idstringRequiredFrom the market list.
device_nostringRequiredFrom the market list; must match
machine_id.price_hrstringRequiredThe whole-machine price per hour you saw:
total_price_hrfrom the market list, as is (decimal string). If the current price is different, the order is not placed and you get 409price_changedwith the current price.Pattern
^(0|[1-9][0-9]{0,15})(\.[0-9]{1,3})?$image_idstringA preset image ID from
GET /api/v1/renter/images.imagestringYour own image from a public registry, for example
docker.io/library/ubuntu:22.04.startup_cmdstringShell command run inside the instance after it starts. At most 4096 bytes of UTF-8, no NUL.
Length
≤ 4096tasksobject[]Compute tasks to run after delivery, from your own task templates (
idfromGET /api/v1/renter/task-templates). Each template at most once;gpusmust be null (all GPUs) when ordering.Length
≤ 16tasks[].template_idstringRequiredTemplate
idfromGET /api/v1/renter/task-templates.tasks[].gpusnull
Responses
- 200OK
Order placed (or the same order again, for a repeated
Idempotency-Key).Response fields (2)
- 400Bad Request
bad_request(missing or invalid fields, or a malformedIdempotency-Key),idempotency_key_required,image_invalid(also an unknownimage_id),image_registry_unsupported,image_gpu_mismatch,image_cuda_too_old,startup_cmd_invalid,task_limit_reached,task_template_duplicate,task_gpus_invalid,task_config_too_large.bad_requestidempotency_key_requiredimage_invalidimage_registry_unsupportedimage_gpu_mismatchimage_cuda_too_oldstartup_cmd_invalidtask_limit_reachedtask_template_duplicatetask_gpus_invalidtask_config_too_large
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
own_machine(you cannot rent your own machine), or an API key error (api_key_scope_denied,api_key_ip_denied,api_key_route_not_allowed).own_machine
- 404Not Found
template_not_found: a task template intasksdoes not exist or is not yours.template_not_found
- 409Conflict
machine_not_rentable,machine_rented,machine_configuration_changed(refresh the market and retry),price_changed(the host or the platform changed the price after you loaded the market; the response has the currentprice_hr(whole machine) andprice_per_hr(per GPU or CPU socket, may be absent); place a new order with the newprice_hrand a newIdempotency-Key),balance_too_low(balance is below one hour of rent).machine_not_rentablemachine_rentedmachine_configuration_changedprice_changedbalance_too_low
- 422Unprocessable Content
idempotency_mismatch: this key was already used for a different order.idempotency_mismatch
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/leases' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Idempotency-Key: order-20261106-0001' \
-H 'Content-Type: application/json' \
-d '{
"machine_id": "314d1670-872d-4d8d-be94-a4ceea1c0c58",
"device_no": "SZ-000014",
"price_hr": "0.848",
"image_id": "cuda-12-runtime"
}'/api/v1/renter/leases/{lease_id}/settlesList the charges of one instance
Returns the instance's billing summary (lease) and its charges, newest first, 20 per page by default. Pass at (a period_end value) instead of page to get the page that contains that charge. A page past the end returns empty items.
- Scope
renter:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
| page | query | integer | Optional | Range |
| per_page | query | integer | Optional | Range |
| at | query | integer | Optional |
Range |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$pageinteger· queryRange
1 – 1000000Default1per_pageinteger· queryRange
1 – 50Default20atinteger· queryperiod_endof a charge. Cannot be combined withpage.Range
≥ 1
Responses
- 200OK
Billing summary and one page of charges.
Response fields (17)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found: no such lease, or it is not yours.lease_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/renter/leases/57/settles' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/container-logRead the container log
Returns the latest complete tail of your container log (docker logs: the startup command's output and anything written to /proc/1/fd/1; the last 200 lines, up to 64 KiB). Logs are fetched on request: call POST .../container-log, then poll this endpoint until log.req equals the req you got back. log is null until a log has arrived. Only while the instance is running. The log is deleted when the rental ends.
- Scope
renter:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$
Responses
- 200OK
The latest log.
Response fields (8)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found: no such lease, or it is not yours.lease_not_found
- 409Conflict
lease_not_running: the instance is not in phaserunning.lease_not_running
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/renter/leases/57/container-log' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/container-logAsk the instance for a fresh container log
Asks the machine to send the current tail of the container log. Returns the request number req; read the log with GET .../container-log. At most once every 5 seconds per instance. Only while the instance is running.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$
Responses
- 200OK
Request sent.
Response fields (2)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found: no such lease, or it is not yours.lease_not_found
- 409Conflict
lease_not_running: the instance is not in phaserunning.lease_not_running
- 429Too Many Requests
container_log_rate_limited(requested less than 5 seconds ago; the body also hasretry_afterin seconds), orrate_limited. Both send aRetry-Afterheader.container_log_rate_limitedrate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/container-log' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/accessGet SSH connection details for an instance
Returns a password. Gives the SSH command and password for your instance's container. Treat the response as a secret: do not log it.
ssh_command is filled only when status is ready; password is returned whenever the instance is running. The user is always root (inside your container). Needs renter:write (a read-only key cannot get passwords).
- Scope
renter:write- API key
- Required
- Rate limit class
remote
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$
Responses
- 200OK
Connection details.
Response fields (8)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found: no such lease, or it is not yours.lease_not_found
- 409Conflict
lease_not_running, orremote_not_ready(the connection is not set up yet; retry shortly).lease_not_runningremote_not_ready
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
remote_unconfigured,remote_relay_failed, orrequest_timeout.remote_unconfiguredremote_relay_failedrequest_timeout
Examples
curl 'https://suanzu.ai/api/v1/renter/leases/57/access' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/stopStop an instance
Stops the instance and settles the rent up to now. During delivery (before billing starts) this cancels the order at no charge. Stopping an instance that has already ended returns 200 again.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found: no such lease, or it is not yours.lease_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/stop' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/access/passwordChange the SSH password of an instance
Sets a new SSH password and disconnects all current SSH sessions. The response does not contain the new password; get it with GET .../access. Only while the instance is running.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found: no such lease, or it is not yours.lease_not_found
- 409Conflict
lease_not_running, orremote_not_ready.lease_not_runningremote_not_ready
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
remote_unconfigured, orrequest_timeout.remote_unconfiguredrequest_timeout
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/access/password' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/startupChange the startup command
Saves a new startup command and restarts the container with it. If the command is the same as the current one, nothing happens: the container is not restarted and startup_rev stays the same. So this call is safe to retry. To run the same command again, use POST .../startup/restart. An empty string clears the command. Setting a command removes all compute tasks of this instance. Only while the instance is running. Returns the current startup_rev.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| startup_cmd | string | Required | At most 4096 bytes of UTF-8, no NUL. Empty = no command. Length |
startup_cmdstringRequiredAt most 4096 bytes of UTF-8, no NUL. Empty = no command.
Length
≤ 4096
Responses
- 200OK
Saved; the container is restarting. If the command did not change, nothing was done and
startup_revis unchanged.Response fields (2)
- 400Bad Request
bad_request(startup_cmdmissing or not a string),startup_cmd_invalid.bad_requeststartup_cmd_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found: no such lease, or it is not yours.lease_not_found
- 409Conflict
lease_not_running, orrebuild_in_progress(a rebuild is in progress; try again after it finishes).lease_not_runningrebuild_in_progress
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PUT 'https://suanzu.ai/api/v1/renter/leases/57/startup' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"startup_cmd": "python3 /workspace/train.py"
}'/api/v1/renter/leases/{lease_id}/startup/restartRestart the container
Restarts the container. Processes in the container are stopped; files are kept. If a startup command is set, it is not changed and runs again after the container starts (startup.runs starts again from 1). Works with or without a startup command, only while the instance is running. Returns the new startup_rev. Each successful call restarts the container once. Do not retry automatically. If a request times out, call GET /api/v1/renter/leases first: if startup.rev already equals the previous startup_rev + 1, the restart went through.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$
Responses
- 200OK
The container is restarting.
Response fields (2)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found: no such lease, or it is not yours.lease_not_found
- 409Conflict
lease_not_running: the instance is not running.rebuild_in_progress: a rebuild is in progress; try again after it finishes.lease_not_runningrebuild_in_progress
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/startup/restart' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/rebuildRebuild the instance
Rebuilds the container of a running instance on the same machine: either with a different image (image_id or image, as when renting) or with the current image (send {}; the image is pulled again, so a tag that now points to a newer version is updated). All files in the container are deleted. The GPUs, the SSH connection details and the rent stay the same, and billing does not stop.
The old container keeps running while the new image is pulled. If the pull fails, the old container is not changed. If the new container cannot start, it is kept for troubleshooting and the old one is already gone; rebuild again or stop the rental. Track the result in rebuild of GET /api/v1/renter/leases (pending → pulling → switching → done / failed).
Optional startup_cmd sets the startup command of the new container in the same step (same rules as PUT .../startup; omit it to keep the current command, an empty string clears it). Setting a non-empty command removes all compute tasks of this instance. While a rebuild is in progress, startup/restart, PUT .../startup and another rebuild return 409 rebuild_in_progress.
Each successful call rebuilds the instance once. Do not retry automatically. If a request times out, call GET /api/v1/renter/leases first: if rebuild.rev already equals the previous value + 1, the rebuild was accepted.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$
Request bodyapplication/json
Give at most one of image_id and image; give neither ({}) to rebuild with the current image. Body at most 64 KiB.
| Name | Type | Required | Description |
|---|---|---|---|
| image_id | string | Optional | A preset image ID from |
| image | string | Optional | Your own image from a public registry, for example |
| startup_cmd | string | Optional | Startup command of the new container. Omit to keep the current one; empty = no command. At most 4096 bytes of UTF-8, no NUL. Length |
image_idstringA preset image ID from
GET /api/v1/renter/images.imagestringYour own image from a public registry, for example
docker.io/library/ubuntu:22.04.startup_cmdstringStartup command of the new container. Omit to keep the current one; empty = no command. At most 4096 bytes of UTF-8, no NUL.
Length
≤ 4096
Responses
- 200OK
Accepted. The machine starts the rebuild within seconds.
Response fields (2)
- 400Bad Request
bad_request(not a JSON object, an unknown field, bothimage_idandimage, or an empty one),image_unchanged(this is the current image; send{}to pull it again),image_invalid,image_registry_unsupported,image_gpu_mismatch,image_cuda_too_old,startup_cmd_invalid.bad_requestimage_unchangedimage_invalidimage_registry_unsupportedimage_gpu_mismatchimage_cuda_too_oldstartup_cmd_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found: no such lease, or it is not yours.lease_not_found
- 409Conflict
lease_not_running,rebuild_in_progress(wait for the current rebuild to finish), oragent_outdated(the machine's agent is too old; the host needs to upgrade it).lease_not_runningrebuild_in_progressagent_outdated
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/rebuild' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"image": "ghcr.io/foo/bar:1.2"
}'/api/v1/renter/accountGet your rent balance
Your renter balance in USDT. updated_at is null if the account has never had a transaction.
- Scope
renter:read- API key
- Required
- Rate limit class
read_pg
Responses
- 200OK
Balance.
Response fields (2)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/renter/account' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/ledgerList your renter balance transactions
Deposits, rent charges and referral shares, newest first. Rent rows have negative amount and are updated in place as the instance keeps being billed (updated_at). referral rows are your referral share from users you invited renting devices, credited to your renter balance (source is referral). Note: this endpoint pages with page_size, not per_page.
- Scope
renter:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| page | query | integer | Optional | Range |
| page_size | query | integer | Optional | Range |
| type | query | string | Optional | Filter by type. Values |
pageinteger· queryRange
1 – 1000000Default1page_sizeinteger· queryRange
1 – 100Default20typestring· queryFilter by type.
referral= referral share credited to your renter balance.Values
depositrentreferral
Responses
- 200OK
One page of transactions.
Response fields (10)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/renter/ledger' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/task-templatesList your compute task templates
Your own compute task templates, oldest first. Use id as tasks[].template_id when renting (POST /api/v1/renter/leases) or when setting tasks (PUT /api/v1/renter/leases/{lease_id}/tasks).
- Scope
renter:read- API key
- Required
- Rate limit class
read_pg
Responses
- 200OK
Templates.
Response fields (36)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/renter/task-templates' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/task-templatesCreate a compute task template
Creates a compute task template under your account. kind: custom runs your own program (custom.start_command, optional custom.package_url); kind: hive uses HiveOS-style settings (hive). Body at most 256 KiB; the template itself at most 64 KiB. ref / wallet_ref can only name your own wallets / variables (GET /api/v1/renter/wallet-vars).
- Scope
renter:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
A compute task template. Give custom when kind is custom, hive when kind is hive. See "Compute task templates" in the introduction for variables, macros and package rules.
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | — |
| kind | string | Required | Values |
| description | string | Optional | — |
| vars | object[] | Optional | Custom tasks only. Environment variables of the program (at most 64). Set |
| vars[].key | string | Required | Matches |
| vars[].value | string | Required | At most 4 KiB. Required even with |
| vars[].ref | string | null | Optional |
|
| custom | object | Optional | — |
| custom.start_command | string | Optional | Runs with |
| custom.package_url | string | Optional | Optional program package to download before starting. |
| custom.extract | boolean | Optional | Default |
| hive | object | Optional | — |
| hive.miner | string | Optional | Package directory name. Empty = taken from the |
| hive.coin | string | Optional | Passed as |
| hive.wallet | string | Optional | Replaces |
| hive.install_url | string | Optional | http(s) link to a |
| hive.algo | string | Optional | Passed as |
| hive.template | string | Optional | Macros are replaced in this field and in |
| hive.url | string | Optional | — |
| hive.pass | string | Optional | — |
| hive.user_config | string | Optional | — |
| accel | object | Optional | — |
| accel.download | boolean | Optional | Download acceleration for the program package (GitHub release files only). |
| wallet_ref | string | null | Optional | HiveOS only. Take |
| follow | string | Optional | Follow the latest version: Values |
namestringRequiredkindstringRequiredValues
customhivedescriptionstringvarsobject[]Custom tasks only. Environment variables of the program (at most 64). Set
refto take the value from one of your wallets / variables; then sendvalueas an empty string, it is replaced.vars[].keystringRequiredMatches
^[A-Za-z_][A-Za-z0-9_]*$; noSUANZU_prefix and no reserved name.vars[].valuestringRequiredAt most 4 KiB. Required even with
ref(send an empty string).vars[].refstring | nullidof one of your wallets / variables, or null.customobjectcustom.start_commandstringRuns with
bash -c. At most 16 KiB.custom.package_urlstringOptional program package to download before starting.
custom.extractbooleanDefault
truehiveobjecthive.minerstringPackage directory name. Empty = taken from the
install_urlfile name.hive.coinstringPassed as
DIGITAL_CASH.hive.walletstringReplaces
%WAL%. Send an empty string withwallet_ref.hive.install_urlstringhttp(s) link to a
.tar.gz/.tgzpackage.hive.algostringPassed as
CUSTOM_ALGO.hive.templatestringMacros are replaced in this field and in
url,pass,user_config.hive.urlstringhive.passstringhive.user_configstringaccelobjectaccel.downloadbooleanDownload acceleration for the program package (GitHub release files only).
wallet_refstring | nullHiveOS only. Take
hive.walletfrom one of your wallets / variables.followstringFollow the latest version:
latest= stable releases,latest_beta= pre-releases too. Only for a download link that is a GitHub release file with a version tag, otherwise 400follow_github_only. Not sent = "" (the template is replaced as a whole, so leaving it out turns following off).Values
latestlatest_betaDefault
Responses
- 200OK
Created.
templatehas the same fields as an item ofGET /api/v1/renter/task-templates.Response fields (2)
- 400Bad Request
bad_request,template_invalid(theerrortext says which field),hive_vars_unsupported,hive_wallet_required,wallet_var_unavailable(aref/wallet_refis not one of yours),task_config_too_large,package_url_private_host,package_url_github_query,accel_download_github_only, orfollow_github_only(following the latest version is available only for GitHub release links with a version tag).bad_requesttemplate_invalidhive_vars_unsupportedhive_wallet_requiredwallet_var_unavailabletask_config_too_largepackage_url_private_hostpackage_url_github_queryaccel_download_github_onlyfollow_github_only
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/task-templates' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "Pearl",
"kind": "custom",
"description": "",
"vars": [
{
"key": "WALLET",
"value": "prl1qexamplewallet0000"
}
],
"custom": {
"start_command": "./run.sh",
"package_url": "https://github.com/example/miner/releases/download/v1.0/miner.tar.gz",
"extract": true
},
"accel": {
"download": true
}
}'/api/v1/renter/task-templates/{template_id}Replace a compute task template
Replaces the whole template (send every field, as in create). If what is sent to machines changes, version goes up and running instances that use the template pick up the new settings with the next heartbeat.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| template_id | path | string | Required |
Example |
template_idstring· pathRequiredidof your compute task template (fromGET /api/v1/renter/task-templates).Example
9c2e5b7a1d3f4e6aPattern^[0-9a-f]{16}$
Request bodyapplication/json
A compute task template. Give custom when kind is custom, hive when kind is hive. See "Compute task templates" in the introduction for variables, macros and package rules.
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | — |
| kind | string | Required | Values |
| description | string | Optional | — |
| vars | object[] | Optional | Custom tasks only. Environment variables of the program (at most 64). Set |
| vars[].key | string | Required | Matches |
| vars[].value | string | Required | At most 4 KiB. Required even with |
| vars[].ref | string | null | Optional |
|
| custom | object | Optional | — |
| custom.start_command | string | Optional | Runs with |
| custom.package_url | string | Optional | Optional program package to download before starting. |
| custom.extract | boolean | Optional | Default |
| hive | object | Optional | — |
| hive.miner | string | Optional | Package directory name. Empty = taken from the |
| hive.coin | string | Optional | Passed as |
| hive.wallet | string | Optional | Replaces |
| hive.install_url | string | Optional | http(s) link to a |
| hive.algo | string | Optional | Passed as |
| hive.template | string | Optional | Macros are replaced in this field and in |
| hive.url | string | Optional | — |
| hive.pass | string | Optional | — |
| hive.user_config | string | Optional | — |
| accel | object | Optional | — |
| accel.download | boolean | Optional | Download acceleration for the program package (GitHub release files only). |
| wallet_ref | string | null | Optional | HiveOS only. Take |
| follow | string | Optional | Follow the latest version: Values |
namestringRequiredkindstringRequiredValues
customhivedescriptionstringvarsobject[]Custom tasks only. Environment variables of the program (at most 64). Set
refto take the value from one of your wallets / variables; then sendvalueas an empty string, it is replaced.vars[].keystringRequiredMatches
^[A-Za-z_][A-Za-z0-9_]*$; noSUANZU_prefix and no reserved name.vars[].valuestringRequiredAt most 4 KiB. Required even with
ref(send an empty string).vars[].refstring | nullidof one of your wallets / variables, or null.customobjectcustom.start_commandstringRuns with
bash -c. At most 16 KiB.custom.package_urlstringOptional program package to download before starting.
custom.extractbooleanDefault
truehiveobjecthive.minerstringPackage directory name. Empty = taken from the
install_urlfile name.hive.coinstringPassed as
DIGITAL_CASH.hive.walletstringReplaces
%WAL%. Send an empty string withwallet_ref.hive.install_urlstringhttp(s) link to a
.tar.gz/.tgzpackage.hive.algostringPassed as
CUSTOM_ALGO.hive.templatestringMacros are replaced in this field and in
url,pass,user_config.hive.urlstringhive.passstringhive.user_configstringaccelobjectaccel.downloadbooleanDownload acceleration for the program package (GitHub release files only).
wallet_refstring | nullHiveOS only. Take
hive.walletfrom one of your wallets / variables.followstringFollow the latest version:
latest= stable releases,latest_beta= pre-releases too. Only for a download link that is a GitHub release file with a version tag, otherwise 400follow_github_only. Not sent = "" (the template is replaced as a whole, so leaving it out turns following off).Values
latestlatest_betaDefault
Responses
- 200OK
Saved.
templateis the updated template.Response fields (2)
- 400Bad Request
bad_request,template_invalid(theerrortext says which field),hive_vars_unsupported,hive_wallet_required,wallet_var_unavailable(aref/wallet_refis not one of yours),task_config_too_large,package_url_private_host,package_url_github_query,accel_download_github_only, orfollow_github_only(following the latest version is available only for GitHub release links with a version tag).bad_requesttemplate_invalidhive_vars_unsupportedhive_wallet_requiredwallet_var_unavailabletask_config_too_largepackage_url_private_hostpackage_url_github_queryaccel_download_github_onlyfollow_github_only
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
template_not_found: no such template, or it is not yours.template_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PUT 'https://suanzu.ai/api/v1/renter/task-templates/9c2e5b7a1d3f4e6a' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "Pearl",
"kind": "custom",
"description": "",
"vars": [
{
"key": "WALLET",
"value": "prl1qexamplewallet0000"
}
],
"custom": {
"start_command": "./run.sh --fast",
"package_url": "https://github.com/example/miner/releases/download/v1.0/miner.tar.gz",
"extract": true
},
"accel": {
"download": true
}
}'/api/v1/renter/task-templates/{template_id}Delete a compute task template
Deletes a template that no instance uses. If instances still use it you get 409 task_template_in_use with machine_count; remove the task from those instances first.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| template_id | path | string | Required |
Example |
template_idstring· pathRequiredidof your compute task template (fromGET /api/v1/renter/task-templates).Example
9c2e5b7a1d3f4e6aPattern^[0-9a-f]{16}$
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
template_not_found: no such template, or it is not yours.template_not_found
- 409Conflict
task_template_in_use: instances still use this template;machine_countsays how many.task_template_in_use
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X DELETE 'https://suanzu.ai/api/v1/renter/task-templates/9c2e5b7a1d3f4e6a' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/tasksGet the compute tasks of an instance
The instance's compute tasks with their latest message, stats and states, plus the GPUs of the machine (gpus, for choosing GPUs in PUT .../tasks). Works during delivery too. stats_at is null and stats / states are empty while the instance has not reported stats for the current task list yet.
- Scope
renter:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$
Responses
- 200OK
Tasks.
Response fields (57)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found: no such lease, or it is not yours.lease_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/renter/leases/57/tasks' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/tasksSet the compute tasks of an instance
Sets the whole task list of one instance; tasks: [] removes all tasks. Up to 16 tasks, each template at most once. To keep a task running unchanged, send its binding_id with the same template and GPUs: it keeps its ID and is not restarted. gpus null = all GPUs; otherwise bus IDs from GET .../tasks gpus. Setting tasks clears the startup command. Only while the instance is running. Saving the same list again changes nothing, so this call is safe to retry.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| tasks | object[] | Required | Tasks, each from one of your templates. Each template at most once. Length |
| tasks[].binding_id | string | Optional | Optional. The current task to keep (from |
| tasks[].template_id | string | Required |
|
| tasks[].gpus | string[] | null | Optional | GPU bus IDs, ascending, no duplicates. null = all GPUs. |
tasksobject[]RequiredTasks, each from one of your templates. Each template at most once.
Length
≤ 16tasks[].binding_idstringOptional. The current task to keep (from
GET .../tasks).tasks[].template_idstringRequiredidfromGET /api/v1/renter/task-templates.tasks[].gpusstring[] | nullGPU bus IDs, ascending, no duplicates. null = all GPUs.
Responses
- 200OK
Saved. Lists which tasks were added, updated, removed and kept.
Response fields (12)
- 400Bad Request
bad_request,task_limit_reached(more than 16 tasks),task_template_duplicate,task_gpus_invalid(a bus ID is not a GPU of the instance), ortask_config_too_large.bad_requesttask_limit_reachedtask_template_duplicatetask_gpus_invalidtask_config_too_large
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found, ortemplate_not_found(a template is not yours or does not exist).lease_not_foundtemplate_not_found
- 409Conflict
lease_not_running: the instance is not in phaserunning.lease_not_running
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PUT 'https://suanzu.ai/api/v1/renter/leases/57/tasks' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"tasks": [
{
"binding_id": "3f9a0c1d2e4b5a60",
"template_id": "9c2e5b7a1d3f4e6a",
"gpus": null
}
]
}'/api/v1/renter/leases/tasksChange compute tasks on several instances
Applies one action to 1-500 of your instances. add keeps each instance's tasks and adds the given templates (a template the instance already has is skipped); replace makes the given templates the whole list; pause, resume, restart act on all tasks; clear removes all tasks. tasks only with add / replace. Each instance succeeds or fails on its own: see results[].ok and results[].code (for example lease_not_found, lease_not_running, task_gpus_invalid). restart restarts every time; do not retry automatically.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| lease_ids | string[] | Required | Lease IDs as decimal strings ( Length |
| action | string | Required | Values |
| tasks | object[] | Optional | Tasks, each from one of your templates. Each template at most once. Length |
| tasks[].binding_id | string | Optional | Optional. The current task to keep (from |
| tasks[].template_id | string | Required |
|
| tasks[].gpus | string[] | null | Optional | GPU bus IDs, ascending, no duplicates. null = all GPUs. |
lease_idsstring[]RequiredLease IDs as decimal strings (
idfromGET /api/v1/renter/leases). 1-500 items; duplicates are merged.Length
1 – 500Pattern^[1-9][0-9]{0,17}$actionstringRequiredValues
addreplacepauseresumerestartcleartasksobject[]Tasks, each from one of your templates. Each template at most once.
Length
≤ 16tasks[].binding_idstringOptional. The current task to keep (from
GET .../tasks).tasks[].template_idstringRequiredidfromGET /api/v1/renter/task-templates.tasks[].gpusstring[] | nullGPU bus IDs, ascending, no duplicates. null = all GPUs.
Responses
- 200OK
One result per instance, in request order.
Response fields (14)
- 400Bad Request
bad_request,task_limit_reached(more than 16 tasks),task_template_duplicate,task_gpus_invalid(a bus ID is not a GPU of the instance), ortask_config_too_large.bad_requesttask_limit_reachedtask_template_duplicatetask_gpus_invalidtask_config_too_large
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
template_not_found: no such template, or it is not yours.template_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/leases/tasks' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"lease_ids": [
"57",
"58"
],
"action": "add",
"tasks": [
{
"template_id": "9c2e5b7a1d3f4e6a",
"gpus": null
}
]
}'/api/v1/renter/leases/{lease_id}/tasks/{binding_id}/pausePause a compute task
Stops the task and keeps it paused until you resume it. Only while the instance is running.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
| binding_id | path | string | Required |
Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$binding_idstring· pathRequiredbinding_idof the task, fromGET /api/v1/renter/leases/{lease_id}/tasks.Example
3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found, ortask_not_found(no such task on this instance).lease_not_foundtask_not_found
- 409Conflict
lease_not_running: the instance is not in phaserunning.lease_not_running
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/tasks/3f9a0c1d2e4b5a60/pause' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/tasks/{binding_id}/resumeResume a compute task
Starts a paused task again. Only while the instance is running.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
| binding_id | path | string | Required |
Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$binding_idstring· pathRequiredbinding_idof the task, fromGET /api/v1/renter/leases/{lease_id}/tasks.Example
3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found, ortask_not_found(no such task on this instance).lease_not_foundtask_not_found
- 409Conflict
lease_not_running: the instance is not in phaserunning.lease_not_running
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/tasks/3f9a0c1d2e4b5a60/resume' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/tasks/{binding_id}/restartRestart a compute task
Restarts the task program. Each successful call restarts it once. Do not retry automatically. Only while the instance is running and the task is not paused.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
| binding_id | path | string | Required |
Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$binding_idstring· pathRequiredbinding_idof the task, fromGET /api/v1/renter/leases/{lease_id}/tasks.Example
3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found, ortask_not_found(no such task on this instance).lease_not_foundtask_not_found
- 409Conflict
lease_not_running, ortask_paused(resume the task first).lease_not_runningtask_paused
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/tasks/3f9a0c1d2e4b5a60/restart' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/tasks/{binding_id}/reinstallDownload and install a compute task's package again
Downloads the task's program package again, installs it and restarts the task. Only for tasks that have a package; only while the instance is running and the task is not paused.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
| binding_id | path | string | Required |
Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$binding_idstring· pathRequiredbinding_idof the task, fromGET /api/v1/renter/leases/{lease_id}/tasks.Example
3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found, ortask_not_found(no such task on this instance).lease_not_foundtask_not_found
- 409Conflict
lease_not_running,task_paused(resume it first), ortask_no_package(the task has no package to reinstall).lease_not_runningtask_pausedtask_no_package
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/tasks/3f9a0c1d2e4b5a60/reinstall' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/tasks/{binding_id}/logRead a compute task's log
Returns the latest complete log of the task. Logs are fetched on request: call POST .../log, then poll this endpoint until log.req equals the req you got back. log is null until a log has arrived. Only while the instance is running.
- Scope
renter:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
| binding_id | path | string | Required |
Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$binding_idstring· pathRequiredbinding_idof the task, fromGET /api/v1/renter/leases/{lease_id}/tasks.Example
3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$
Responses
- 200OK
The latest log. Same shape as the startup command log.
Response fields (8)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found, ortask_not_found(no such task on this instance).lease_not_foundtask_not_found
- 409Conflict
lease_not_running: the instance is not in phaserunning.lease_not_running
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/renter/leases/57/tasks/3f9a0c1d2e4b5a60/log' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/{lease_id}/tasks/{binding_id}/logAsk the instance for a fresh task log
Asks the instance to send the current log of this task. Returns the request number req; read the log with GET .../log. Only while the instance is running and the task is not paused.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| lease_id | path | string | Required | Lease ID ( Example |
| binding_id | path | string | Required |
Example |
lease_idstring· pathRequiredLease ID (
idfromGET /api/v1/renter/leases). A positive integer without leading zeros.Example
57Pattern^[1-9][0-9]{0,17}$binding_idstring· pathRequiredbinding_idof the task, fromGET /api/v1/renter/leases/{lease_id}/tasks.Example
3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$
Responses
- 200OK
Request sent.
Response fields (2)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found, ortask_not_found(no such task on this instance).lease_not_foundtask_not_found
- 409Conflict
lease_not_running, ortask_paused(resume the task first).lease_not_runningtask_paused
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/tasks/3f9a0c1d2e4b5a60/log' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/tagsList your instance tags
Your tags. Filter instances by tag with GET /api/v1/renter/leases?tags=. lease_count counts all your instances with the tag, ended ones included.
- Scope
renter:read- API key
- Required
- Rate limit class
read_pg
Responses
- 200OK
Tags.
Response fields (6)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/renter/tags' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/tagsCreate an instance tag
Creates a tag. name is 1-32 characters after trimming, unique in your account (case-insensitive); color is 0-7. At most 1000 tags per account.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Length |
| color | integer | Required | Range |
namestringRequiredLength
1 – 32colorintegerRequiredRange
0 – 7
Responses
- 200OK
Created.
Response fields (2)
- 400Bad Request
bad_request,tag_name_invalid(1-32 characters after trimming), ortag_color_invalid(0-7).bad_requesttag_name_invalidtag_color_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 409Conflict
tag_name_taken, ortag_limit(1000 tags already).tag_name_takentag_limit
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/tags' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "training",
"color": 2
}'/api/v1/renter/tags/{tag_id}Rename or recolor an instance tag
Send name, color or both; same rules as create.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| tag_id | path | string | Required |
Example |
tag_idstring· pathRequiredidof your tag (fromGET /api/v1/renter/tags).Example
12Pattern^[1-9][0-9]{0,17}$
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Optional | Length |
| color | integer | Optional | Range |
namestringLength
1 – 32colorintegerRange
0 – 7
Responses
- 200OK
Done.
Response fields (1)
- 400Bad Request
bad_request,tag_name_invalid(1-32 characters after trimming), ortag_color_invalid(0-7).bad_requesttag_name_invalidtag_color_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
tag_not_found: no such tag, or it is not yours.tag_not_found
- 409Conflict
tag_name_taken.tag_name_taken
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PATCH 'https://suanzu.ai/api/v1/renter/tags/12' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "inference"
}'/api/v1/renter/tags/{tag_id}Delete an instance tag
Deletes the tag and removes it from all your instances.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| tag_id | path | string | Required |
Example |
tag_idstring· pathRequiredidof your tag (fromGET /api/v1/renter/tags).Example
12Pattern^[1-9][0-9]{0,17}$
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
tag_not_found: no such tag, or it is not yours.tag_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X DELETE 'https://suanzu.ai/api/v1/renter/tags/12' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/leases/tagsAdd or remove tags on several instances
Adds (mode: add) or removes (mode: remove) 1-30 tags on 1-500 of your instances, all or nothing. An instance can have at most 30 tags; going over rejects the whole request with 409 tag_lease_limit and the instance's lease_id. Adding a tag an instance already has, or removing one it does not have, is not an error.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| lease_ids | string[] | Required | Lease IDs as decimal strings ( Length |
| tag_ids | string[] | Required | Tag IDs as decimal strings. 1-30 items; duplicates are merged. Length |
| mode | string | Required | Values |
lease_idsstring[]RequiredLease IDs as decimal strings (
idfromGET /api/v1/renter/leases). 1-500 items; duplicates are merged.Length
1 – 500Pattern^[1-9][0-9]{0,17}$tag_idsstring[]RequiredTag IDs as decimal strings. 1-30 items; duplicates are merged.
Length
1 – 30Pattern^[1-9][0-9]{0,17}$modestringRequiredValues
addremove
Responses
- 200OK
Done.
nis the number of instances (after merging duplicates).Response fields (2)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
lease_not_found(an instance is not yours), ortag_not_found(a tag is not yours).lease_not_foundtag_not_found
- 409Conflict
tag_lease_limit: an instance would have more than 30 tags;lease_idsays which.tag_lease_limit
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/leases/tags' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"lease_ids": [
"57",
"58"
],
"tag_ids": [
"12"
],
"mode": "add"
}'/api/v1/renter/wallet-varsList your wallets and variables
Your saved wallets / variables. Use id as vars[].ref or wallet_ref in a compute task template; the template then always uses the current value. templates lists the templates that use each one.
- Scope
renter:read- API key
- Required
- Rate limit class
read_pg
Responses
- 200OK
Wallets and variables.
Response fields (9)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/renter/wallet-vars' \
-H 'Authorization: Bearer sz_live_...'/api/v1/renter/wallet-varsSave a wallet or variable
Saves a wallet address or any other value. name is 1-64 characters after trimming and unique in your account; description at most 256 characters; value must not be blank, at most 4 KiB, no NUL.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Length |
| description | string | Optional | Length |
| value | string | Required | Not blank, at most 4 KiB, no NUL. Stored and shown as is. |
namestringRequiredLength
1 – 64descriptionstringLength
≤ 256valuestringRequiredNot blank, at most 4 KiB, no NUL. Stored and shown as is.
Responses
- 200OK
Saved.
Response fields (10)
- 400Bad Request
bad_request, orwallet_var_invalid(theerrortext says which field).bad_requestwallet_var_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 409Conflict
wallet_var_name_taken.wallet_var_name_taken
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/renter/wallet-vars' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "Pearl wallet",
"description": "",
"value": "prl1qexamplewallet0000"
}'/api/v1/renter/wallet-vars/{wallet_var_id}Change a wallet or variable
Replaces name, description and value (send all three). If value changed, every template that uses it is updated and running instances with those templates pick up the new value with the next heartbeat; template_count and lease_count say how many. If the new value would make an instance's tasks larger than 64 KiB, nothing is changed (400 task_config_too_large).
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| wallet_var_id | path | string | Required |
Example |
wallet_var_idstring· pathRequiredidof your wallet / variable (fromGET /api/v1/renter/wallet-vars).Example
5b1c9e2d7a3f4e60Pattern^[0-9a-f]{16}$
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Length |
| description | string | Optional | Length |
| value | string | Required | Not blank, at most 4 KiB, no NUL. Stored and shown as is. |
namestringRequiredLength
1 – 64descriptionstringLength
≤ 256valuestringRequiredNot blank, at most 4 KiB, no NUL. Stored and shown as is.
Responses
- 200OK
Saved.
Response fields (12)
- 400Bad Request
bad_request,wallet_var_invalid(theerrortext says which field), ortask_config_too_large.bad_requestwallet_var_invalidtask_config_too_large
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
wallet_var_not_found: no such wallet / variable, or it is not yours.wallet_var_not_found
- 409Conflict
wallet_var_name_taken.wallet_var_name_taken
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PUT 'https://suanzu.ai/api/v1/renter/wallet-vars/5b1c9e2d7a3f4e60' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "Pearl wallet",
"description": "main",
"value": "prl1qnewwallet00000000"
}'/api/v1/renter/wallet-vars/{wallet_var_id}Delete a wallet or variable
Deletes a wallet / variable that no template uses. If templates still use it you get 409 wallet_var_in_use with templates; change those templates first.
- Scope
renter:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| wallet_var_id | path | string | Required |
Example |
wallet_var_idstring· pathRequiredidof your wallet / variable (fromGET /api/v1/renter/wallet-vars).Example
5b1c9e2d7a3f4e60Pattern^[0-9a-f]{16}$
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
wallet_var_not_found: no such wallet / variable, or it is not yours.wallet_var_not_found
- 409Conflict
wallet_var_in_use: templates still use it;templateslists them.wallet_var_in_use
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X DELETE 'https://suanzu.ai/api/v1/renter/wallet-vars/5b1c9e2d7a3f4e60' \
-H 'Authorization: Bearer sz_live_...'/api/v1/account/depositsList your credited deposits
On-chain USDT deposits that have been credited, newest first. target=rent_balance lists deposits to your rent balance and needs renter:read; target=fee_credit lists deposits to your host service-fee balance and needs host:read (otherwise 403 api_key_scope_denied).
- Scope
renter:read / host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| target | query | string | Required |
Values |
| page | query | integer | Optional | Range |
| page_size | query | integer | Optional | Range |
targetstring· queryRequiredrent_balance= deposits to your rent balance (needsrenter:read);fee_credit= deposits to your host service-fee balance (needshost:read).Values
rent_balancefee_creditpageinteger· queryRange
1 – 1000000Default1page_sizeinteger· queryRange
1 – 100Default20
Responses
- 200OK
One page of deposits.
Response fields (6)
- 400Bad Request
bad_target(targetmissing or invalid),bad_request.bad_targetbad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied(target=rent_balanceneedsrenter:read,target=fee_creditneedshost:read),api_key_ip_denied,api_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/account/deposits?target=rent_balance' \
-H 'Authorization: Bearer sz_live_...'/api/v1/account/deposits/pendingList deposits seen on chain but not credited yet
Up to 50 deposits that are on chain but still waiting for confirmations. amount is null when the on-chain amount cannot be shown exactly. Scope by target as in GET /api/v1/account/deposits.
- Scope
renter:read / host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| target | query | string | Required |
Values |
targetstring· queryRequiredrent_balance= deposits to your rent balance (needsrenter:read);fee_credit= deposits to your host service-fee balance (needshost:read).Values
rent_balancefee_credit
Responses
- 200OK
Pending deposits.
Response fields (5)
- 400Bad Request
bad_target.bad_target
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied(target=rent_balanceneedsrenter:read,target=fee_creditneedshost:read),api_key_ip_denied,api_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/account/deposits/pending?target=rent_balance' \
-H 'Authorization: Bearer sz_live_...'Host
Manage the machines you rent out. Needs host:read, host:write or host:exec.
/api/v1/host/machinesList your machines
Lists the machines you can see: your own plus those in groups shared with you (where the owner allows API access), limited to the key's groups. Without group this is the "all groups" view. Pages with page / per_page; a page past the end returns the last page. Starred machines come first, then the sort column (empty values always last), then display name.
summary covers all machines in scope and ignores connectivity, status and q. The *_counts fields count machines by filter value, for building filter menus. With a group-limited key, your ungrouped machines are not visible. Unknown query parameters are rejected with 400.
- Scope
host:read- API key
- Required
- Rate limit class
read
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| group | query | string | Optional | Device group ID ( |
| connectivity | query | string | Optional | Values |
| status | query | string | Optional | Comma-separated, any of: Example |
| reason | query | string | Optional | Only machines with this code in Pattern |
| gpu | query | string | Optional | Comma-separated GPU model names (full names as in |
| tag | query | string | Optional |
|
| task | query | string | Optional | Comma-separated: |
| oc | query | string | Optional | Overclock template filter. Comma-separated: |
| fan | query | string | Optional | Fan template filter. Same format as |
| price | query | string | Optional | Price template filter. Same format as |
| oc_v | query | string | Optional |
|
| fan_v | query | string | Optional | Same as |
| price_v | query | string | Optional | Same as |
| algo | query | string | Optional | Only machines whose compute tasks report this algorithm. Needs advanced features. Length |
| attention | query | string | Optional | Only machines with this task problem. Needs advanced features. Values |
| q | query | string | Optional | Case-insensitive search in machine ID prefix, display name, hostname, worker name, alias, LAN IP, GPU model and tag names. At most 64 characters. Length |
| sort | query | string | Optional | Sort column, one of the listed keys or Values |
| order | query | string | Optional | Values |
| page | query | integer | Optional | Range |
| per_page | query | integer | Optional | Range |
groupstring· queryDevice group ID (
idfromGET /api/v1/host/device-groups). Empty = all groups.connectivitystring· queryValues
onlineofflinestatusstring· queryComma-separated, any of:
available,rented,unlisted,unpriced,fault,noncompliant.Example
available,rentedreasonstring· queryOnly machines with this code in
status_reasons.Pattern
^[a-z0-9_]{1,64}$gpustring· queryComma-separated GPU model names (full names as in
gpus[].name), up to 32.tagstring· querynone(untagged), or comma-separated tag IDs (up to 1000).taskstring· queryComma-separated:
none, or compute task template IDs (32 hex). Up to 32. A template ID also matches machines that run its debug version (pass the source template ID, not the debug version's).ocstring· queryOverclock template filter. Comma-separated:
none,manual, or template IDs (32 hex). Up to 32.fanstring· queryFan template filter. Same format as
oc.pricestring· queryPrice template filter. Same format as
oc.oc_vstring· querynot_latestor a version number. Needs exactly one template ID inoc.fan_vstring· querySame as
oc_v, forfan.price_vstring· querySame as
oc_v, forprice.algostring· queryOnly machines whose compute tasks report this algorithm. Needs advanced features.
Length
≤ 64attentionstring· queryOnly machines with this task problem. Needs advanced features.
Values
zero_hashrategpu_missingstart_failedqstring· queryCase-insensitive search in machine ID prefix, display name, hostname, worker name, alias, LAN IP, GPU model and tag names. At most 64 characters.
Length
≤ 64sortstring· querySort column, one of the listed keys or
taskHash:<template id>.gpuCountsorts by the expected GPU count (expected_gpu_count, the most GPUs ever detected on the machine), so a machine that lost a GPU keeps its full count; offline machines are sorted too, and CPU-only machines count as 0.sharesAcc,sharesRejandsharesInvsort by the accepted, rejected and invalid shares of the running compute tasks.taskHash:<template id>(the 32-character lowercase hex ID of a compute task template) sorts by the hashrate of that template's task; other IDs are rejected withbad_request. Machines with no value are always listed last, whatever the order.Values
machinegpuStatusgpuModelsgpuCountgpuUtilvramUsagegpuTempcpucpuCorescpuTempmemorymemoryTotalmemoryUseddiskdiskSizediskTypenetworkpoweruptimeosdrivercudaagentoomlanIppublicIpstatusrestartssharesAccsharesRejsharesInvDefaultmachinePattern^taskHash:[0-9a-f]{32}$orderstring· queryValues
ascdescDefaultascpageinteger· queryRange
≥ 1Default1per_pageinteger· queryRange
1 – 1000Default50
Responses
- 200OK
One page of machines, plus summary and filter counts.
Response fields (371)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled(algo/attentionused but no machine in scope has advanced features), or an API key error.advanced_not_enabled
- 404Not Found
group_not_found: no such group, or you cannot use it (not yours, role too low, outside the key's groups, or API access not allowed).group_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
device_index_rebuilding: device data is being rebuilt. Retry shortly. Alsorequest_timeout.device_index_rebuildingrequest_timeout
Examples
curl 'https://suanzu.ai/api/v1/host/machines?status=available,rented' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/summaryGet machine totals, overall and per group
Totals for all machines you can see (all) and for each group that has visible machines (groups, keyed by group ID). Same Summary object as in the machine list. all.earnings is your whole account's earnings, even with a group-limited key. groups.<id>.earnings is null for groups shared with you (keys never see another account's earnings).
- Scope
host:read- API key
- Required
- Rate limit class
read
Responses
- 200OK
Totals.
Response fields (129)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
device_index_rebuilding: device data is being rebuilt. Retry shortly. Alsorequest_timeout.device_index_rebuildingrequest_timeout
Examples
curl 'https://suanzu.ai/api/v1/host/machines/summary' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}Get one of your machines
All fields of the list item, plus network, driver, removed-GPU and integrated-GPU details flattened into the same object. oc and autofan are filled only when the owner has advanced features and the machine has GPUs.
- Scope
host:read- API key
- Required
- Rate limit class
read
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Responses
- 200OK
The machine.
Response fields (314)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
device_index_rebuilding: device data is being rebuilt. Retry shortly. Alsorequest_timeout.device_index_rebuildingrequest_timeout
Examples
curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}Rename a machine
Renames the machine (alias) or changes its expected GPU count (expected_gpu_count). Give at least one field. A rename takes effect at once and is kept: the machine is sent the new name, and its system hostname is changed to it on the spot (inside a container only the name changes; the HOSTNAME variable in tasks is the new name). Later IP or group changes do not rename it. Saving the same name again also sets the system hostname. alias must not be empty. Names use letters, digits and hyphens, start with a letter or digit, do not end with a hyphen and are at most 63 characters. A machine whose Agent is older than 1.6.4-beta.2 gets worker-<id8> (<id8> = the first 8 characters of machine_id) as its pool name while its name starts with a digit. Changing expected_gpu_count of a listed machine also updates its listing. Needs the operator role on shared groups.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Request bodyapplication/json
Give at least one field. Unknown fields are rejected. Body at most 4 KiB.
| Name | Type | Required | Description |
|---|---|---|---|
| alias | string | Optional | The new name; the system hostname is changed to it too (not in containers). Length |
| expected_gpu_count | integer | Optional | How many GPUs the machine should have; at least the detected count. Range |
aliasstringThe new name; the system hostname is changed to it too (not in containers).
Length
1 – 63expected_gpu_countintegerHow many GPUs the machine should have; at least the detected count.
Range
1 – 64
Responses
- 200OK
The saved names.
Response fields (7)
- 400Bad Request
bad_request(no field, unknown field),alias_invalid(also an emptyalias),expected_gpu_count_invalid(below the detected GPU count or above 64).bad_requestalias_invalidexpected_gpu_count_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(needs operator), or an API key error.group_forbidden
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PATCH 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"alias": "rig-01"
}'/api/v1/host/machines/{machine_id}/tasksList the compute tasks of a machine
The machine's compute tasks with their latest stats. Use binding_id to pause, resume or restart a task. syncing: true (with empty lists) means the task configuration is still being written; retry shortly. Needs the machine owner's advanced features.
- Scope
host:read- API key
- Required
- Rate limit class
read
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Responses
- 200OK
Tasks.
Response fields (48)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled(the machine owner has not enabled advanced features), or an API key error.advanced_not_enabled
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
device_index_rebuilding: device data is being rebuilt. Retry shortly. Alsorequest_timeout.device_index_rebuildingrequest_timeout
Examples
curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/tasks' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}/tasksReplace the compute tasks of a machine
Sets the full list of compute tasks on one machine: tasks missing from items are removed, new ones are added, and changed GPU picks are updated (unchanged tasks keep running). An empty items removes all tasks. Each item is {template_id, gpus}; gpus is null (all GPUs) or a list of GPU bus IDs of this machine. A template can be used once per machine; at most 16 tasks. Get template IDs from GET /api/v1/host/task-templates. A debug version of the machine's group (the template_id of a task with debug: true) can be used here too; this is the only call that sets one on a machine. An offline machine gets the change when it comes back (deferred: offline). Needs the manager role on shared groups; the machine owner's advanced features must be enabled and the account not overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| items | object[] | Required | Length |
| items[].template_id | string | Required | — |
| items[].gpus | string[] | null | Required | GPU bus IDs, for example |
itemsobject[]RequiredLength
≤ 16items[].template_idstringRequireditems[].gpusstring[] | nullRequiredGPU bus IDs, for example
0000:01:00.0. null = all GPUs.
Responses
- 200OK
Saved.
addedhas the new tasks'binding_id;updated,removedandkeptare binding IDs.Response fields (8)
- 400Bad Request
bad_request(bad item, bad bus ID),task_template_duplicate,task_limit_reached,task_config_too_large.bad_requesttask_template_duplicatetask_limit_reachedtask_config_too_large
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in this shared group is too low),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
machine_not_found, ortemplate_not_found(no such template, or not usable on this machine).machine_not_foundtemplate_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PUT 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/tasks' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"items": [
{
"template_id": "9c2e5b7a1d3f4e6a8b0c2d4e6f8a0b1c",
"gpus": null
}
]
}'/api/v1/host/machines/{machine_id}/checksCheck a machine against the listing rules
Every listing rule with its result. pre are the rules checked before listing (price_unset, group_invalid, offline, gpu_dropped, gpu_driver, gpu_count_low, gpu_ecc_uncorrected, nvidia_runtime_missing, nvidia_toolkit_outdated, rent_env_unsupported, tools_missing, docker_down, runc_outdated, gpu_mixed, gpu_probe_failed, collect_invalid, disk_low, pcie_unstable). compare compares the machine with its listed specs (gpu_count_low, gpu_changed, cpu_changed, ram_low, disk_changed, driver_changed, pcie_degraded, pcie_changed, os_changed) and is empty when the machine has no listing snapshot. current and required vary by rule (number, string or list) and are null when unknown.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Responses
- 200OK
Check results.
Response fields (20)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
device_index_rebuilding: device data is being rebuilt. Retry shortly. Alsorequest_timeout.device_index_rebuildingrequest_timeout
Examples
curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/checks' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}/leasesList the rental history of a machine
Rentals of this machine under its current owner, newest first. Pages with a cursor: pass next_before as before for the next page; next_before is null on the last page. With an API key income is shown only on your own machines; on machines in groups shared with you show_income is false and every income is null.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
| before | query | integer | Optional | Only leases with a smaller ID. Omit for the newest. Range |
| limit | query | integer | Optional | Range |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58beforeinteger· queryOnly leases with a smaller ID. Omit for the newest.
Range
≥ 1limitinteger· queryRange
1 – 100Default20
Responses
- 200OK
One page of rentals.
Response fields (9)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/leases' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}/timelineList the commands and messages of a machine
Newest first. Use it to check a command you sent: find the item with kind: cmd and the cmd_id returned by POST /api/v1/host/machines/commands/reboot, upgrade, driver_install or task_restart (issued[].cmd_id). state is pending (not picked up yet), running, ok or error; note explains end states such as expired, timeout, rebooted, interrupted, not_delivered; latest_title is the newest result message. Poll every 10-15 s. Only limit is accepted (no paging): the newest 200 items at most. Items with kind: msg are other machine messages. script_preview is always null for API keys.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
| limit | query | integer | Optional | Number of items. Range |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58limitinteger· queryNumber of items.
Range
1 – 200Default10
Responses
- 200OK
Timeline items.
Response fields (28)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/timeline' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}/commands/{cmd_id}/messagesList the messages of one command
All messages of one command, oldest first: progress (info), the result (ok or error) and their log attachments (payload_gz, gzip + base64, or null). For task_logs the task log is in the ok message. A command that is not on this machine gives an empty list. With an API key, the messages of script commands are not returned (empty list).
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
| cmd_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58cmd_idstring· pathRequiredcmd_idfrom the command reply or the timeline.Example
6b1f0f2e-4c1a-4f5e-9d3e-2a7b8c9d0e1f
Responses
- 200OK
Messages of the command.
Response fields (7)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/commands/6b1f0f2e-4c1a-4f5e-9d3e-2a7b8c9d0e1f/messages' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}/historyGet history charts of a machine
Time series of one machine for 1 or 6 hours, or 1, 3, 7 or 30 days (kept for 30 days), on a fixed grid: point i is at start + i × step and covers the step seconds before it (1h: 60 points of 60 s, 6h: 360 of 60 s, 1d: 720 of 120 s, 3d: 864 of 300 s, 7d: 672 of 900 s, 30d: 720 of 3600 s). Values are null where nothing was reported. Each chart has one line per GPU (id = bus ID), one line for the machine (id empty) or rx / tx for the network, and total over all GPUs (null for machine charts). Metrics: gpu_power, gpu_fan, gpu_temp, gpu_mem_temp, gpu_util, gpu_mem_used (with used and total in GB), hashrate (one chart per algorithm in key, unit as reported), cpu_temp, cpu_util, mem_used, net. events lists the machine's messages in the same period (at most 1000, newest kept; with an API key, script command messages are left out). With metrics=hashrate only the hash rate charts are returned and events is null. Each request runs about 13 queries; poll it at most once per step.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
| range | query | string | Required | Values |
| to | query | integer | Optional | End of the period (UNIX seconds). Omit for now. Moved forward so that the period starts at most 30 days ago. Range |
| metrics | query | string | Optional |
Values |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58rangestring· queryRequiredValues
1h6h1d3d7d30dtointeger· queryEnd of the period (UNIX seconds). Omit for now. Moved forward so that the period starts at most 30 days ago.
30dcovers the whole 30 days, so it always returns the latest period.Range
≥ 1metricsstring· queryhashrate= only the hash rate charts.Values
hashrate
Responses
- 200OK
Charts and events.
Response fields (21)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
history_unavailable(the history store cannot be reached; retry later),device_index_rebuilding,request_timeout.history_unavailabledevice_index_rebuildingrequest_timeout
Examples
curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/history?range=1h' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}/faultsList the fault history of a machine
Problems the machine had (the status_reasons codes), one item per occurrence, newest first: when it showed up (raised_at), when it was gone (cleared_at, null while it lasts), the machine status then (state) and the platform action then (action: ok, hide or stop). Pages with a cursor: pass next_before as before; next_before is null on the last page.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
| before | query | integer | Optional |
Range |
| limit | query | integer | Optional | Range |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58beforeinteger· querynext_beforeof the previous page. Omit for the newest.Range
≥ 1limitinteger· queryRange
1 – 100Default20
Responses
- 200OK
One page of faults.
Response fields (8)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/faults' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}/remoteGet remote access state and connection details
Returns a root password. A machine can have up to 3 remote sessions at once: one from the web console and one per API key, each opened and closed on its own. remote is this key's session (null when this key has none open). remote.connect (SSH command, password, host key fingerprint) is included while you still have the operator role; otherwise the connect key is absent. others lists the machine's other sessions (web console, your other keys, or another account) with no password or SSH command. The password gives a root shell on the whole machine: treat the response as a secret and do not log it. ssh_command is empty until state is ready. Needs host:exec.
- Scope
host:exec- API key
- Required
- Rate limit class
remote
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Responses
- 200OK
Remote state.
Response fields (26)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
device_index_rebuilding: device data is being rebuilt. Retry shortly. Alsorequest_timeout.device_index_rebuildingrequest_timeout
Examples
curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/remote' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}/remoteOpen remote access to a machine
Opens a remote access session (root SSH through the relay). The response has only the session_id; get the SSH command and password with GET .../remote (wait for state: ready). Opening again with the same key reuses its session (same password). The web console and each key get their own session, up to 3 per machine; a new one beyond that gets 409 remote_too_many. If another account has a session open you get 409 remote_busy. Not allowed while the machine is rented. The session closes after 600 seconds idle, when it is closed, or when the key that opened it is deleted or expires. A security notice is sent when a key opens remote access from a new IP. Needs host:exec and the operator role.
- Scope
host:exec- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Responses
- 200OK
Session open.
Response fields (2)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(needs operator),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 409Conflict
rented,remote_busy(another account has a session open),remote_too_many(3 sessions are already open and this key has none),agent_unsupported(agent too old).rentedremote_busyremote_too_manyagent_unsupported
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
remote_unconfigured,remote_relay_unavailable(no relay confirmed; nothing was opened), orrequest_timeout.remote_unconfiguredremote_relay_unavailablerequest_timeout
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/remote' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}/remoteClose remote access to a machine
Without scope, closes this key's own session only and disconnects its connections; sessions opened from the web console or by other keys stay open. Needs the operator role. Returns 200 with closed: 0 when this key has no session. With scope=all, closes every remote session on the machine (web console, all keys, and another account's); this needs the operator role when all of them belong to your account and the manager role when any belongs to another account. closed is how many sessions were closed; each one is recorded on the machine timeline.
- Scope
host:exec- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
| scope | query | string | Optional |
Values |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58scopestring· queryallcloses every session on the machine. Omit to close only this key's own session.Values
all
Responses
- 200OK
Closed.
Response fields (2)
- 400Bad Request
invalid_scope(scopeis notall), orbad_request.invalid_scopebad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(needs operator, or manager withscope=allwhen another account has a session), or an API key error.group_forbidden
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X DELETE 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/remote' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/device-groupsList your device groups
Your own groups first, then groups shared with you (shared: true), each by creation time. Only groups the key can use are listed. The response is a JSON array.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Responses
- 200OK
Groups.
Response fields (20)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/device-groups' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/membershipsList groups shared with you
Groups other accounts have shared with you, oldest grant first. Only groups the key can use (owner allows API access, and within the key's groups).
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Responses
- 200OK
Memberships.
Response fields (7)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/memberships' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/accountGet your host balances
earn_balance (rent and referral income), credit_balance (service-fee credit), gift_balance (gift credit), the total of all three, what you can transfer and what you can withdraw. overdue_since / freeze_at are set while earn_balance is below 0 (overdue): if the account is still overdue at freeze_at, it becomes restricted and compute task, overclocking and wallet / variable changes fail with account_overdue_restricted until you top up. Always your own account, even with a group-limited key.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Responses
- 200OK
Balances.
Response fields (13)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/account' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/ledgerList your host balance transactions
Newest first. amount is positive for credits and negative for debits. For a rent row, get the per-lease breakdown with GET /api/v1/host/rent-payouts/{ledger_id}. type=transfer matches both transfer_out and transfer_in. Always your own account.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| page | query | integer | Optional | Range |
| page_size | query | integer | Optional | Range |
| type | query | string | Optional | Values |
pageinteger· queryRange
1 – 1000000Default1page_sizeinteger· queryRange
1 – 100Default20typestring· queryValues
feerentdepositoffsetgiftimportwithdrawwithdraw_refundtransferreferral
Responses
- 200OK
One page of transactions.
Response fields (13)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/ledger' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/rent-payouts/{ledger_id}Get the leases behind a rent payout
Breaks one rent row of your host ledger down by lease. Any group's machines can appear.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger_id | path | string | Required |
Example |
ledger_idstring· pathRequiredidof arentrow fromGET /api/v1/host/ledger. A positive integer without leading zeros.Example
2201Pattern^[1-9][0-9]{0,17}$
Responses
- 200OK
The payout and its leases.
Response fields (12)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
payout_not_found: no such row, not yours, or not arentrow.payout_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/rent-payouts/2201' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/earningsGet your rent earnings for a period
Earnings totals, by day, by machine and by group. Periods are UTC days; from is inclusive, to exclusive. For last month per group use range=last_month and read groups[]. (The rolling cards last_24h_usd, last_7d_usd and total_usd are in all.earnings / groups.<id>.earnings of GET /api/v1/host/machines/summary and in summary.earnings of the machine list, not here.) Without group this covers your whole account (even with a group-limited key). With an API key, group must be a group you own; a group shared with you returns 404 group_not_found (keys never see another account's earnings).
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| range | query | string | Optional |
Values |
| group | query | string | Optional | Device group ID. Omit for your whole account. |
rangestring· query7dand30dend today (UTC);month= this UTC month;last_month= the previous one.Values
7d30dmonthlast_monthDefault7dgroupstring· queryDevice group ID. Omit for your whole account.
Responses
- 200OK
Earnings.
Response fields (39)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
group_not_found: no such group, not yours, or outside the key's groups. With an API key a group shared with you also returns it.group_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/earnings' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/earnings/leasesList the leases that earned in a period
Leases with earnings in the period, one page at a time. Same range / group rules as GET /api/v1/host/earnings. A page past the end returns empty items.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| range | query | string | Optional |
Values |
| group | query | string | Optional | Device group ID. Omit for your whole account. |
| machine | query | string | Optional | Only this |
| q | query | string | Optional | Case-insensitive search in machine display name and group name. At most 64 characters. Length |
| sort | query | string | Optional |
Values |
| page | query | integer | Optional | Range |
| page_size | query | integer | Optional | Range |
rangestring· query7dand30dend today (UTC);month= this UTC month;last_month= the previous one.Values
7d30dmonthlast_monthDefault7dgroupstring· queryDevice group ID. Omit for your whole account.
machinestring· queryOnly this
machine_id.qstring· queryCase-insensitive search in machine display name and group name. At most 64 characters.
Length
≤ 64sortstring· queryrecent= newest start first,income= highest total first,hours= longest first,name= by display name.Values
recentincomehoursnameDefaultrecentpageinteger· queryRange
1 – 1000000Default1page_sizeinteger· queryRange
1 – 100Default20
Responses
- 200OK
One page of leases.
Response fields (16)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
group_not_found: no such group, not yours, or outside the key's groups. With an API key a group shared with you also returns it.group_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/earnings/leases' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/billingGet this month's service fee summary
Service fees for the current UTC month: billed minutes, amount due and charged, free machines, the discount tier and any free period. due and charged have 6 decimal places. Always your own account.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Responses
- 200OK
Fee summary.
Response fields (17)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/billing' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/billing/days/{day}Get the service fee bill of one day
The service fee bill of one UTC day: summary for the day and one item per billed machine (sorted by machine_id). day is the UTC midnight of that day in UNIX seconds (for example through_day from GET /api/v1/host/billing). Amounts are decimal strings with 6 decimal places. Always your own account.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| day | path | integer | Required | UTC midnight in UNIX seconds (a multiple of 86400). Example |
| page | query | integer | Optional | Range |
| per_page | query | integer | Optional | Range |
dayinteger· pathRequiredUTC midnight in UNIX seconds (a multiple of 86400).
Example
1762300800pageinteger· queryRange
1 – 1000000Default1per_pageinteger· queryRange
1 – 500Default100
Responses
- 200OK
The bill of the day.
Response fields (26)
- 400Bad Request
bad_request(dayis not a UTC midnight, or badpage/per_page).bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
bill_day_not_found: there is no bill for this day.bill_day_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/billing/days/1762300800' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/priceSet or clear rent prices
Sets the rent price of 1-500 machines. GPU machines use price_per_gpu_hr, CPU-only machines use price_per_cpu_hr (per CPU socket); send both to cover a mixed set. null clears the price (not allowed while the machine is listed). Prices are decimal strings, greater than 0 and at most 100, up to 3 decimal places.
rent_power_limit_w (per GPU, null = no limit) and rent_fan_mode apply to GPU machines only, and only when a price is set. Changing the price of a listed machine takes effect for new rentals.
Each machine is handled on its own: check results[].ok and results[].code. With an API key all machines must be in one group (400 cross_group). Needs the manager role on shared groups.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
Give at least one of price_per_gpu_hr and price_per_cpu_hr. Unknown fields are rejected. Body at most 64 KiB.
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Machine IDs ( Length |
| price_per_gpu_hr | string | null | Optional | USDT per GPU per hour. Pattern |
| price_per_cpu_hr | string | null | Optional | USDT per CPU socket per hour. Pattern |
| rent_power_limit_w | integer | null | Optional | Power limit per GPU while rented, in W. |
| rent_fan_mode | string | null | Optional | Fan mode while rented. Omit or Values |
machine_idsstring[]RequiredMachine IDs (
machine_id, not the device number). 1-500 items; duplicates are merged.Length
1 – 500price_per_gpu_hrstring | nullUSDT per GPU per hour.
nullclears it.Pattern
^(0|[1-9][0-9]{0,6})(\.[0-9]{1,3})?$price_per_cpu_hrstring | nullUSDT per CPU socket per hour.
nullclears it.Pattern
^(0|[1-9][0-9]{0,6})(\.[0-9]{1,3})?$rent_power_limit_winteger | nullPower limit per GPU while rented, in W.
null= no limit. Omit to keep. Must be within every GPU's allowed range.rent_fan_modestring | nullFan mode while rented. Omit or
nullto keep.Values
automaxnull
Responses
- 200OK
Per-machine results.
results[].codewhenokis false:machine_not_found,group_forbidden,price_unit_mismatch(no price given for this machine's unit),price_invalid,listed(cannot clear the price of a listed machine),power_range_unknown,power_limit_out_of_range.Response fields (6)
- 400Bad Request
bad_request(invalid body, unknown field, empty or more than 500machine_ids, badrent_fan_mode, no price field),cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/price' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58",
"8043d318-b8e8-4a3a-8fde-5daaf655d443"
],
"price_per_gpu_hr": "0.050"
}'/api/v1/host/machines/listingList or unlist machines on the market
listed: true puts 1-500 machines on the market; each must have a price and pass the listing checks (same checks as listing/precheck). listed: false takes them off the market; it does not stop an active rental. Machines that are already in the requested state return ok: true.
Each machine is handled on its own: check results[]. With an API key all machines must be in one group (400 cross_group). Needs the operator role on shared groups.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Machine IDs ( Length |
| listed | boolean | Required | — |
machine_idsstring[]RequiredMachine IDs (
machine_id, not the device number). 1-500 items; duplicates are merged.Length
1 – 500listedbooleanRequired
Responses
- 200OK
Per-machine results.
results[].codewhenokis false:machine_not_found,group_forbidden, and when listing alsoprice_unset,not_eligible(withreasons, seelisting/precheck),spec_syncing(hardware data is still syncing; retry shortly),group_invalid,master_pending(set as the master image; it cannot be listed until it reboots).Response fields (6)
- 400Bad Request
bad_request(invalid body,listedmissing, badmachine_ids),cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
device_index_rebuilding: device data is being rebuilt. Retry shortly. Alsorequest_timeout.device_index_rebuildingrequest_timeout
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/listing' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58"
],
"listed": true
}'/api/v1/host/machines/listing/precheckCheck whether machines can be listed
Runs the listing checks for 1-500 machines without changing anything. A machine that could be listed (or is already listed or rented) returns ok: true. Otherwise code says why; for not_eligible, reasons lists the problems, for example offline, gpu_dropped, gpu_driver, docker_down, nvidia_runtime_missing, disk_low, agent_outdated, gpu_count_low, pcie_unstable, owner_inactive, tools_missing, rent_env_unsupported, group_invalid, data_invalid. For a per-rule breakdown of one machine use GET /api/v1/host/machines/{machine_id}/checks.
Read-only (host:read), but with an API key all machines must still be in one group (400 cross_group).
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Machine IDs ( Length |
machine_idsstring[]RequiredMachine IDs (
machine_id, not the device number). 1-500 items; duplicates are merged.Length
1 – 500
Responses
- 200OK
Per-machine results.
results[].code:machine_not_found,group_forbidden,price_unset,not_eligible(withreasons),spec_syncing,master_pending.Response fields (6)
- 400Bad Request
bad_request,cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
device_index_rebuilding: device data is being rebuilt. Retry shortly. Alsorequest_timeout.device_index_rebuildingrequest_timeout
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/listing/precheck' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58",
"8043d318-b8e8-4a3a-8fde-5daaf655d443"
]
}'/api/v1/host/machines/{machine_id}/tasks/{binding_id}/pausePause a compute task
Stops one compute task on the machine and keeps it paused. Pausing a paused task returns 200. Get binding_id from GET /api/v1/host/machines/{machine_id}/tasks. Needs the manager role on shared groups, and the machine owner's advanced features must be enabled and the account not overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
| binding_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58binding_idstring· pathRequiredbinding_idof the task, fromGET /api/v1/host/machines/{machine_id}/tasks.Example
3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in this shared group is too low),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
machine_not_found, ortask_not_found(no such task on this machine).machine_not_foundtask_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/tasks/3f9a0c1d2e4b5a60/pause' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}/tasks/{binding_id}/resumeResume a paused compute task
Starts a paused compute task again. Resuming a running task returns 200. Not allowed while the machine is rented (409 rented). Same role and account requirements as pause.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
| binding_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58binding_idstring· pathRequiredbinding_idof the task, fromGET /api/v1/host/machines/{machine_id}/tasks.Example
3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in this shared group is too low),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
machine_not_found, ortask_not_found(no such task on this machine).machine_not_foundtask_not_found
- 409Conflict
rented: the machine is rented.rented
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/tasks/3f9a0c1d2e4b5a60/resume' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/commands/task_restartRestart a compute task
Sends a command to restart one compute task on exactly one machine. The command runs asynchronously when the machine next checks in (it expires after 600 seconds); a 200 means the command was issued, not that it ran. Check the result with GET /api/v1/host/machines/{machine_id}/timeline (issued[].cmd_id). Not issued (rejected[].reason): machine_not_found, task_not_found, group_forbidden (needs manager), agent_unsupported, rented, task_paused.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Length |
| args | object | Required | — |
| args.binding_id | string | Required | Pattern |
machine_idsstring[]RequiredLength
1 – 1argsobjectRequiredargs.binding_idstringRequiredPattern
^[0-9a-f]{16}$
Responses
- 200OK
Issued or rejected.
Response fields (7)
- 400Bad Request
bad_request(not exactly one machine, orargsis not{binding_id}).bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled(the machine owner has not enabled advanced features),account_overdue_restricted(the machine owner's account is overdue), or an API key error (seeKeyForbidden).advanced_not_enabledaccount_overdue_restricted
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
command_push_failed: the commands were not delivered and will not run. They show as failed (not delivered) in the device timeline, so it is safe to send them again right away.command_push_failed
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/commands/task_restart' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58"
],
"args": {
"binding_id": "3f9a0c1d2e4b5a60"
}
}'/api/v1/host/machines/commands/task_logsFetch the log of a compute task
Sends a command to one machine to send back the last 500 lines of one compute task's log. The command runs asynchronously when the machine next checks in (it expires after 600 seconds). Keep issued[0].cmd_id and poll GET /api/v1/host/machines/{machine_id}/commands/{cmd_id}/messages until it has an ok message (the log is in its payload_gz) or an error message. The log is returned as it is, without hiding wallets or passwords. Not issued (rejected[].reason): machine_not_found, task_not_found, group_forbidden (needs operator), agent_unsupported, rented. Needs the machine owner's advanced features (overdue accounts can still fetch logs).
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Length |
| args | object | Required | — |
| args.binding_id | string | Required | Pattern |
machine_idsstring[]RequiredLength
1 – 1argsobjectRequiredargs.binding_idstringRequiredPattern
^[0-9a-f]{16}$
Responses
- 200OK
Issued or rejected.
Response fields (7)
- 400Bad Request
bad_request(not exactly one machine, orargsis not{binding_id}).bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled(the machine owner has not enabled advanced features), or an API key error.advanced_not_enabled
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
command_push_failed: the commands were not delivered and will not run. They show as failed (not delivered) in the device timeline, so it is safe to send them again right away.command_push_failed
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/commands/task_logs' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58"
],
"args": {
"binding_id": "3f9a0c1d2e4b5a60"
}
}'/api/v1/host/machines/tasks/restartRestart all compute tasks of machines
Sends one task_restart command for every compute task that is not paused, on 1-500 machines (counted after removing duplicates); a machine with several tasks has several items in issued. Commands run asynchronously when each machine next checks in (they expire after 600 seconds); check them in GET /api/v1/host/machines/{machine_id}/timeline. Not issued (rejected[].reason): machine_not_found, task_none (no tasks), group_forbidden (needs manager), agent_unsupported, rented, task_paused (all tasks paused). With an API key all machines must be in one group (400 cross_group). Needs the machine owner's advanced features, and that account must not be overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Machine IDs ( Length |
machine_idsstring[]RequiredMachine IDs (
machine_id, not the device number). 1-500 items; duplicates are merged.Length
1 – 500
Responses
- 200OK
Issued and rejected machines.
Response fields (7)
- 400Bad Request
bad_request(badmachine_ids),cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled(the machine owner has not enabled advanced features),account_overdue_restricted(the machine owner's account is overdue), or an API key error (seeKeyForbidden).advanced_not_enabledaccount_overdue_restricted
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
command_push_failed: the commands were not delivered and will not run. They show as failed (not delivered) in the device timeline, so it is safe to send them again right away.command_push_failed
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/tasks/restart' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58",
"8043d318-b8e8-4a3a-8fde-5daaf655d443"
]
}'/api/v1/host/machines/tasks/redownloadReinstall compute tasks of machines
Sends one task_redownload command for every task of the chosen templates (template_ids, 1-100) on 1-500 machines (both counted after removing duplicates); a machine with several chosen tasks has several items in issued. Each machine downloads the package again while the current program keeps running, then switches to it; if the download fails the current program is not changed. Paused tasks and custom tasks without package_url are skipped; a machine with at least one task sent counts as issued. Commands run asynchronously when each machine next checks in (they expire after 600 seconds); check them in GET /api/v1/host/machines/{machine_id}/timeline. Not issued (rejected[].reason): machine_not_found, task_not_found (none of the chosen templates on this machine), group_forbidden (needs manager), agent_unsupported, rented, task_paused (all chosen tasks paused), task_no_package (the rest have no package). Template IDs are only matched against the machines' tasks; an unknown ID is not an error. With an API key all machines must be in one group (400 cross_group). Needs the machine owner's advanced features, and that account must not be overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Machine IDs ( Length |
| template_ids | string[] | Required | Compute task template IDs ( Length |
machine_idsstring[]RequiredMachine IDs (
machine_id, not the device number). 1-500 items; duplicates are merged.Length
1 – 500template_idsstring[]RequiredCompute task template IDs (
idfromGET /api/v1/host/task-templates, ortemplate_idin a machine'stasks.items).Length
1 – 100
Responses
- 200OK
Issued and rejected machines.
Response fields (7)
- 400Bad Request
bad_request(badmachine_idsortemplate_ids),cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled(the machine owner has not enabled advanced features),account_overdue_restricted(the machine owner's account is overdue), or an API key error (seeKeyForbidden).advanced_not_enabledaccount_overdue_restricted
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
command_push_failed: the commands were not delivered and will not run. They show as failed (not delivered) in the device timeline, so it is safe to send them again right away.command_push_failed
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/tasks/redownload' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58",
"8043d318-b8e8-4a3a-8fde-5daaf655d443"
],
"template_ids": [
"9c2e5b7a1d3f4e6a"
]
}'/api/v1/host/machines/tasks/pausePause all compute tasks of machines
Pauses every compute task on 1-500 machines, same as POST /api/v1/host/machines/{machine_id}/tasks/{binding_id}/pause for each task. Tasks already paused are left as they are; results[].tasks is how many tasks this request paused on that machine (0 = all were paused already, still ok: true). This changes the machine's task settings, not a command: an offline machine stops the tasks when it next checks in. Paused tasks do not count for the host service fee. Each machine is handled on its own (results[].code: machine_not_found, task_none (no tasks), group_forbidden (needs manager)); pausing is allowed while the machine is rented. With an API key all machines must be in one group (400 cross_group). Needs the machine owner's advanced features, and that account must not be overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Machine IDs ( Length |
machine_idsstring[]RequiredMachine IDs (
machine_id, not the device number). 1-500 items; duplicates are merged.Length
1 – 500
Responses
- 200OK
Per-machine results.
Response fields (6)
- 400Bad Request
bad_request(badmachine_ids),cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled(the machine owner has not enabled advanced features),account_overdue_restricted(the machine owner's account is overdue), or an API key error (seeKeyForbidden).advanced_not_enabledaccount_overdue_restricted
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/tasks/pause' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58",
"8043d318-b8e8-4a3a-8fde-5daaf655d443"
]
}'/api/v1/host/machines/tasks/resumeResume all compute tasks of machines
Resumes every paused compute task on 1-500 machines, same as POST /api/v1/host/machines/{machine_id}/tasks/{binding_id}/resume for each task. Running tasks are left as they are; results[].tasks is how many tasks this request resumed on that machine (0 = none were paused, still ok: true). This changes the machine's task settings, not a command: an offline machine starts the tasks when it next checks in. Each machine is handled on its own (results[].code: machine_not_found, task_none (no tasks), group_forbidden (needs manager), rented (not allowed while the machine is rented)). With an API key all machines must be in one group (400 cross_group). Needs the machine owner's advanced features, and that account must not be overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Machine IDs ( Length |
machine_idsstring[]RequiredMachine IDs (
machine_id, not the device number). 1-500 items; duplicates are merged.Length
1 – 500
Responses
- 200OK
Per-machine results.
Response fields (6)
- 400Bad Request
bad_request(badmachine_ids),cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled(the machine owner has not enabled advanced features),account_overdue_restricted(the machine owner's account is overdue), or an API key error (seeKeyForbidden).advanced_not_enabledaccount_overdue_restricted
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/tasks/resume' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58",
"8043d318-b8e8-4a3a-8fde-5daaf655d443"
]
}'/api/v1/host/machines/commands/rebootReboot machines
Sends a reboot command to 1-100 machines (counted after removing duplicates). The command runs asynchronously when each machine next checks in (it expires after 600 seconds); a 200 means the command was issued. Check the result with GET /api/v1/host/machines/{machine_id}/timeline (issued[].cmd_id). Not issued (rejected[].reason): machine_not_found, group_forbidden (needs operator), host_env_unsupported (only physical machines and VMs can be rebooted), agent_unsupported, command_pending, rented.
Needs host:exec. With an API key all machines must be in one group (400 cross_group).
- Scope
host:exec- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Length |
machine_idsstring[]RequiredLength
1 – 100
Responses
- 200OK
Issued and rejected machines.
Response fields (7)
- 400Bad Request
bad_request(invalid body, empty list, empty ID, more than 100 machines),cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
command_push_failed: the commands were not delivered and will not run. They show as failed (not delivered) in the device timeline, so it is safe to send them again right away.command_push_failed
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/commands/reboot' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58"
]
}'/api/v1/host/machines/commands/upgradeUpgrade the Agent on machines
Sends an upgrade command to 1-100 machines (counted after removing duplicates): each machine upgrades its Agent to the current stable version. Machines on the same LAN that already have the package share it with each other first; otherwise the machine downloads it. The command runs asynchronously when each machine next checks in (it expires after 600 seconds); a 200 means the command was issued. Compute tasks usually keep running. When the new version changes the service configuration (the systemd unit or the supervisor program configuration), the installer restarts the Agent service: tasks stop for about 1 minute and the Agent then starts them again. The current stable version is the plain text at https://down.suanzu.ai/VERSION (public, no key). A machine on a newer release is not changed, but a machine on a beta is moved to the stable version even when the beta is newer, so send only machines whose agent_version is lower (see Agent version under Business rules). Check the result with GET /api/v1/host/machines/{machine_id}/timeline (issued[].cmd_id), and the new version in agent_version of the machine. This path takes no args and always upgrades to the stable version (a body with any other field is a 400); upgrading to the latest beta (https://down.suanzu.ai/VERSION-beta) is offered only in the console. Not issued (rejected[].reason): machine_not_found, group_forbidden (needs operator), agent_unsupported, command_pending (another reboot, shutdown, upgrade, network change or driver install is not finished), rented.
Needs host:exec. With an API key all machines must be in one group (400 cross_group).
- Scope
host:exec- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Length |
machine_idsstring[]RequiredLength
1 – 100
Responses
- 200OK
Issued and rejected machines.
Response fields (7)
- 400Bad Request
bad_request(invalid body, empty list, empty ID, more than 100 machines),cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
command_push_failed: the commands were not delivered and will not run. They show as failed (not delivered) in the device timeline, so it is safe to send them again right away.command_push_failed
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/commands/upgrade' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58",
"8043d318-b8e8-4a3a-8fde-5daaf655d443"
]
}'/api/v1/host/machines/{machine_id}/driver-optionsList the NVIDIA driver versions a machine can install
The driver versions this machine can install with POST /api/v1/host/machines/commands/driver_install, the same list as the console. options has every supported version, sorted by version, not filtered by the GPUs; there is no default. The version installed now is listed too (installing it again is allowed). The GPUs do not block an install, even with no GPU: module is the recommended kernel module, and warn / module_warn say when a version or a module may not recognize a GPU on this machine. cuda_block not null (driver_cuda_hiveos) means cuda must be false. docker: true means the NVIDIA container toolkit is installed as well. When the machine cannot install a driver now you get 409 with the reason in code: group_forbidden (needs operator), driver_env_unsupported (container or WSL), driver_os_unsupported (only Ubuntu 22.04 / 24.04 and HiveOS), driver_os_unknown, driver_arch_unsupported (only x86_64), agent_unsupported, command_pending, listed (unlist it first), rented. The machine detail has the same reason in driver_block (without command_pending).
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Responses
- 200OK
Installable driver versions.
Response fields (17)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 409Conflict
The machine cannot install a driver now:
group_forbidden,driver_env_unsupported,driver_os_unsupported,driver_os_unknown,driver_arch_unsupported,agent_unsupported,command_pending,listed,rented.group_forbiddendriver_env_unsupporteddriver_os_unsupporteddriver_os_unknowndriver_arch_unsupportedagent_unsupportedcommand_pendinglistedrented
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/driver-options' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/commands/driver_installInstall or change the NVIDIA driver on a machine
Sends a driver install command to exactly one machine, the same as "Install / change" in the console. Get the versions from GET /api/v1/host/machines/{machine_id}/driver-options first. args: version (one of options[].version), cuda (also install the CUDA toolkit cuda_toolkit; must be false when cuda_block is not null) and accel (true: download from machines on the same LAN and SuanZu servers first, then NVIDIA; false: from NVIDIA only) are required. Either way, a matching package already on the machine (such as the one in the HiveOS driver pack) is used first and nothing is downloaded; it must match the checksum recorded by SuanZu. module is optional: open or proprietary; without it the recommended module from driver-options is used.
The machine must be unlisted and not rented. It stops your compute tasks, downloads and checks the driver, installs it and reboots; tasks start again after the reboot. The command runs asynchronously when the machine next checks in (it expires after 600 seconds). Follow it with GET /api/v1/host/machines/{machine_id}/commands/{cmd_id}/progress (stage, percent, log) and decide the result in GET /api/v1/host/machines/{machine_id}/timeline: state: ok with note: rebooted means the machine is back with the new driver_version (note: rebooted_no_gpu / rebooted_gpu_unreadable: back, but there is no NVIDIA GPU / no GPU can be read, so the version was not checked); state: error has the reason code in brackets in latest_title (for example [driver_download_failed], [driver_secure_boot], [driver_install_timeout]). The install must finish within 120 minutes of its start and the machine must be back within 10 minutes of the reboot. If it fails before the reboot the old driver stays. [driver_reboot_required] means the driver was installed but the time limit passed before the reboot, so the machine was not rebooted; reboot it yourself to load the new driver. Not issued (rejected[].reason): machine_not_found, group_forbidden (needs operator), driver_env_unsupported, driver_os_unsupported, driver_os_unknown, driver_arch_unsupported, agent_unsupported, command_pending, listed (unlist it first), rented.
Needs host:exec.
- Scope
host:exec- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Length |
| args | object | Required | — |
| args.version | string | Required | One of |
| args.cuda | boolean | Required | Also install the CUDA toolkit (nvcc). |
| args.accel | boolean | Required | Download from LAN machines and SuanZu servers first, then NVIDIA (false: from NVIDIA only). A matching package already on the machine is used first either way. |
| args.module | string | Optional | Kernel module to install. Optional; without it the recommended Values |
machine_idsstring[]RequiredLength
1 – 1argsobjectRequiredargs.versionstringRequiredOne of
options[].versionfromdriver-options.args.cudabooleanRequiredAlso install the CUDA toolkit (nvcc).
args.accelbooleanRequiredDownload from LAN machines and SuanZu servers first, then NVIDIA (false: from NVIDIA only). A matching package already on the machine is used first either way.
args.modulestringKernel module to install. Optional; without it the recommended
modulefromdriver-optionsis used.Values
openproprietary
Responses
- 200OK
Issued or rejected.
Response fields (7)
- 400Bad Request
bad_request(invalid body, for example atypefield),driver_param_invalid(not exactly one machine,argsmissesversion,cudaoraccelor has other keys than these andmodule,moduleis notopenorproprietary, orcuda: trueon HiveOS),driver_version_invalid(the version is not in this machine'sdriver-options).bad_requestdriver_param_invaliddriver_version_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
command_push_failed: the commands were not delivered and will not run. They show as failed (not delivered) in the device timeline, so it is safe to send them again right away.command_push_failed
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/commands/driver_install' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58"
],
"args": {
"version": "610.43.03",
"cuda": false,
"accel": true
}
}'/api/v1/host/machines/{machine_id}/commands/{cmd_id}/progressGet the progress and log of a long command
Stage, percent and log of a long command while it runs (driver install today). stage, pct, started_at, stage_at and at come from the newest log part; they are null until the machine sends the first part (also for commands that send no log). Driver install stages in order: prepare, download (only this one has pct), verify, stop_tasks, install, toolkit, cuda, reboot; other stage names can appear. log is the text from offset on (at most 64 KiB per call); call again with offset = next_offset to read only the new part. log_truncated: true means the log reached 256 KiB and the rest is not sent. Poll every 5 s while the command is running; whether it succeeded is decided in the timeline (state), not here. With an API key, the log of script commands is not returned.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
| cmd_id | path | string | Required |
Example |
| offset | query | integer | Optional | Byte offset to read the log from; use Range |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58cmd_idstring· pathRequiredcmd_idfrom the command reply or the timeline.Example
6b1f0f2e-4c1a-4f5e-9d3e-2a7b8c9d0e1foffsetinteger· queryByte offset to read the log from; use
next_offsetof the previous call.Range
0 – 262144Default0
Responses
- 200OK
Progress and log.
Response fields (11)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/commands/6b1f0f2e-4c1a-4f5e-9d3e-2a7b8c9d0e1f/progress' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}/messagesList the messages of a machine
The machine's messages (alerts, task progress, command results), newest first, with page numbers. Each item is the stored message: msg_id, type (info, ok, warn, error), source, title, created_at, payload_gz (gzip + base64 log attachment, or null) and, for command results, cmd_id. With an API key, messages that belong to script commands are left out (also from total).
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
| type | query | string | Optional | Only messages of this type. Values |
| page | query | integer | Optional | Range |
| per_page | query | integer | Optional | Range |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58typestring· queryOnly messages of this type.
Values
infookwarnerrorpageinteger· queryRange
1 – 1000000Default1per_pageinteger· queryRange
1 – 1000Default50
Responses
- 200OK
One page of messages.
Response fields (12)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/messages' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/gpusList all GPUs of your machines
One row per GPU across your machines (and the shared groups you can see), with filters, sorting and page numbers. counts are totals for the current filters except problem; models, algos and hash_algos list the values you can filter or sort by. problem filters GPUs with a problem: dropped, missing, temp_crit, temp_warn, fan, ecc, xid, idle, no_hash, or any. Sort by a column name or by hash:<algo> (hash rate of that algorithm).
- Scope
host:read- API key
- Required
- Rate limit class
read
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| group | query | string | Optional | Device group ID. Omit for all machines you can see. |
| model | query | string | Optional | GPU model name. |
| problem | query | string | Optional | Values |
| algo | query | string | Optional | Only GPUs running this algorithm. |
| connectivity | query | string | Optional | Values |
| sort | query | string | Optional |
|
| order | query | string | Optional | Values |
| q | query | string | Optional | Search machine names and GPU bus IDs (at most 64 characters). Length |
| page | query | integer | Optional | Range |
| per_page | query | integer | Optional | Range |
groupstring· queryDevice group ID. Omit for all machines you can see.
modelstring· queryGPU model name.
problemstring· queryValues
droppedmissingtemp_crittemp_warnfaneccxididleno_hashanyalgostring· queryOnly GPUs running this algorithm.
connectivitystring· queryValues
onlineofflinesortstring· querydevice,state,index,bus,model,vendor,vram,temp,mem_temp,fan,rpm,power,power_limit,util,mem_util,pstate,clock,core_offset,mem_clock,mem_offset,throttle,problems, orhash:<algo>.orderstring· queryValues
ascdescqstring· querySearch machine names and GPU bus IDs (at most 64 characters).
Length
≤ 64pageinteger· queryRange
1 – 1000000Default1per_pageinteger· queryRange
1 – 1000Default50
Responses
- 200OK
One page of GPUs.
Response fields (71)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
group_not_found: no such group, or you cannot use it (not yours, role too low, outside the key's groups, or API access not allowed).group_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
device_index_rebuilding: device data is being rebuilt. Retry shortly. Alsorequest_timeout.device_index_rebuildingrequest_timeout
Examples
curl 'https://suanzu.ai/api/v1/host/gpus' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/tagsList your device tags
Tags you can see: your own library first, then the libraries of the owners of groups shared with you (owner_id). A machine can only carry tags of its owner. Use the id values as tag_ids in POST /api/v1/host/machines/tags. Create, rename and delete your own tags with POST /api/v1/host/tags and /api/v1/host/tags/{tag_id}.
- Scope
host:read- API key
- Required
- Rate limit class
read
Responses
- 200OK
Tags.
Response fields (7)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/tags' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/tagsCreate a device tag
Creates a tag in your own tag library (at most 1000 tags per account). Tags of shared groups belong to the group owner's library and cannot be changed by you. A key limited to device groups cannot create, rename or delete tags (403 group_forbidden): the library is account-wide.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | 1-32 characters after trimming. |
| color | integer | Required | Color number used by the console. Range |
namestringRequired1-32 characters after trimming.
colorintegerRequiredColor number used by the console.
Range
0 – 7
Responses
- 200OK
Created.
Response fields (7)
- 400Bad Request
bad_request(missing field),tag_name_invalid(1-32 characters after trimming), ortag_color_invalid(0-7).bad_requesttag_name_invalidtag_color_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden: the key is limited to device groups and this changes an account-wide template or your tag library. Or an API key error.group_forbidden
- 409Conflict
tag_name_taken(you already have a tag with this name),tag_limit(1000 tags).tag_name_takentag_limit
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/tags' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "rack-1",
"color": 3
}'/api/v1/host/tags/{tag_id}Rename or recolor a device tag
Changes the name, the color or both of one of your own tags. Machines keep the tag. Same key rule as creating.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| tag_id | path | string | Required |
Example |
tag_idstring· pathRequiredidfromGET /api/v1/host/tags.Example
12Pattern^[1-9][0-9]*$
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Optional | 1-32 characters after trimming. |
| color | integer | Optional | Range |
namestring1-32 characters after trimming.
colorintegerRange
0 – 7
Responses
- 200OK
Changed.
Response fields (7)
- 400Bad Request
bad_request(missing field),tag_name_invalid(1-32 characters after trimming), ortag_color_invalid(0-7).bad_requesttag_name_invalidtag_color_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden: the key is limited to device groups and this changes an account-wide template or your tag library. Or an API key error.group_forbidden
- 404Not Found
tag_not_found: no such tag in your own library.tag_not_found
- 409Conflict
tag_name_taken.tag_name_taken
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PATCH 'https://suanzu.ai/api/v1/host/tags/12' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"color": 5
}'/api/v1/host/tags/{tag_id}Delete a device tag
Deletes one of your own tags and removes it from every machine that has it (removed_from = how many). Same key rule as creating.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| tag_id | path | string | Required |
Example |
tag_idstring· pathRequiredidfromGET /api/v1/host/tags.Example
12Pattern^[1-9][0-9]*$
Responses
- 200OK
Deleted.
Response fields (2)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden: the key is limited to device groups and this changes an account-wide template or your tag library. Or an API key error.group_forbidden
- 404Not Found
tag_not_found: no such tag in your own library.tag_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X DELETE 'https://suanzu.ai/api/v1/host/tags/12' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/price-templatesList price templates
Without group_id: your global templates in global (group is empty). With group_id of a group you own or that is shared with you: the group owner's global templates in global and that group's templates in group; these are the templates you can apply to machines in that group with POST /api/v1/host/machines/price-template.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| group_id | query | string | Optional | A group you own or that is shared with you. Omit for your own account-wide entries. |
group_idstring· queryA group you own or that is shared with you. Omit for your own account-wide entries.
Responses
- 200OK
Templates.
Response fields (19)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
group_not_found: no such group, or you cannot use it (not yours, role too low, outside the key's groups, or API access not allowed).group_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/price-templates' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/price-templatesCreate a price template
group_id: null creates an account-wide template; a group ID creates a template of that group (only groups you own). prices.gpu maps a GPU model name (show_name when present, otherwise name) to {price, power_w, fan}, prices.cpu a CPU model to a price; at least one row. Prices are decimal strings, more than 0 and at most 100 USDT per GPU (or CPU socket) per hour, at most 3 decimals; power_w is a positive integer or null (no limit); fan is auto or max. Creating a template does not change any machine; apply it with POST /api/v1/host/machines/price-template. A key limited to device groups can only create templates of its groups.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | 1-64 characters after trimming. |
| prices | object | Required |
|
| prices.gpu | object | Required | — |
| prices.gpu.* | object | Optional | — |
| prices.gpu.*.price | string | Required | More than 0, at most 100, at most 3 decimals. |
| prices.gpu.*.power_w | integer | null | Required | Power limit per GPU while rented; null = no limit. Range |
| prices.gpu.*.fan | string | Required | Values |
| prices.cpu | object | Required | — |
| prices.cpu.* | string | Optional | Price per CPU socket per hour. |
| group_id | string | null | Optional | null = account-wide. |
namestringRequired1-64 characters after trimming.
pricesobjectRequiredgpu: GPU model name (show_namewhen present, otherwisename) →{price, power_w, fan};cpu: CPU model → price. At least one row in all.prices.gpuobjectRequiredprices.gpu.*objectprices.gpu.*.pricestringRequiredMore than 0, at most 100, at most 3 decimals.
prices.gpu.*.power_winteger | nullRequiredPower limit per GPU while rented; null = no limit.
Range
≥ 1prices.gpu.*.fanstringRequiredValues
automaxprices.cpuobjectRequiredprices.cpu.*stringPrice per CPU socket per hour.
group_idstring | nullnull = account-wide.
Responses
- 200OK
Created.
Response fields (10)
- 400Bad Request
bad_request, ortemplate_invalid(theerrortext says which name, price,power_worfanis wrong).bad_requesttemplate_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden: the key is limited to device groups and this changes an account-wide template or your tag library. Or an API key error.group_forbidden
- 404Not Found
group_not_found: no such group, or you cannot use it (not yours, role too low, outside the key's groups, or API access not allowed).group_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/price-templates' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "Standard",
"prices": {
"gpu": {
"NVIDIA CMP 50HX": {
"price": "0.050",
"power_w": 200,
"fan": "auto"
}
},
"cpu": {}
},
"group_id": null
}'/api/v1/host/price-templates/{price_template_id}Change a price template
Changes the name, the prices or both (send at least one; prices replaces the whole table). Machines are not changed: prices applied earlier stay as they are until you apply the template again. Only templates of your own account and groups. An account-wide template cannot be changed with a key limited to device groups.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| price_template_id | path | string | Required |
Example |
price_template_idstring· pathRequiredidfromGET /api/v1/host/price-templates.Example
5d0c6a2e9b1f4c3a8e7d6b5a4c3b2a10
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Optional | — |
| prices | object | Optional |
|
| prices.gpu | object | Required | — |
| prices.gpu.* | object | Optional | — |
| prices.gpu.*.price | string | Required | More than 0, at most 100, at most 3 decimals. |
| prices.gpu.*.power_w | integer | null | Required | Power limit per GPU while rented; null = no limit. Range |
| prices.gpu.*.fan | string | Required | Values |
| prices.cpu | object | Required | — |
| prices.cpu.* | string | Optional | Price per CPU socket per hour. |
namestringpricesobjectgpu: GPU model name (show_namewhen present, otherwisename) →{price, power_w, fan};cpu: CPU model → price. At least one row in all.prices.gpuobjectRequiredprices.gpu.*objectprices.gpu.*.pricestringRequiredMore than 0, at most 100, at most 3 decimals.
prices.gpu.*.power_winteger | nullRequiredPower limit per GPU while rented; null = no limit.
Range
≥ 1prices.gpu.*.fanstringRequiredValues
automaxprices.cpuobjectRequiredprices.cpu.*stringPrice per CPU socket per hour.
Responses
- 200OK
Changed.
Response fields (10)
- 400Bad Request
bad_request, ortemplate_invalid(theerrortext says which name, price,power_worfanis wrong).bad_requesttemplate_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden: the key is limited to device groups and this changes an account-wide template or your tag library. Or an API key error.group_forbidden
- 404Not Found
template_not_found: no such template, or it is not of your account or your groups (or outside the key's groups).template_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PATCH 'https://suanzu.ai/api/v1/host/price-templates/5d0c6a2e9b1f4c3a8e7d6b5a4c3b2a10' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "Standard 2"
}'/api/v1/host/price-templates/{price_template_id}Delete a price template
Deletes the template. Machines keep the prices applied from it. Same permissions as changing it.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| price_template_id | path | string | Required |
Example |
price_template_idstring· pathRequiredidfromGET /api/v1/host/price-templates.Example
5d0c6a2e9b1f4c3a8e7d6b5a4c3b2a10
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden: the key is limited to device groups and this changes an account-wide template or your tag library. Or an API key error.group_forbidden
- 404Not Found
template_not_found: no such template, or it is not of your account or your groups (or outside the key's groups).template_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X DELETE 'https://suanzu.ai/api/v1/host/price-templates/5d0c6a2e9b1f4c3a8e7d6b5a4c3b2a10' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/task-templatesList compute task templates
Same group_id rule as GET /api/v1/host/price-templates. With group_id, defaults is the group's default task list (template_id and positions). Use the template id in POST /api/v1/host/machines/tasks/apply and PUT /api/v1/host/machines/{machine_id}/tasks. Templates include their variables as saved. Debug versions are not listed; a template's machine_count also counts machines that run its debug version (each machine once). Needs the advanced features of the account whose templates are listed (yours, or the group owner's).
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| group_id | query | string | Optional | A group you own or that is shared with you. Omit for your own account-wide entries. |
group_idstring· queryA group you own or that is shared with you. Omit for your own account-wide entries.
Responses
- 200OK
Templates.
Response fields (50)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled, or an API key error.advanced_not_enabled
- 404Not Found
group_not_found: no such group, or you cannot use it (not yours, role too low, outside the key's groups, or API access not allowed).group_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/task-templates' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/task-templatesCreate a compute task template
group_id: null creates an account-wide template (your own account, and only with a key that is not limited to device groups); a group ID creates a template of that group (needs the manager role on shared groups). The body is the same as a renter template (see "Compute task templates" in the introduction) plus the host-only fields oc_template_id, run_in_container, container_image and accel.forward. Creating a template does not change any machine; use it with POST /api/v1/host/machines/tasks/apply. Needs the advanced features of the account that owns the template, and that account must not be overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
A host compute task template. Same as RenterTaskTemplateDraft plus the host-only fields below.
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | — |
| kind | string | Required | Values |
| description | string | Optional | — |
| vars | object[] | Optional | Custom tasks only. Environment variables of the program (at most 64). Set |
| vars[].key | string | Required | Matches |
| vars[].value | string | Required | At most 4 KiB. Required even with |
| vars[].ref | string | null | Optional |
|
| custom | object | Optional | — |
| custom.start_command | string | Optional | Runs with |
| custom.package_url | string | Optional | Optional program package to download before starting. |
| custom.extract | boolean | Optional | Default |
| hive | object | Optional | — |
| hive.miner | string | Optional | Package directory name. Empty = taken from the |
| hive.coin | string | Optional | Passed as |
| hive.wallet | string | Optional | Replaces |
| hive.install_url | string | Optional | http(s) link to a |
| hive.algo | string | Optional | Passed as |
| hive.template | string | Optional | Macros are replaced in this field and in |
| hive.url | string | Optional | — |
| hive.pass | string | Optional | — |
| hive.user_config | string | Optional | — |
| accel | object | Optional | — |
| accel.download | boolean | Optional | Download acceleration for the program package (GitHub release files only). |
| accel.forward | object | null | Optional | Domain acceleration. The machines reach this |
| accel.forward.host | string | Optional | — |
| accel.forward.port | integer | Optional | Range |
| wallet_ref | string | null | Optional | HiveOS only. Take |
| follow | string | Optional | Follow the latest version: Values |
| run_in_container | boolean | Optional | Run the task in a container that sees only its GPUs. |
| container_image | string | Optional | Only with |
| oc_template_id | string | null | Optional | Overclocking template for the task's GPUs (an account-wide one of yours, or one of the same group). null = none. |
| group_id | string | null | Optional | null = account-wide. |
namestringRequiredkindstringRequiredValues
customhivedescriptionstringvarsobject[]Custom tasks only. Environment variables of the program (at most 64). Set
refto take the value from one of your wallets / variables; then sendvalueas an empty string, it is replaced.vars[].keystringRequiredMatches
^[A-Za-z_][A-Za-z0-9_]*$; noSUANZU_prefix and no reserved name.vars[].valuestringRequiredAt most 4 KiB. Required even with
ref(send an empty string).vars[].refstring | nullidof one of your wallets / variables, or null.customobjectcustom.start_commandstringRuns with
bash -c. At most 16 KiB.custom.package_urlstringOptional program package to download before starting.
custom.extractbooleanDefault
truehiveobjecthive.minerstringPackage directory name. Empty = taken from the
install_urlfile name.hive.coinstringPassed as
DIGITAL_CASH.hive.walletstringReplaces
%WAL%. Send an empty string withwallet_ref.hive.install_urlstringhttp(s) link to a
.tar.gz/.tgzpackage.hive.algostringPassed as
CUSTOM_ALGO.hive.templatestringMacros are replaced in this field and in
url,pass,user_config.hive.urlstringhive.passstringhive.user_configstringaccelobjectaccel.downloadbooleanDownload acceleration for the program package (GitHub release files only).
accel.forwardobject | nullDomain acceleration. The machines reach this
host:portthrough a SuanZu relay; it must appear in the task content. null = off.accel.forward.hoststringaccel.forward.portintegerRange
1 – 65535wallet_refstring | nullHiveOS only. Take
hive.walletfrom a wallet / variable (GET /api/v1/host/wallet-vars).followstringFollow the latest version:
latest= stable releases,latest_beta= pre-releases too. Only for a download link that is a GitHub release file with a version tag, otherwise 400follow_github_only. Not sent = "" (the template is replaced as a whole, so leaving it out turns following off).Values
latestlatest_betaDefaultrun_in_containerbooleanRun the task in a container that sees only its GPUs.
container_imagestringOnly with
run_in_container. Empty = the default image. Common images:GET /api/v1/host/images.oc_template_idstring | nullOverclocking template for the task's GPUs (an account-wide one of yours, or one of the same group). null = none.
group_idstring | nullnull = account-wide.
Responses
- 200OK
Created.
Response fields (24)
- 400Bad Request
bad_request,template_invalid(theerrortext says which field),hive_vars_unsupported,hive_wallet_required,wallet_var_unavailable,oc_template_unavailable(the overclocking template cannot be used by this template),container_image_invalid,forward_not_in_task(the acceleratedhost:portis not in the task content),forward_forbidden_address,forward_dns_error,task_config_too_large(withmachine_count),package_url_private_host,package_url_github_query,accel_download_github_only, orfollow_github_only(following the latest version is available only for GitHub release links with a version tag).bad_requesttemplate_invalidhive_vars_unsupportedhive_wallet_requiredwallet_var_unavailableoc_template_unavailablecontainer_image_invalidforward_not_in_taskforward_forbidden_addressforward_dns_errortask_config_too_largepackage_url_private_hostpackage_url_github_queryaccel_download_github_onlyfollow_github_only
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in the group is too low, or the template is account-wide and the key is limited to device groups),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
group_not_found: no such group, or you cannot use it (not yours, role too low, outside the key's groups, or API access not allowed).group_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
forward_unconfigured,forward_capacity_fullorforward_unavailable: domain acceleration cannot be set up right now; nothing was saved. Retry later or turnaccel.forwardoff. Alsorequest_timeout.forward_unconfiguredforward_capacity_fullforward_unavailablerequest_timeout
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/task-templates' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"group_id": null,
"name": "Pearl",
"kind": "hive",
"description": "",
"hive": {
"miner": "",
"coin": "PRL",
"wallet": "prl1qexampleaddress",
"install_url": "https://github.com/example/pearlfortune/releases/download/v1.2.3/pearlfortune-1.2.3.tar.gz",
"algo": "",
"template": "%WAL%.%WORKER_NAME%",
"url": "stratum+tcp://pool.example.com:3333",
"pass": "x",
"user_config": ""
},
"oc_template_id": null
}'/api/v1/host/task-templates/{task_template_id}Change a compute task template
Replaces the whole template (same body as creating, without group_id; group_id cannot be changed). When what the machines run changes, every machine using the template gets the new task with its next heartbeat and the task restarts; machine_count says how many. Account-wide templates can only be changed by their owner with a key that is not limited to device groups; group templates need the manager role on shared groups. Debug versions cannot be changed here (404 template_not_found), and changing a template does not change its debug versions.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| task_template_id | path | string | Required |
Example |
task_template_idstring· pathRequiredidfromGET /api/v1/host/task-templates.Example
9c2e5b7a1d3f4e6a8b0c2d4e6f8a0b1c
Request bodyapplication/json
A host compute task template. Same as RenterTaskTemplateDraft plus the host-only fields below.
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | — |
| kind | string | Required | Values |
| description | string | Optional | — |
| vars | object[] | Optional | Custom tasks only. Environment variables of the program (at most 64). Set |
| vars[].key | string | Required | Matches |
| vars[].value | string | Required | At most 4 KiB. Required even with |
| vars[].ref | string | null | Optional |
|
| custom | object | Optional | — |
| custom.start_command | string | Optional | Runs with |
| custom.package_url | string | Optional | Optional program package to download before starting. |
| custom.extract | boolean | Optional | Default |
| hive | object | Optional | — |
| hive.miner | string | Optional | Package directory name. Empty = taken from the |
| hive.coin | string | Optional | Passed as |
| hive.wallet | string | Optional | Replaces |
| hive.install_url | string | Optional | http(s) link to a |
| hive.algo | string | Optional | Passed as |
| hive.template | string | Optional | Macros are replaced in this field and in |
| hive.url | string | Optional | — |
| hive.pass | string | Optional | — |
| hive.user_config | string | Optional | — |
| accel | object | Optional | — |
| accel.download | boolean | Optional | Download acceleration for the program package (GitHub release files only). |
| accel.forward | object | null | Optional | Domain acceleration. The machines reach this |
| accel.forward.host | string | Optional | — |
| accel.forward.port | integer | Optional | Range |
| wallet_ref | string | null | Optional | HiveOS only. Take |
| follow | string | Optional | Follow the latest version: Values |
| run_in_container | boolean | Optional | Run the task in a container that sees only its GPUs. |
| container_image | string | Optional | Only with |
| oc_template_id | string | null | Optional | Overclocking template for the task's GPUs (an account-wide one of yours, or one of the same group). null = none. |
namestringRequiredkindstringRequiredValues
customhivedescriptionstringvarsobject[]Custom tasks only. Environment variables of the program (at most 64). Set
refto take the value from one of your wallets / variables; then sendvalueas an empty string, it is replaced.vars[].keystringRequiredMatches
^[A-Za-z_][A-Za-z0-9_]*$; noSUANZU_prefix and no reserved name.vars[].valuestringRequiredAt most 4 KiB. Required even with
ref(send an empty string).vars[].refstring | nullidof one of your wallets / variables, or null.customobjectcustom.start_commandstringRuns with
bash -c. At most 16 KiB.custom.package_urlstringOptional program package to download before starting.
custom.extractbooleanDefault
truehiveobjecthive.minerstringPackage directory name. Empty = taken from the
install_urlfile name.hive.coinstringPassed as
DIGITAL_CASH.hive.walletstringReplaces
%WAL%. Send an empty string withwallet_ref.hive.install_urlstringhttp(s) link to a
.tar.gz/.tgzpackage.hive.algostringPassed as
CUSTOM_ALGO.hive.templatestringMacros are replaced in this field and in
url,pass,user_config.hive.urlstringhive.passstringhive.user_configstringaccelobjectaccel.downloadbooleanDownload acceleration for the program package (GitHub release files only).
accel.forwardobject | nullDomain acceleration. The machines reach this
host:portthrough a SuanZu relay; it must appear in the task content. null = off.accel.forward.hoststringaccel.forward.portintegerRange
1 – 65535wallet_refstring | nullHiveOS only. Take
hive.walletfrom a wallet / variable (GET /api/v1/host/wallet-vars).followstringFollow the latest version:
latest= stable releases,latest_beta= pre-releases too. Only for a download link that is a GitHub release file with a version tag, otherwise 400follow_github_only. Not sent = "" (the template is replaced as a whole, so leaving it out turns following off).Values
latestlatest_betaDefaultrun_in_containerbooleanRun the task in a container that sees only its GPUs.
container_imagestringOnly with
run_in_container. Empty = the default image. Common images:GET /api/v1/host/images.oc_template_idstring | nullOverclocking template for the task's GPUs (an account-wide one of yours, or one of the same group). null = none.
Responses
- 200OK
Changed.
Response fields (25)
- 400Bad Request
bad_request,template_invalid(theerrortext says which field),hive_vars_unsupported,hive_wallet_required,wallet_var_unavailable,oc_template_unavailable(the overclocking template cannot be used by this template),container_image_invalid,forward_not_in_task(the acceleratedhost:portis not in the task content),forward_forbidden_address,forward_dns_error,task_config_too_large(withmachine_count),package_url_private_host,package_url_github_query,accel_download_github_only, orfollow_github_only(following the latest version is available only for GitHub release links with a version tag).bad_requesttemplate_invalidhive_vars_unsupportedhive_wallet_requiredwallet_var_unavailableoc_template_unavailablecontainer_image_invalidforward_not_in_taskforward_forbidden_addressforward_dns_errortask_config_too_largepackage_url_private_hostpackage_url_github_queryaccel_download_github_onlyfollow_github_only
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in the group is too low, or the template is account-wide and the key is limited to device groups),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
template_not_found: no such template, or you cannot see it (another account's account-wide template, a group outside the key's groups).template_not_found
- 409Conflict
forward_changed: domain acceleration of this template was changed meanwhile; read it again and resend.forward_changed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
forward_unconfigured,forward_capacity_fullorforward_unavailable: domain acceleration cannot be set up right now; nothing was saved. Retry later or turnaccel.forwardoff. Alsorequest_timeout.forward_unconfiguredforward_capacity_fullforward_unavailablerequest_timeout
Examples
curl -X PUT 'https://suanzu.ai/api/v1/host/task-templates/9c2e5b7a1d3f4e6a8b0c2d4e6f8a0b1c' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "Pearl",
"kind": "hive",
"description": "",
"hive": {
"miner": "",
"coin": "PRL",
"wallet": "prl1qnewaddress",
"install_url": "https://github.com/example/pearlfortune/releases/download/v1.2.4/pearlfortune-1.2.4.tar.gz",
"algo": "",
"template": "%WAL%.%WORKER_NAME%",
"url": "stratum+tcp://pool.example.com:3333",
"pass": "x",
"user_config": ""
},
"oc_template_id": null
}'/api/v1/host/task-templates/{task_template_id}Delete a compute task template
Deletes a template that no machine uses; otherwise 409 task_template_in_use with machine_count and machines (remove the task from those machines first). Machines that run its debug version count as using it (machines[].debug: true). The template is also taken out of group default task lists (removed_defaults = how many) and its debug versions are deleted with it (removed_debug = how many). A debug version itself cannot be deleted here (404 template_not_found). Same permissions as changing it.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| task_template_id | path | string | Required |
Example |
task_template_idstring· pathRequiredidfromGET /api/v1/host/task-templates.Example
9c2e5b7a1d3f4e6a8b0c2d4e6f8a0b1c
Responses
- 200OK
Deleted.
Response fields (3)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in the group is too low, or the template is account-wide and the key is limited to device groups),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
template_not_found: no such template, or you cannot see it (another account's account-wide template, a group outside the key's groups).template_not_found
- 409Conflict
task_template_in_use: machines still use it or its debug version (machine_count,machines;machines[].debugas inGET /api/v1/host/task-templates/{task_template_id}/usage).task_template_in_use
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
forward_unconfigured,forward_capacity_fullorforward_unavailable: domain acceleration cannot be set up right now; nothing was saved. Retry later or turnaccel.forwardoff. Alsorequest_timeout.forward_unconfiguredforward_capacity_fullforward_unavailablerequest_timeout
Examples
curl -X DELETE 'https://suanzu.ai/api/v1/host/task-templates/9c2e5b7a1d3f4e6a8b0c2d4e6f8a0b1c' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/task-templates/{task_template_id}/usageList machines that use a compute task template
Machines whose tasks use this template or its debug version: machine_count and the first 200 machines (each machine once; debug: true when it runs the debug version). Only machines you can see are counted; with a key limited to device groups, only machines in its groups. debug_count is the number of debug versions of this template in all groups together. Read only.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| task_template_id | path | string | Required |
Example |
task_template_idstring· pathRequiredidfromGET /api/v1/host/task-templates.Example
9c2e5b7a1d3f4e6a8b0c2d4e6f8a0b1c
Responses
- 200OK
Machines.
Response fields (7)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled, or an API key error.advanced_not_enabled
- 404Not Found
template_not_found: no such template, or you cannot see it (another account's account-wide template, a group outside the key's groups).template_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/task-templates/9c2e5b7a1d3f4e6a8b0c2d4e6f8a0b1c/usage' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/imagesList common images for compute tasks
Common container images for compute tasks that run in a container. Put the image value in container_image of a compute task template (POST /api/v1/host/task-templates). Templates store the image address, not the id, and you can also put any other image address there. gpu: false images are CPU images without CUDA runtime libraries. min_cuda is the lowest CUDA version the machine's driver must support (empty = no requirement); it is only a hint and is not checked when you save a template. The list is the same for every account and group.
- Scope
host:read- API key
- Required
- Rate limit class
read
Responses
- 200OK
Common images.
Response fields (6)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/images' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/quote-coinsList coins with market quotes
Coins that SuanZu has market quotes for. Put a code in quote_coin of a compute task template (POST /api/v1/host/task-templates) to show the estimated output of machines running that template; "" means none. The template only stores the code and does not check whether a quote exists now. at is when the quote was last updated (UNIX seconds). prod: false coins are still being tested and the console does not offer them yet. Sorted by project, then code. The list is the same for every account and group.
- Scope
host:read- API key
- Required
- Rate limit class
read
Responses
- 200OK
Coins with quotes.
Response fields (5)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/quote-coins' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/oc-templatesList overclocking templates
Same group_id rule as GET /api/v1/host/price-templates. Each template has the 6 overclocking values per GPU model in models; apply one with POST /api/v1/host/machines/oc-template. Needs the advanced features of the account whose templates are listed.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| group_id | query | string | Optional | A group you own or that is shared with you. Omit for your own account-wide entries. |
group_idstring· queryA group you own or that is shared with you. Omit for your own account-wide entries.
Responses
- 200OK
Templates.
Response fields (25)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled, or an API key error.advanced_not_enabled
- 404Not Found
group_not_found: no such group, or you cannot use it (not yours, role too low, outside the key's groups, or API access not allowed).group_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/oc-templates' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/oc-templatesCreate an overclocking template
group_id: null creates an account-wide template (your own account, and only with a key that is not limited to device groups); a group ID creates a template of that group (needs the manager role on shared groups). models maps 1-64 GPU model names (show_name when present, otherwise name) to all 6 values; each value is an integer in the range of PUT /api/v1/host/machines/{machine_id}/oc or null (not set). Creating a template does not change any machine; apply it with POST /api/v1/host/machines/oc-template. Needs advanced features, and the account must not be overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | 1-64 characters after trimming. |
| description | string | Optional | Length |
| models | object | Required | GPU model name ( |
| models.* | object | Optional | — |
| models.*.power_limit_w | integer | null | Required | — |
| models.*.core_lock_mhz | integer | null | Required | — |
| models.*.mem_lock_mhz | integer | null | Required | — |
| models.*.core_offset_mhz | integer | null | Required | — |
| models.*.mem_offset_mhz | integer | null | Required | — |
| models.*.fan_percent | integer | null | Required | — |
| models.*.advanced | object | null | Optional | Advanced settings of one GPU (or of one model in a template). An object = on; |
| models.*.advanced.xbar_ratio | number | Required | XBAR ratio, 0.05-1.00 with up to 4 decimals, or 0. |
| models.*.advanced.msvdd_vmin_mv | integer | Required | MSVDD minimum voltage offset in mV. Range |
| models.*.advanced.xbar_clock_offset_mhz | integer | Required | XBAR clock offset in MHz. Range |
| models.*.advanced.vcore_offset_mv | integer | Required | Core voltage offset in mV. Range |
| group_id | string | null | Optional | null = account-wide. |
namestringRequired1-64 characters after trimming.
descriptionstringLength
≤ 256modelsobjectRequiredGPU model name (
show_namewhen present, otherwisename; generic driver names are rejected) → all 6 values (each an integer or null), plus an optionaladvanced(an object turns advanced settings on for that model;nullor leaving it out = off).models.*objectmodels.*.power_limit_winteger | nullRequiredmodels.*.core_lock_mhzinteger | nullRequiredmodels.*.mem_lock_mhzinteger | nullRequiredmodels.*.core_offset_mhzinteger | nullRequiredmodels.*.mem_offset_mhzinteger | nullRequiredmodels.*.fan_percentinteger | nullRequiredmodels.*.advancedobject | nullAdvanced settings of one GPU (or of one model in a template). An object = on;
nullor leaving it out = off: the values are not sent to the machine or checked. Exactly these 4 keys;0= default (the factory value). Only 0 or negative values;xbar_ratiois a ratio. Out of range gives 400oc_param_out_of_rangewithfield,minandmax. The machine needs Agentoc.adv_agent_minor later; older Agents do not get these values.models.*.advanced.xbar_rationumberRequiredXBAR ratio, 0.05-1.00 with up to 4 decimals, or 0.
models.*.advanced.msvdd_vmin_mvintegerRequiredMSVDD minimum voltage offset in mV.
Range
-500 – 0models.*.advanced.xbar_clock_offset_mhzintegerRequiredXBAR clock offset in MHz.
Range
-1500 – 0models.*.advanced.vcore_offset_mvintegerRequiredCore voltage offset in mV.
Range
-200 – 0group_idstring | nullnull = account-wide.
Responses
- 200OK
Created.
Response fields (13)
- 400Bad Request
bad_request(for examplegroup_idsent when changing),template_invalid(bad name, description ormodels),oc_param_out_of_range(withfield,min,maxandmodel).bad_requesttemplate_invalidoc_param_out_of_range
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in the group is too low, or the template is account-wide and the key is limited to device groups),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
group_not_found: no such group, or you cannot use it (not yours, role too low, outside the key's groups, or API access not allowed).group_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/oc-templates' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "Low power",
"description": "",
"models": {
"NVIDIA CMP 50HX": {
"power_limit_w": 180,
"core_lock_mhz": null,
"mem_lock_mhz": null,
"core_offset_mhz": 100,
"mem_offset_mhz": 0,
"fan_percent": null
}
},
"group_id": null
}'/api/v1/host/oc-templates/{oc_template_id}Change an overclocking template
Replaces the name, description and models (send all three; group_id cannot be changed). Machines whose compute tasks use this template through oc_template_id get the new values with their next heartbeat; machines says how many. Machines the template was applied to directly keep the values they got. Account-wide templates can only be changed by their owner with a key that is not limited to device groups; group templates need the manager role on shared groups.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| oc_template_id | path | string | Required |
Example |
oc_template_idstring· pathRequiredidfromGET /api/v1/host/oc-templates.Example
7a1b2c3d4e5f60718293a4b5c6d7e8f9
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | 1-64 characters after trimming. |
| description | string | Optional | Length |
| models | object | Required | GPU model name ( |
| models.* | object | Optional | — |
| models.*.power_limit_w | integer | null | Required | — |
| models.*.core_lock_mhz | integer | null | Required | — |
| models.*.mem_lock_mhz | integer | null | Required | — |
| models.*.core_offset_mhz | integer | null | Required | — |
| models.*.mem_offset_mhz | integer | null | Required | — |
| models.*.fan_percent | integer | null | Required | — |
| models.*.advanced | object | null | Optional | Advanced settings of one GPU (or of one model in a template). An object = on; |
| models.*.advanced.xbar_ratio | number | Required | XBAR ratio, 0.05-1.00 with up to 4 decimals, or 0. |
| models.*.advanced.msvdd_vmin_mv | integer | Required | MSVDD minimum voltage offset in mV. Range |
| models.*.advanced.xbar_clock_offset_mhz | integer | Required | XBAR clock offset in MHz. Range |
| models.*.advanced.vcore_offset_mv | integer | Required | Core voltage offset in mV. Range |
namestringRequired1-64 characters after trimming.
descriptionstringLength
≤ 256modelsobjectRequiredGPU model name (
show_namewhen present, otherwisename; generic driver names are rejected) → all 6 values (each an integer or null), plus an optionaladvanced(an object turns advanced settings on for that model;nullor leaving it out = off).models.*objectmodels.*.power_limit_winteger | nullRequiredmodels.*.core_lock_mhzinteger | nullRequiredmodels.*.mem_lock_mhzinteger | nullRequiredmodels.*.core_offset_mhzinteger | nullRequiredmodels.*.mem_offset_mhzinteger | nullRequiredmodels.*.fan_percentinteger | nullRequiredmodels.*.advancedobject | nullAdvanced settings of one GPU (or of one model in a template). An object = on;
nullor leaving it out = off: the values are not sent to the machine or checked. Exactly these 4 keys;0= default (the factory value). Only 0 or negative values;xbar_ratiois a ratio. Out of range gives 400oc_param_out_of_rangewithfield,minandmax. The machine needs Agentoc.adv_agent_minor later; older Agents do not get these values.models.*.advanced.xbar_rationumberRequiredXBAR ratio, 0.05-1.00 with up to 4 decimals, or 0.
models.*.advanced.msvdd_vmin_mvintegerRequiredMSVDD minimum voltage offset in mV.
Range
-500 – 0models.*.advanced.xbar_clock_offset_mhzintegerRequiredXBAR clock offset in MHz.
Range
-1500 – 0models.*.advanced.vcore_offset_mvintegerRequiredCore voltage offset in mV.
Range
-200 – 0
Responses
- 200OK
Changed.
Response fields (14)
- 400Bad Request
bad_request(for examplegroup_idsent when changing),template_invalid(bad name, description ormodels),oc_param_out_of_range(withfield,min,maxandmodel).bad_requesttemplate_invalidoc_param_out_of_range
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in the group is too low, or the template is account-wide and the key is limited to device groups),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
oc_template_not_found: no such template, or you cannot see it.oc_template_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PUT 'https://suanzu.ai/api/v1/host/oc-templates/7a1b2c3d4e5f60718293a4b5c6d7e8f9' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "Low power",
"description": "",
"models": {
"NVIDIA CMP 50HX": {
"power_limit_w": 170,
"core_lock_mhz": null,
"mem_lock_mhz": null,
"core_offset_mhz": 100,
"mem_offset_mhz": 0,
"fan_percent": null
}
}
}'/api/v1/host/oc-templates/{oc_template_id}Delete an overclocking template
Deletes a template that no compute task template uses; otherwise 409 oc_template_in_use with templates. Machines keep the values applied from it. Same permissions as changing it.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| oc_template_id | path | string | Required |
Example |
oc_template_idstring· pathRequiredidfromGET /api/v1/host/oc-templates.Example
7a1b2c3d4e5f60718293a4b5c6d7e8f9
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in the group is too low, or the template is account-wide and the key is limited to device groups),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
oc_template_not_found: no such template, or you cannot see it.oc_template_not_found
- 409Conflict
oc_template_in_use: compute task templates still use it (templates).oc_template_in_use
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X DELETE 'https://suanzu.ai/api/v1/host/oc-templates/7a1b2c3d4e5f60718293a4b5c6d7e8f9' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/fan-templatesList auto-fan templates
Same group_id rule as GET /api/v1/host/price-templates. Apply one with POST /api/v1/host/machines/autofan-template. Needs the advanced features of the account whose templates are listed.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| group_id | query | string | Optional | A group you own or that is shared with you. Omit for your own account-wide entries. |
group_idstring· queryA group you own or that is shared with you. Omit for your own account-wide entries.
Responses
- 200OK
Templates.
Response fields (35)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled, or an API key error.advanced_not_enabled
- 404Not Found
group_not_found: no such group, or you cannot use it (not yours, role too low, outside the key's groups, or API access not allowed).group_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/fan-templates' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/fan-templatesCreate an auto-fan template
group_id: null creates an account-wide template (your own account, and only with a key that is not limited to device groups); a group ID creates a template of that group (needs the manager role on shared groups). params holds all 7 auto-fan values (FanParams). Creating a template does not change any machine; apply it with POST /api/v1/host/machines/autofan-template. Needs advanced features, and the account must not be overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | 1-64 characters after trimming. |
| description | string | Optional | Length |
| params | object | Required | The 7 auto-fan values. The Agent keeps the GPU core near |
| params.enabled | boolean | Required | — |
| params.target_core_c | integer | Required | Range |
| params.target_mem_c | integer | Required | Range |
| params.min_fan | integer | Required | Fan %. Range |
| params.max_fan | integer | Required | Fan %, at least Range |
| params.critical_c | integer | Required | At least Range |
| params.overheat | string | Required |
Values |
| group_id | string | null | Optional | null = account-wide. |
namestringRequired1-64 characters after trimming.
descriptionstringLength
≤ 256paramsobjectRequiredThe 7 auto-fan values. The Agent keeps the GPU core near
target_core_cand the memory neartarget_mem_cwith the fan betweenmin_fanandmax_fan.params.enabledbooleanRequiredparams.target_core_cintegerRequiredRange
30 – 95params.target_mem_cintegerRequiredRange
40 – 110params.min_fanintegerRequiredFan %.
Range
1 – 100params.max_fanintegerRequiredFan %, at least
min_fan.Range
1 – 100params.critical_cintegerRequiredAt least
target_core_c+ 10. Above it for 2 rounds the GPU is handled byoverheat; back belowcritical_c− 10 it recovers.Range
50 – 110params.overheatstringRequiredstop_task= stop the compute tasks;hold_gpu= take only that GPU out of its tasks.Values
stop_taskhold_gpugroup_idstring | nullnull = account-wide.
Responses
- 200OK
Created.
Response fields (18)
- 400Bad Request
bad_request(bad name or description,group_idsent when changing, orparamsnot exactly the 7 fields of the right types),autofan_param_invalid(a value out of range; withfield,min,max).bad_requestautofan_param_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in the group is too low, or the template is account-wide and the key is limited to device groups),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
group_not_found: no such group, or you cannot use it (not yours, role too low, outside the key's groups, or API access not allowed).group_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/fan-templates' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "Quiet",
"description": "",
"params": {
"enabled": true,
"target_core_c": 65,
"target_mem_c": 90,
"min_fan": 30,
"max_fan": 100,
"critical_c": 90,
"overheat": "stop_task"
},
"group_id": null
}'/api/v1/host/fan-templates/{fan_template_id}Change an auto-fan template
Replaces the name, description and params (send all three; group_id cannot be changed). Machines are not changed: machines the template was applied to keep the values they got until you apply it again. Account-wide templates can only be changed by their owner with a key that is not limited to device groups; group templates need the manager role on shared groups.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| fan_template_id | path | string | Required |
Example |
fan_template_idstring· pathRequiredidfromGET /api/v1/host/fan-templates.Example
4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | — |
| description | string | Optional | Length |
| params | object | Required | The 7 auto-fan values. The Agent keeps the GPU core near |
| params.enabled | boolean | Required | — |
| params.target_core_c | integer | Required | Range |
| params.target_mem_c | integer | Required | Range |
| params.min_fan | integer | Required | Fan %. Range |
| params.max_fan | integer | Required | Fan %, at least Range |
| params.critical_c | integer | Required | At least Range |
| params.overheat | string | Required |
Values |
namestringRequireddescriptionstringLength
≤ 256paramsobjectRequiredThe 7 auto-fan values. The Agent keeps the GPU core near
target_core_cand the memory neartarget_mem_cwith the fan betweenmin_fanandmax_fan.params.enabledbooleanRequiredparams.target_core_cintegerRequiredRange
30 – 95params.target_mem_cintegerRequiredRange
40 – 110params.min_fanintegerRequiredFan %.
Range
1 – 100params.max_fanintegerRequiredFan %, at least
min_fan.Range
1 – 100params.critical_cintegerRequiredAt least
target_core_c+ 10. Above it for 2 rounds the GPU is handled byoverheat; back belowcritical_c− 10 it recovers.Range
50 – 110params.overheatstringRequiredstop_task= stop the compute tasks;hold_gpu= take only that GPU out of its tasks.Values
stop_taskhold_gpu
Responses
- 200OK
Changed.
Response fields (18)
- 400Bad Request
bad_request(bad name or description,group_idsent when changing, orparamsnot exactly the 7 fields of the right types),autofan_param_invalid(a value out of range; withfield,min,max).bad_requestautofan_param_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in the group is too low, or the template is account-wide and the key is limited to device groups),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
fan_template_not_found: no such template, or you cannot see it.fan_template_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PUT 'https://suanzu.ai/api/v1/host/fan-templates/4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "Quiet",
"description": "",
"params": {
"enabled": true,
"target_core_c": 62,
"target_mem_c": 90,
"min_fan": 30,
"max_fan": 100,
"critical_c": 90,
"overheat": "hold_gpu"
}
}'/api/v1/host/fan-templates/{fan_template_id}Delete an auto-fan template
Deletes the template. Machines keep the auto-fan values applied from it. Same permissions as changing it.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| fan_template_id | path | string | Required |
Example |
fan_template_idstring· pathRequiredidfromGET /api/v1/host/fan-templates.Example
4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in the group is too low, or the template is account-wide and the key is limited to device groups),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
fan_template_not_found: no such template, or you cannot see it.fan_template_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X DELETE 'https://suanzu.ai/api/v1/host/fan-templates/4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/price-templateApply a price template to machines
Sets the rent price of 1-500 machines from a price template: GPU machines take the price, power limit and fan mode of their GPU model, CPU-only machines the price of their CPU model. Get template IDs from GET /api/v1/host/price-templates (with group_id for shared groups). Changing the price of a listed machine takes effect for new rentals.
Each machine is handled on its own: check results[].ok and results[].code. With an API key all machines must be in one group (400 cross_group). Needs the manager role on shared groups.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| template_id | string | Required | Length |
| machine_ids | string[] | Required | Machine IDs ( Length |
template_idstringRequiredLength
≥ 1machine_idsstring[]RequiredMachine IDs (
machine_id, not the device number). 1-500 items; duplicates are merged.Length
1 – 500
Responses
- 200OK
Per-machine results.
results[].codewhenokis false:machine_not_found,group_forbidden,template_not_found(the template cannot be used on this machine),gpu_unknown,gpu_mixed(different GPU models),cpu_unknown,template_no_price(no price for this machine's model).Response fields (6)
- 400Bad Request
bad_request(invalid body, notemplate_id, empty or more than 500machine_ids),cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 404Not Found
template_not_found: no such template, or you cannot see it.template_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
device_index_rebuilding: device data is being rebuilt. Retry shortly. Alsorequest_timeout.device_index_rebuildingrequest_timeout
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/price-template' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"template_id": "5d0c6a2e9b1f4c3a8e7d6b5a4c3b2a10",
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58"
]
}'/api/v1/host/machines/tagsAdd or remove tags on machines
Adds (mode: add) or removes (mode: remove) tags on 1-1000 machines. Get tag IDs from GET /api/v1/host/tags; a machine can only carry tags of its owner, at most 30. Machines that cannot be changed are listed in rejected with a reason: machine_not_found, group_forbidden (needs operator), tag_owner_mismatch (a tag does not belong to the machine owner), tag_limit. changed counts machines whose tags changed. With an API key all machines must be in one group (400 cross_group).
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Length |
| tag_ids | string[] | Required | Length |
| mode | string | Required | Values |
machine_idsstring[]RequiredLength
1 – 1000tag_idsstring[]RequiredLength
1 – 1000Pattern^[1-9][0-9]{0,17}$modestringRequiredValues
addremove
Responses
- 200OK
Done for the machines not in
rejected.Response fields (5)
- 400Bad Request
bad_request(invalid body, badmode, empty or too many IDs),cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
api_key_scope_denied,api_key_ip_denied, orapi_key_route_not_allowed.api_key_scope_deniedapi_key_ip_deniedapi_key_route_not_allowed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
device_index_rebuilding: device data is being rebuilt. Retry shortly. Alsorequest_timeout.device_index_rebuildingrequest_timeout
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/tags' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58"
],
"tag_ids": [
"12"
],
"mode": "add"
}'/api/v1/host/machines/tasks/applyAdd, replace or clear compute tasks on machines
Changes the compute tasks of 1-500 machines with one request. op: add adds the items (a template the machine already runs is skipped, see skipped); op: replace makes items the full task list; op: clear removes all tasks (items must be empty). Each item is {template_id, positions}: positions null = all GPUs, [] = no GPU (CPU task), or GPU positions 0-63 in ascending order, mapped to each machine's GPUs.
Each machine is handled on its own: check results[].ok and results[].code (machine_not_found, group_forbidden, template_not_found, task_limit_reached, task_config_too_large, gpu_unknown, gpu_position_out_of_range). An offline machine gets the change when it comes back (deferred: offline). With an API key all machines must be in one group (400 cross_group). Needs the manager role on shared groups; the machine owners' advanced features must be enabled and their accounts not overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| op | string | Required | Values |
| items | object[] | Required | Length |
| items[].template_id | string | Required | Length |
| items[].positions | integer[] | null | Optional | Length |
| machine_ids | string[] | Required | Length |
opstringRequiredValues
addreplaceclearitemsobject[]RequiredLength
≤ 16items[].template_idstringRequiredLength
≥ 1items[].positionsinteger[] | nullLength
≤ 64machine_idsstring[]RequiredLength
1 – 500
Responses
- 200OK
Per-machine results.
addedhas the new tasks'binding_id;updated,removedandkeptare binding IDs.Response fields (16)
- 400Bad Request
bad_request(badop,itemsorpositions, empty, duplicate or more than 500machine_ids),task_template_duplicate,task_limit_reached(more than 16 items),cross_group.bad_requesttask_template_duplicatetask_limit_reachedcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled(the machine owner has not enabled advanced features),account_overdue_restricted(the machine owner's account is overdue), or an API key error (seeKeyForbidden).advanced_not_enabledaccount_overdue_restricted
- 404Not Found
template_not_found: no such template, you cannot see it, or it is a debug version (set debug versions withPUT /api/v1/host/machines/{machine_id}/tasks).template_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/tasks/apply' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"op": "replace",
"items": [
{
"template_id": "9c2e5b7a1d3f4e6a8b0c2d4e6f8a0b1c",
"positions": null
}
],
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58"
]
}'/api/v1/host/machines/{machine_id}/ocSet overclocking values on one machine
Sets the overclocking values of one or more GPUs of one machine. cards maps a GPU bus ID (from gpus[].busid in GET /api/v1/host/machines/{machine_id}; the short form 01:00.0 is accepted) to all 6 values. GPUs not in cards are not touched: they keep whatever values they have now, including values set by other tools; they are not reset to default. Every value is an integer; 0 means "do not set, use the default". Allowed ranges: power_limit_w 1-2000, core_lock_mhz 1-5000, mem_lock_mhz 1-20000, core_offset_mhz and mem_offset_mhz -10000 to 10000, fan_percent 1-100.
Each GPU may also carry advanced (see OCAdvanced). The 6 values and advanced of a GPU are written as a whole: leaving advanced out turns advanced settings off for that GPU (its current values are left as they are).
Each save raises the machine's overclocking revision. The machine applies it on its next heartbeat; a rented machine keeps the values until the rental ends (deferred: rented), an offline machine applies them when it comes back (deferred: offline). To confirm, read oc in GET /api/v1/host/machines/{machine_id}: applied_revision equal to the returned revision means applied; rejected and result show failures.
If a target GPU is controlled by a compute task (its overclocking template), you get 409 oc_task_managed with tasks; send again with manual_only: true to switch this machine to manual-only overclocking. Needs the manager role on shared groups; the machine owner's advanced features must be enabled and the account not overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| cards | object | Required | GPU bus ID → the 6 values, plus an optional |
| cards.* | object | Optional | The 6 overclocking values of one GPU ( |
| cards.*.power_limit_w | integer | Required | Range |
| cards.*.core_lock_mhz | integer | Required | Range |
| cards.*.mem_lock_mhz | integer | Required | Range |
| cards.*.core_offset_mhz | integer | Required | Range |
| cards.*.mem_offset_mhz | integer | Required | Range |
| cards.*.fan_percent | integer | Required | Range |
| cards.*.advanced | object | null | Optional | Advanced settings of one GPU (or of one model in a template). An object = on; |
| cards.*.advanced.xbar_ratio | number | Required | XBAR ratio, 0.05-1.00 with up to 4 decimals, or 0. |
| cards.*.advanced.msvdd_vmin_mv | integer | Required | MSVDD minimum voltage offset in mV. Range |
| cards.*.advanced.xbar_clock_offset_mhz | integer | Required | XBAR clock offset in MHz. Range |
| cards.*.advanced.vcore_offset_mv | integer | Required | Core voltage offset in mV. Range |
| manual_only | boolean | Optional | Send |
cardsobjectRequiredGPU bus ID → the 6 values, plus an optional
advanced.cards.*objectThe 6 overclocking values of one GPU (
0= not set, use the default), plus an optionaladvanced.cards.*.power_limit_wintegerRequiredRange
0 – 2000cards.*.core_lock_mhzintegerRequiredRange
0 – 5000cards.*.mem_lock_mhzintegerRequiredRange
0 – 20000cards.*.core_offset_mhzintegerRequiredRange
-10000 – 10000cards.*.mem_offset_mhzintegerRequiredRange
-10000 – 10000cards.*.fan_percentintegerRequiredRange
0 – 100cards.*.advancedobject | nullAdvanced settings of one GPU (or of one model in a template). An object = on;
nullor leaving it out = off: the values are not sent to the machine or checked. Exactly these 4 keys;0= default (the factory value). Only 0 or negative values;xbar_ratiois a ratio. Out of range gives 400oc_param_out_of_rangewithfield,minandmax. The machine needs Agentoc.adv_agent_minor later; older Agents do not get these values.cards.*.advanced.xbar_rationumberRequiredXBAR ratio, 0.05-1.00 with up to 4 decimals, or 0.
cards.*.advanced.msvdd_vmin_mvintegerRequiredMSVDD minimum voltage offset in mV.
Range
-500 – 0cards.*.advanced.xbar_clock_offset_mhzintegerRequiredXBAR clock offset in MHz.
Range
-1500 – 0cards.*.advanced.vcore_offset_mvintegerRequiredCore voltage offset in mV.
Range
-200 – 0manual_onlybooleanSend
trueto switch the machine to manual-only overclocking (needed when a target GPU is controlled by a compute task).
Responses
- 200OK
Saved.
Response fields (3)
- 400Bad Request
bad_request(nocardsor more than 32, bad bus ID, or the bus ID is not an overclockable GPU of this machine),template_invalid(a value is missing or not an integer),oc_param_out_of_range(withfield,min,maxandbusid),oc_no_gpu(the machine has no GPU that supports overclocking).bad_requesttemplate_invalidoc_param_out_of_rangeoc_no_gpu
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in this shared group is too low),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 409Conflict
oc_task_managed: a target GPU is controlled by a compute task (taskslists them); send again withmanual_only: true.oc_task_managed
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PUT 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/oc' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"cards": {
"0000:01:00.0": {
"power_limit_w": 180,
"core_lock_mhz": 0,
"mem_lock_mhz": 0,
"core_offset_mhz": 100,
"mem_offset_mhz": 0,
"fan_percent": 70
},
"0000:02:00.0": {
"power_limit_w": 180,
"core_lock_mhz": 0,
"mem_lock_mhz": 0,
"core_offset_mhz": 100,
"mem_offset_mhz": 0,
"fan_percent": 70,
"advanced": {
"xbar_ratio": 0.306,
"msvdd_vmin_mv": 0,
"xbar_clock_offset_mhz": 0,
"vcore_offset_mv": -40
}
}
}
}'/api/v1/host/machines/{machine_id}/oc/reapplyApply the saved overclocking values again
Sends the saved overclocking values to the machine again without changing them (revision goes up by one). Use it after a failed apply or a GPU reset. The machine must be online and not rented. Needs the operator role on shared groups; the machine owner's advanced features must be enabled and the account not overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Responses
- 200OK
Sent again.
Response fields (3)
- 400Bad Request
oc_no_gpu.oc_no_gpu
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in this shared group is too low),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 409Conflict
offline,rented, oroc_not_set(nothing saved yet).offlinerentedoc_not_set
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/oc/reapply' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/machines/{machine_id}/oc/manual-onlyTurn manual-only overclocking on or off
With manual-only on, compute tasks no longer change this machine's overclocking (GPUs they controlled keep their current values) and batch template changes skip it (oc_manual_only). Turning it off lets compute tasks set their GPUs again. Setting the current state again changes nothing. Same role and account requirements as PUT /api/v1/host/machines/{machine_id}/oc.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| enabled | boolean | Required | — |
enabledbooleanRequired
Responses
- 200OK
Saved.
Response fields (3)
- 400Bad Request
bad_request(noenabled),oc_no_gpu.bad_requestoc_no_gpu
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in this shared group is too low),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PUT 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/oc/manual-only' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"enabled": true
}'/api/v1/host/machines/oc/reapplyApply the saved overclocking values again on several machines
Same as POST /api/v1/host/machines/{machine_id}/oc/reapply for 1-500 machines. Each machine is handled on its own (results[].code: machine_not_found, group_forbidden, offline, rented, oc_no_gpu, oc_not_set). With an API key all machines must be in one group (400 cross_group).
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Machine IDs ( Length |
machine_idsstring[]RequiredMachine IDs (
machine_id, not the device number). 1-500 items; duplicates are merged.Length
1 – 500
Responses
- 200OK
Per-machine results.
Response fields (7)
- 400Bad Request
bad_request,cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled(the machine owner has not enabled advanced features),account_overdue_restricted(the machine owner's account is overdue), or an API key error (seeKeyForbidden).advanced_not_enabledaccount_overdue_restricted
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/oc/reapply' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58"
]
}'/api/v1/host/machines/oc-templateApply an overclocking template to machines, or restore defaults
Applies an overclocking template to 1-500 machines: each GPU whose model is in the template's models gets those values; other GPUs are not touched. template_id: null resets every GPU of the machine to default, including values set by other tools. The key template_id is required. Get template IDs from GET /api/v1/host/oc-templates.
Applying copies each model's advanced too; when it is off for that model, advanced settings are turned off on those GPUs (their current values are left as they are). When restoring defaults, reset_advanced (default true) also resets advanced settings: GPUs that have them on get the factory values written back and then turned off; false leaves advanced settings as they are.
Each machine is handled on its own (results[].code: machine_not_found, group_forbidden, oc_no_gpu, oc_manual_only (manual-only is on), oc_template_unavailable (the template cannot be used on this machine), oc_template_no_model (no GPU model of this machine is in the template)). task_kept counts GPUs left to their compute task. With an API key all machines must be in one group (400 cross_group). Needs the manager role on shared groups.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Machine IDs ( Length |
| template_id | string | null | Required |
|
| reset_advanced | boolean | Optional | Only with |
machine_idsstring[]RequiredMachine IDs (
machine_id, not the device number). 1-500 items; duplicates are merged.Length
1 – 500template_idstring | nullRequirednullrestores the defaults.reset_advancedbooleanOnly with
template_id: null. Leaving it out =true: advanced settings are reset too.
Responses
- 200OK
Per-machine results.
Response fields (7)
- 400Bad Request
bad_request(notemplate_idkey, badmachine_ids, orreset_advancedwith atemplate_id),cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled(the machine owner has not enabled advanced features),account_overdue_restricted(the machine owner's account is overdue), or an API key error (seeKeyForbidden).advanced_not_enabledaccount_overdue_restricted
- 404Not Found
oc_template_not_found: no such template, or you cannot see it.oc_template_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/oc-template' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58"
],
"template_id": "7a1b2c3d4e5f60718293a4b5c6d7e8f9"
}'/api/v1/host/machines/{machine_id}/autofanSet auto-fan on one machine
Sets the 7 auto-fan values of one machine (FanParams; enabled: false turns auto-fan off). Each save raises the machine's overclocking revision (auto-fan travels with overclocking). The machine applies it on its next heartbeat; a rented machine keeps its settings until the rental ends (deferred: rented), an offline machine applies them when it comes back (deferred: offline). Read autofan in GET /api/v1/host/machines/{machine_id} to see the settings and live state. Needs the manager role on shared groups; the machine owner's advanced features must be enabled and the account not overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| params | object | Required | The 7 auto-fan values. The Agent keeps the GPU core near |
| params.enabled | boolean | Required | — |
| params.target_core_c | integer | Required | Range |
| params.target_mem_c | integer | Required | Range |
| params.min_fan | integer | Required | Fan %. Range |
| params.max_fan | integer | Required | Fan %, at least Range |
| params.critical_c | integer | Required | At least Range |
| params.overheat | string | Required |
Values |
paramsobjectRequiredThe 7 auto-fan values. The Agent keeps the GPU core near
target_core_cand the memory neartarget_mem_cwith the fan betweenmin_fanandmax_fan.params.enabledbooleanRequiredparams.target_core_cintegerRequiredRange
30 – 95params.target_mem_cintegerRequiredRange
40 – 110params.min_fanintegerRequiredFan %.
Range
1 – 100params.max_fanintegerRequiredFan %, at least
min_fan.Range
1 – 100params.critical_cintegerRequiredAt least
target_core_c+ 10. Above it for 2 rounds the GPU is handled byoverheat; back belowcritical_c− 10 it recovers.Range
50 – 110params.overheatstringRequiredstop_task= stop the compute tasks;hold_gpu= take only that GPU out of its tasks.Values
stop_taskhold_gpu
Responses
- 200OK
Saved.
Response fields (3)
- 400Bad Request
bad_request(paramsdoes not have exactly the 7 fields, a wrong type, or a badoverheat),autofan_param_invalid(a value out of range; withfield,min,max),oc_no_gpu(the machine has no GPU that supports it).bad_requestautofan_param_invalidoc_no_gpu
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in this shared group is too low),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PUT 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/autofan' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"params": {
"enabled": true,
"target_core_c": 65,
"target_mem_c": 90,
"min_fan": 30,
"max_fan": 100,
"critical_c": 90,
"overheat": "stop_task"
}
}'/api/v1/host/machines/autofan-templateApply an auto-fan template to machines, or turn auto-fan off
Copies the 7 values of an auto-fan template to 1-500 machines. template_id: null turns auto-fan off and keeps the other values. The key template_id is required. Get template IDs from GET /api/v1/host/fan-templates. Each machine is handled on its own (results[].code: machine_not_found, group_forbidden, oc_no_gpu, fan_template_unavailable (the template cannot be used on this machine)). With an API key all machines must be in one group (400 cross_group). Needs the manager role on shared groups.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| machine_ids | string[] | Required | Machine IDs ( Length |
| template_id | string | null | Required |
|
machine_idsstring[]RequiredMachine IDs (
machine_id, not the device number). 1-500 items; duplicates are merged.Length
1 – 500template_idstring | nullRequirednullturns auto-fan off.
Responses
- 200OK
Per-machine results.
Response fields (7)
- 400Bad Request
bad_request(notemplate_idkey, badmachine_ids),cross_group.bad_requestcross_group
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled(the machine owner has not enabled advanced features),account_overdue_restricted(the machine owner's account is overdue), or an API key error (seeKeyForbidden).advanced_not_enabledaccount_overdue_restricted
- 404Not Found
fan_template_not_found: no such template, or you cannot see it.fan_template_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/autofan-template' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"machine_ids": [
"314d1670-872d-4d8d-be94-a4ceea1c0c58"
],
"template_id": "4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e"
}'/api/v1/host/machines/{machine_id}/remote/passwordChange the remote access password
Changes a root password. Gives the open remote session a new password and a new session_id; the old password stops working and the session goes back to connecting. With an API key only a session opened by this same key can be changed (other sessions on the machine are not affected); otherwise 409 remote_not_open. Get the new password with GET /api/v1/host/machines/{machine_id}/remote (wait for state: ready). Deleting the key still closes the session. Needs host:exec and the operator role.
- Scope
host:exec- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| machine_id | path | string | Required |
Example |
machine_idstring· pathRequiredmachine_idof your machine (fromGET /api/v1/host/machines), not the device number.Example
314d1670-872d-4d8d-be94-a4ceea1c0c58
Responses
- 200OK
Password changed.
Response fields (2)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(needs operator), or an API key error.group_forbidden
- 404Not Found
machine_not_found: no such machine, or you cannot see it (other account, outside the key's groups, or API access not allowed for this shared group).machine_not_found
- 409Conflict
remote_not_open(no session on this machine opened by this key),rented,agent_unsupported.remote_not_openrentedagent_unsupported
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
- 503Service Unavailable
remote_unconfigured,remote_relay_unavailable.remote_unconfiguredremote_relay_unavailable
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/remote/password' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/wallet-varsList wallets and variables
Named values (wallet addresses, server addresses, ...) that compute task templates can refer to. Same group_id rule as GET /api/v1/host/price-templates. templates lists the task templates you can see that use each one. Values are returned as saved. Needs the advanced features of the account whose entries are listed.
- Scope
host:read- API key
- Required
- Rate limit class
read_pg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| group_id | query | string | Optional | A group you own or that is shared with you. Omit for your own account-wide entries. |
group_idstring· queryA group you own or that is shared with you. Omit for your own account-wide entries.
Responses
- 200OK
Entries.
Response fields (19)
- 400Bad Request
bad_request: a parameter is missing or invalid, or an unknown query parameter or body field was sent.bad_request
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
advanced_not_enabled, or an API key error.advanced_not_enabled
- 404Not Found
group_not_found: no such group, or you cannot use it (not yours, role too low, outside the key's groups, or API access not allowed).group_not_found
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl 'https://suanzu.ai/api/v1/host/wallet-vars' \
-H 'Authorization: Bearer sz_live_...'/api/v1/host/wallet-varsCreate a wallet or variable
group_id: null creates an account-wide entry (only for your own account, and only with a key that is not limited to device groups); a group ID creates an entry of that group (needs the manager role on shared groups). Names are unique per account-wide list or per group. Needs advanced features, and the account must not be overdue.
- Scope
host:write- API key
- Required
- Rate limit class
write
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| group_id | string | null | Optional | null = account-wide. |
| name | string | Required | Length |
| description | string | Optional | Length |
| value | string | Required | Not blank, no NUL. Length |
group_idstring | nullnull = account-wide.
namestringRequiredLength
1 – 64descriptionstringLength
≤ 256valuestringRequiredNot blank, no NUL.
Length
≤ 4096
Responses
- 200OK
Created.
Response fields (10)
- 400Bad Request
bad_request,wallet_var_invalid(bad name, description or value).bad_requestwallet_var_invalid
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in the group is too low, or the entry is account-wide and the key is limited to device groups),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
group_not_found: no such group, or you cannot use it (not yours, role too low, outside the key's groups, or API access not allowed).group_not_found
- 409Conflict
wallet_var_name_taken.wallet_var_name_taken
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X POST 'https://suanzu.ai/api/v1/host/wallet-vars' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"group_id": null,
"name": "main-wallet",
"description": "",
"value": "prl1qexampleaddress"
}'/api/v1/host/wallet-vars/{wallet_var_id}Change a wallet or variable
Replaces the name, description and value (send all three; group_id cannot be changed). Machines whose tasks use the entry get the new value with their next heartbeat; template_count and machine_count say how many were updated. Account-wide entries can only be changed by their owner with a key that is not limited to device groups; group entries need the manager role on shared groups.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| wallet_var_id | path | string | Required |
Example |
wallet_var_idstring· pathRequiredidfromGET /api/v1/host/wallet-vars.Example
0f1e2d3c4b5a69788796a5b4c3d2e1f0Pattern^[0-9a-f]{32}$
Request bodyapplication/json
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Length |
| description | string | Optional | Length |
| value | string | Required | Length |
namestringRequiredLength
1 – 64descriptionstringLength
≤ 256valuestringRequiredLength
≤ 4096
Responses
- 200OK
Changed.
Response fields (12)
- 400Bad Request
bad_request(for examplegroup_idsent),wallet_var_invalid,task_config_too_large(a task using it would get too large).bad_requestwallet_var_invalidtask_config_too_large
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in the group is too low, or the entry is account-wide and the key is limited to device groups),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
wallet_var_not_found: no such entry, or you cannot see it (another account's account-wide entry, a group outside the key's groups).wallet_var_not_found
- 409Conflict
wallet_var_name_taken.wallet_var_name_taken
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X PUT 'https://suanzu.ai/api/v1/host/wallet-vars/0f1e2d3c4b5a69788796a5b4c3d2e1f0' \
-H 'Authorization: Bearer sz_live_...' \
-H 'Content-Type: application/json' \
-d '{
"name": "main-wallet",
"description": "",
"value": "prl1qnewaddress"
}'/api/v1/host/wallet-vars/{wallet_var_id}Delete a wallet or variable
Deletes an entry that no task template uses; otherwise 409 wallet_var_in_use with templates. Same permissions as changing it.
- Scope
host:write- API key
- Required
- Rate limit class
write
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| wallet_var_id | path | string | Required |
Example |
wallet_var_idstring· pathRequiredidfromGET /api/v1/host/wallet-vars.Example
0f1e2d3c4b5a69788796a5b4c3d2e1f0Pattern^[0-9a-f]{32}$
Responses
- 200OK
Done.
Response fields (1)
- 401Unauthorized
api_key_invalid,api_key_expired, orunauthorized(no key sent).api_key_invalidapi_key_expiredunauthorized
- 403Forbidden
group_forbidden(your role in the group is too low, or the entry is account-wide and the key is limited to device groups),advanced_not_enabled,account_overdue_restricted, or an API key error.group_forbiddenadvanced_not_enabledaccount_overdue_restricted
- 404Not Found
wallet_var_not_found: no such entry, or you cannot see it (another account's account-wide entry, a group outside the key's groups).wallet_var_not_found
- 409Conflict
wallet_var_in_use: task templates still use it (templates).wallet_var_in_use
- 429Too Many Requests
rate_limited. Wait for the number of seconds in theRetry-Afterheader.rate_limited
Examples
curl -X DELETE 'https://suanzu.ai/api/v1/host/wallet-vars/0f1e2d3c4b5a69788796a5b4c3d2e1f0' \
-H 'Authorization: Bearer sz_live_...'