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:

ScopeAllows
renter:readRead your instances, balance, ledger, rent-balance deposits, compute task templates, instance tasks, tags, wallets and variables.
renter:writerenter:read + rent, stop, change startup command, restart the container, get connection details, manage compute task templates, instance tasks, tags, wallets and variables.
host:readRead 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:writehost: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:exechost: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 on code; error is 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_request on every endpoint; error names the parameter. (Only gpu and cpu of the market list may be repeated.) A body over the size limit gets 413 body_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 prefixes NVIDIA , GeForce and Tesla removed). Host endpoints use the full name the driver reports (NVIDIA CMP 50HX, NVIDIA GeForce RTX 4090) in gpus[].name, the gpu filter, gpu_counts and /host/gpus. Price template prices.gpu keys and overclocking template models keys use the GPU model name: show_name when the GPU has one (for example CMP 170HX, which the driver reports as Graphics Device), otherwise name. A generic driver name (Graphics Device, NVIDIA Graphics Device) is not accepted as a template key (400 template_invalid).

Pagination

StyleEndpointsNext page
cursor + pageSize (default 50, values above 200 count as 200)GET /api/v1/market/machinesPass next as cursor with the same filters and sort; next is empty on the last page
page + per_pageInstances (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 leasespage + 1 until you have total items
before + limit (default 20, max 100)GET /api/v1/host/machines/{machine_id}/leasesPass next_before as before; null on the last page
limit only (default 10, max 200)GET /api/v1/host/machines/{machine_id}/timelineNo 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).

ClassRequests per minute per keyUsed by
read120Market, host machine list / detail / tasks, GPUs, tags, preset images
read_pg30Balances, ledgers, earnings, billing, instance list, checks, groups, precheck, command timeline and progress, driver versions, messages, templates, wallets and variables, history charts, fault history
write30Writes: 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
order10Rent a machine
remote20Fetch 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.

OperationPollUntilIntervalTypical / limitOn failure
Rent deliveryGET /api/v1/renter/leases (tab=current)phase is running (pulling → preparing → starting → running)10 sImage pull may take up to 1800 s after the order; preparing and starting together up to 300 s after the pullThe 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 instanceGET /api/v1/renter/leases (tab=history)phase is released15 sAt least two machine rounds (about 30 s). No time limit: an offline machine stays stopping until it comes backBilling ends when you stop, whatever the phase. stopping only means the machine has not confirmed the cleanup yet
Startup commandGET /api/v1/renter/leasesstartup.rev equals the returned startup_rev and startup.state is not pending10 sNext heartbeatstartup.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}/timelineThe item with your cmd_id has state ok or error10-15 sPicked 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)
RebootSame as commandsstate: ok, note: rebooted15 sDone when the machine is back online with a newer boot_timenote: timeout when it is not back within 600 s after the reboot started
Agent upgradeTimeline, then GET /api/v1/host/machines/{machine_id}state: ok, then agent_version shows the new version (next heartbeat after the install)15 sMostly download time; the download alone may take up to 1800 sstate: 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 installTimeline; progress in GET /api/v1/host/machines/{machine_id}/commands/{cmd_id}/progressstate: 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 backstate: 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
OverclockingGET /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 call15 sOne or two heartbeats after the save. With deferred: rented only after the rental ends; with deferred: offline when the machine is backoc.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 tasksGET /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 revision15 sNext heartbeat plus the download of the program packagestate 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)Samestats_at is set and stats[] has your binding_id30 sUsually 15-35 s after the task reaches running. HiveOS tasks (kind: hive) only; custom tasks report no statsNo 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):

statusMeaningWhat you can doWhat the platform does
unpricedNo price set, not listed, no problemSet a price, then listNothing
unlistedPriced but not listed, no problemList itNothing
availableListed and rentableRent-related changes apply to new rentalsShows it on the market
noncompliantNot listed, and it has a problem (status_reasons)Fix the problem; listing fails with not_eligibleNothing
faultListed, but it has a problem (status_reasons, offline included)Fix it; it comes back by itselfHides it from the market until the problem is gone (you keep the listing)
rentedHas a rental that is not released yet (delivery and stopping included)See "Rented machines" belowStops 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.

CodeMeaningNot listedListedRented
offlineNo heartbeat for 120 srejecthidenotice
offline_rentedRented machine offline for 600 s (billing stops at the last heartbeat)--stop
price_unsetListed without a price for its unitreject--
group_invalidIts device group was deletedrejecthidenotice
gpu_droppedA GPU is not seen by the driverrejecthidestop
gpu_driverThe driver cannot read a GPUrejecthidestop
gpu_ecc_uncorrectedUncorrected ECC errorsrejecthidestop
gpu_probe_failedGPU data could not be read (2 rounds in a row)rejecthidestop
gpu_count_lowFewer GPUs than listed (or than expected_gpu_count)rejecthidestop
gpu_mixedMore than one GPU modelrejecthidenotice
gpu_changedGPU model or memory changed since listing-hidestop
driver_changedDriver or CUDA version changed since listing-hidestop
cpu_changedCPU model or socket count changed-hidestop
ram_lowLess memory than listed-hidestop
ram_moreMore memory than listed-refresh-
disk_changedDisk size changed by more than 1%, or disk type changed-hidestop
os_changedOS or kernel changed-refreshstop
pcie_degradedA GPU runs at a lower PCIe generation or width than listed-refreshstop
pcie_changedPCIe link changed, none lower-refreshnotice
pcie_unstablePCIe link changed 3 or more times in 24 hoursrejecthidenotice
docker_downDocker is not installed or not runningrejecthidestop
nvidia_runtime_missingNVIDIA GPUs but no NVIDIA container runtimerejecthidestop
runc_outdatedrunc older than 1.2.8 or unknownrejecthidestop
nvidia_toolkit_outdatedNVIDIA GPUs with an NVIDIA Container Toolkit older than 1.19.1 or unknownrejecthidenotice
disk_lowLess than 5 GiB free on the system diskrejecthidenotice
collect_invalidCPU, memory or disk data cannot be readrejecthidenotice
rent_env_unsupportedNot a physical machine or VM (container, WSL)rejecthidenotice
agent_outdatedAgent older than 1.2.0rejecthidenotice
tools_missingThe Agent tool package is still downloadingrejecthidenotice
identity_conflictTwo machines report with the same identityrejecthidenotice
owner_inactiveThe owner account has stopped renting outrejecthidenotice
data_invalidThe machine's data is brokenrejecthidenotice
oc_rental_tamperedOverclocking was changed by something else during a rental--stop
rent_container_lostThe renter's container is gone--stop
rent_isolation_failedNetwork 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

KindEndpointsOn 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-KeySend it again
Repeat with carePUT .../oc, oc-template, oc/reapply, PUT .../autofan, autofan-templateEach call raises revision and makes the machine apply the values again (same values, no harm). Read oc.revision first
Do not repeat blindlycommands/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 tagsRead 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: wait Retry-After seconds (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_rebuilding or request_timeout on a read: back off 2, 4, 8, 16 s and give up after 5 tries. 503 request_timeout on a write: read the state first (see above).
  • Rent with a new Idempotency-Key for 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 422 idempotency_mismatch.
  • Multi-machine writes with an API key: split machine_ids by group_id (from GET /api/v1/host/machines) and send one request per group; otherwise the request fails with 400 cross_group. Per request at most: 500 machines for price, price-template, listing, listing/precheck, tasks/apply, tasks/restart, tasks/redownload, tasks/pause, tasks/resume, oc-template, oc/reapply, autofan-template; 1000 for tags; 100 (after removing duplicates) for commands/reboot and commands/upgrade; exactly 1 for commands/task_restart, commands/task_logs and commands/driver_install. Results are per machine: always check results[] (or rejected[]), 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_pending until 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 with end_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/pending to see an incoming deposit and GET /api/v1/account/deposits / GET /api/v1/renter/account to 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), always MAJOR.MINOR.PATCH. commands/upgrade brings 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.2 becomes 1.5.7). So send it only to machines whose agent_version is lower than the stable version. Compare as semantic versions: MAJOR, MINOR and PATCH one by one as numbers; a -beta.N version 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_version null = not reported yet.
  • Host service fees. Your host account is overdue when earn_balance is 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/account has overdue_since and freeze_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 with account_overdue_restricted until 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/reapply and resuming host tasks (one task or tasks/resume) are rejected with rented; overclocking, overclocking templates, auto-fan and oc/manual-only are 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 with bash -c. With custom.package_url the file is downloaded first: .tar.gz, .tgz, .tar.xz and .tar are unpacked into the working directory when extract is true (the default); other files (.zip included) 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. key matches ^[A-Za-z_][A-Za-z0-9_]*$, does not start with SUANZU_ and is none of CUDA_DEVICE_ORDER, CUDA_VISIBLE_DEVICES, NVIDIA_VISIBLE_DEVICES, BASH_ENV, ENV, PATH. value is required (it may be empty), at most 4 KiB. A HiveOS template with vars fails with 400 hive_vars_unsupported.
  • Values from your wallets / variables. Set ref to the id of one of your wallets / variables and send value: "": the value is always replaced with the current value of that wallet / variable, and changing that value restarts the tasks that use it. An id that is not yours fails with 400 wallet_var_unavailable. For HiveOS, wallet_ref does the same for hive.wallet (send wallet: "").
  • Set for the program. SUANZU_TASK_ID, SUANZU_TASK_DIR, SUANZU_WORKER_NAME, SUANZU_GPU_BUSIDS (the task's GPU bus IDs, comma-separated) and CUDA_DEVICE_ORDER=PCI_BUS_ID. When the task uses only some GPUs, CUDA_VISIBLE_DEVICES and NVIDIA_VISIBLE_DEVICES hold their UUIDs. CPU tasks (gpus: []) get SUANZU_TASK_CPU=1 and no GPU.
  • HiveOS fields. install_url must be an http(s) link to a .tar.gz / .tgz package with <miner>/h-manifest.conf and <miner>/h-run.sh. Leave miner empty to take it from the file name: drop the extension, then keep what comes before the last - (pearlfortune-1.2.3.tar.gz gives pearlfortune). coin and algo reach the package as DIGITAL_CASH and CUSTOM_ALGO. In template, url, pass and user_config the macros %WAL% (the wallet), %WORKER_NAME%, %URL%, %URL_HOST% and %URL_PORT% (from the first address in url) are replaced; any other %...% is left as it is. %WAL% with an empty wallet and no wallet_ref fails with 400 hive_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, set follow to latest (stable releases) or latest_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 the tpl.auto_updated notification. Templates return the version in use as current_tag.
  • Is it running? A task runs when its states[] item has state: running and the same revision as the task. Only HiveOS tasks report stats (TaskStats, from the package's h-stats.sh).
Error response
{
  "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. 1.
    GETGet filter values for the market list

    Optional. Get the GPU and CPU model names you can filter by.

  2. 2.
    GETList machines available for rent

    Find a machine. Keep its machine_id and device_no.

  3. 3.
    GETList preset images

    Pick a preset image_id, or use your own public image.

  4. 4.
    POSTRent a machine

    Rent it with a new Idempotency-Key. Your balance must cover at least one hour of rent. Keep the returned id.

  5. 5.
    GETList your instances

    Poll until the instance's phase is running.

  6. 6.
    GETGet SSH connection details for an instance

    Get the SSH command and password. Treat them as a secret.

  7. 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. 1.
    GETList your machines

    Find the machine_id of your machines (use group to stay in one device group).

  2. 2.
    POSTSet or clear rent prices

    Set price_per_gpu_hr (GPU machines) or price_per_cpu_hr (CPU-only machines).

  3. 3.
    POSTCheck whether machines can be listed

    See which machines can be listed; reasons lists the problems.

  4. 4.
    GETCheck a machine against the listing rules

    Optional. Per-rule details for a machine that failed the check.

  5. 5.
    POSTList or unlist machines on the market

    Send listed: true to put the machines on the market.

Change the startup command, or run it again

  1. 1.
    PUTChange the startup command

    Save the new command. Saving the same command again does nothing, so you can safely retry this call.

  2. 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. 3.
    GETList your instances

    Poll until startup.rev equals the returned startup_rev and startup.state is no longer pending.

Set overclocking on one machine

  1. 1.
    GETGet one of your machines

    Read gpus[].busid and the current oc (revision, cards).

  2. 2.
    PUTSet overclocking values on one machine

    Send all 6 values for each GPU to change. On 409 oc_task_managed, send again with manual_only: true.

  3. 3.
    GETGet one of your machines

    Poll until oc.applied_revision equals the returned revision; check oc.rejected and oc.result for failures.

Upgrade the Agent and track it

  1. 1.
    GETList your machines

    Find the machines whose agent_version is lower than the stable version at https://down.suanzu.ai/VERSION (see Agent version under Business rules; a newer beta would be moved back to the stable version). Split the machine_id values by group_id, at most 100 per request.

  2. 2.
    POSTUpgrade the Agent on machines

    Send one request per group. Keep issued[].cmd_id; rejected[].reason lists the machines that got no command (for example rented, command_pending).

  3. 3.
    GETList the commands and messages of a machine

    Poll every 15 s until the item with your cmd_id has state ok or error. With error, the reason is in latest_title and note (expired, timeout, interrupted).

  4. 4.
    GETList the messages of a machine

    Optional. For a failed upgrade, read the install log in payload_gz.

  5. 5.
    GETList your machines

    After ok, agent_version shows the new version from the next heartbeat on.

Reboot machines and confirm they are back

  1. 1.
    GETList your machines

    Find the machines, for example reason=gpu_dropped. Split them by group_id, at most 100 per request.

  2. 2.
    POSTReboot machines

    Keep issued[].cmd_id. Rented machines are rejected with rented (unlisting with POST /api/v1/host/machines/listing does not end a rental).

  3. 3.
    GETList the commands and messages of a machine

    Poll every 15 s until the item with your cmd_id has state: ok and note: rebooted (the machine is back online and has booted again). note: timeout = not back within 600 s.

  4. 4.
    GETGet one of your machines

    Check that the problem is gone, for example gpus[].dropped and status_reasons.

Watch for offline machines

  1. 1.
    GETGet machine totals, overall and per group

    Every 5 minutes, read offline in all and in each of groups. Stop here when it is 0.

  2. 2.
    GETList your machines

    List them with connectivity=offline and per_page=1000, following page up to total_pages. last_heartbeat_at says 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. 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. 1.
    GETList your device groups

    Get the id of every group the key can use (yours and those shared with you, shared: true).

  2. 2.
    GETList your machines

    Without group you get every machine the key can see in one list. With group, one request per group; follow page up to total_pages (per_page at most 1000).

  3. 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. 1.
    POSTSave a wallet or variable

    Save the wallet address. Keep wallet_var.id.

  2. 2.
    POSTCreate a compute task template

    Custom task: add a vars item with ref set to that id and value: "". HiveOS task: set wallet_ref to that id and hive.wallet to "". Keep template.id.

  3. 3.
    PUTSet the compute tasks of an instance

    Put the template on a running instance.

  4. 4.
    GETGet the compute tasks of an instance

    Poll every 15 s until states[] has your binding_id with state: running and the same revision. HiveOS tasks then report stats (hash rate in params.khs).

  5. 5.
    PUTChange a wallet or variable

    Optional. Changing the value restarts every task that uses it.

Fetch the log of a compute task

  1. 1.
    GETList the compute tasks of a machine

    Find the task's binding_id.

  2. 2.
    POSTFetch the log of a compute task

    Send the command for that one machine and task. Keep issued[0].cmd_id; a rejected[].reason (for example rented, task_not_found) means no command was sent.

  3. 3.
    GETList the messages of one command

    Poll every 10 s until there is an ok or error message. The log is the payload_gz of the ok message (gzip + base64, last 500 lines).

Install or change the NVIDIA driver on one machine

  1. 1.
    POSTList or unlist machines on the market

    If the machine is listed, send listed: false first (a rented machine cannot install a driver).

  2. 2.
    GETList the NVIDIA driver versions a machine can install

    Pick a version from options; a 409 code says why the machine cannot install now. Use cuda: false when cuda_block is not null.

  3. 3.
    POSTInstall or change the NVIDIA driver on a machine

    Send it for that one machine. Keep issued[0].cmd_id; a rejected[].reason means no command was sent. Do not retry blindly.

  4. 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. 5.
    GETList the commands and messages of a machine

    Poll every 15 s until your cmd_id has state ok (note: rebooted, the machine is back with the new driver) or error (the code is in brackets in latest_title).

Market

Machines that are listed for rent. Public; no key needed.

GET/api/v1/market/machines

List 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

  • sortstring· query

    Sort order. Ties are broken by machine ID.

    Valuesprice_ascprice_desctotal_asctotal_desccores_descDefaultprice_ascExampleprice_asc

  • pageSizeinteger· query

    Machines per page. Values above 200 are treated as 200.

    Range0 – 200Default50

  • cursorstring· query

    The next value from the previous page. Omit for the first page. Only valid with the same sort.

  • gpustring[]· query

    GPU model, exactly as returned in gpu_models[].name of GET /api/v1/market/facets (for example CMP 50HX, URL-encoded). Repeat to match any of several models.

    ExampleCMP 50HXRepeatable

  • cpustring[]· query

    CPU model, exactly as returned in cpu_models[].name of GET /api/v1/market/facets. Repeat to match any of several models.

    Repeatable

  • cpuOnlystring· query

    Only machines without GPUs.

    Values1true0false

  • countinteger· query

    Exact number of GPUs. 0 = any.

    Range≥ 0Example8

  • vramMininteger· query

    Minimum memory per GPU, in GB.

    Range≥ 0

  • cudaMinnumber· query

    Minimum CUDA version the driver supports, for example 12.8.

    Range≥ 0

  • priceMaxstring· query

    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.

    Example0.100Pattern^\d{1,7}(\.\d{1,3})?$

  • minSocketsinteger· query

    Minimum number of CPU sockets.

    Range≥ 0

  • minCoresinteger· query

    Minimum total CPU cores.

    Range≥ 0

  • ramMininteger· query

    Minimum memory, in GB.

    Range≥ 0

  • storageMininteger· query

    Minimum total disk size, in GB.

    Range≥ 0

  • storageTypestring· query

    Disk type. (USB can appear in results but cannot be used as a filter.)

    ValuesNVMeSSDHDD

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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    request_timeout. Retry shortly. (A failed query is 500 internal.)

    • request_timeout

Examples

curl 'https://suanzu.ai/api/v1/market/machines?sort=price_asc&gpu=CMP%2050HX&count=8&priceMax=0.100'
GET/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

  • machine_idstring· pathRequired

    machine_id from the market list (a UUID). The device number (SZ-000014) is not accepted.

    Example314d1670-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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    request_timeout. Retry shortly. (A failed query is 500 internal.)

    • request_timeout

Examples

curl 'https://suanzu.ai/api/v1/market/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58'
GET/api/v1/market/facets

Get 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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    request_timeout. Retry shortly. (A failed query is 500 internal.)

    • 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.

GET/api/v1/renter/images

List 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/renter/images' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/renter/leases

List 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

  • tabstring· query

    ValuescurrenthistoryDefaultcurrent

  • phasestring· query

    Current tab only. delivery = any of pulling, preparing, starting.

    Valuesrunningdeliverypullingpreparingstarting

  • gpustring· query

    Current tab only. Exact GPU model, as in gpu_models.

  • sortstring· query

    Current tab only.

    ValuesmachinegpuModelsimagegpuUtilcpumemoryratestartedstatusDefaultmachine

  • orderstring· query

    Current tab only.

    Valuesascdesc

  • reasonstring· query

    History tab only. Only instances that ended for this end_reason.

    Valuesrenterbalance_exhaustedoffline_rentedverdictadmindelivery_failed

  • daysinteger· query

    History tab only. Only instances that ended in the last N days. 0 = any.

    Values073090

  • tagsstring· query

    Comma-separated tag IDs (from GET /api/v1/renter/tags); matches instances with any of them.

    Example12,15

  • qstring· query

    Case-insensitive search in device number, GPU model, image and tag names. At most 64 characters.

    Length≤ 64

  • pageinteger· query

    Range1 – 1000000Default1

  • per_pageinteger· query

    Default 50 on the current tab, 20 on the history tab.

    Range1 – 1000

Responses

  • 200OK

    One page of instances. The history tab has only items and 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/renter/leases?tags=12,15' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/renter/leases

Rent 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

  • Idempotency-Keystring· headerRequired

    Any unique string you choose, 1-64 visible ASCII characters (no spaces). Use a new one for every new order.

    Length1 – 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.

  • machine_idstringRequired

    From the market list.

  • device_nostringRequired

    From the market list; must match machine_id.

  • price_hrstringRequired

    The whole-machine price per hour you saw: total_price_hr from the market list, as is (decimal string). If the current price is different, the order is not placed and you get 409 price_changed with the current price.

    Pattern^(0|[1-9][0-9]{0,15})(\.[0-9]{1,3})?$

  • image_idstring

    A preset image ID from GET /api/v1/renter/images.

  • imagestring

    Your own image from a public registry, for example docker.io/library/ubuntu:22.04.

  • startup_cmdstring

    Shell command run inside the instance after it starts. At most 4096 bytes of UTF-8, no NUL.

    Length≤ 4096

  • tasksobject[]

    Compute tasks to run after delivery, from your own task templates (id from GET /api/v1/renter/task-templates). Each template at most once; gpus must be null (all GPUs) when ordering.

    Length≤ 16

  • tasks[].template_idstringRequired

    Template id from GET /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 malformed Idempotency-Key), idempotency_key_required, image_invalid (also an unknown image_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_request
    • idempotency_key_required
    • image_invalid
    • 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
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 in tasks does 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 current price_hr (whole machine) and price_per_hr (per GPU or CPU socket, may be absent); place a new order with the new price_hr and a new Idempotency-Key), balance_too_low (balance is below one hour of rent).

    • machine_not_rentable
    • machine_rented
    • machine_configuration_changed
    • price_changed
    • balance_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 the Retry-After header.

    • 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"
}'
GET/api/v1/renter/leases/{lease_id}/settles

List 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

  • pageinteger· query

    Range1 – 1000000Default1

  • per_pageinteger· query

    Range1 – 50Default20

  • atinteger· query

    period_end of a charge. Cannot be combined with page.

    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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/renter/leases/57/settles' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/renter/leases/{lease_id}/container-log

Read 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

Responses

  • 200OK

    The latest log.

    Response fields (8)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 phase running.

    • lease_not_running
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/renter/leases/57/container-log' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/renter/leases/{lease_id}/container-log

Ask 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

Responses

  • 200OK

    Request sent.

    Response fields (2)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 phase running.

    • lease_not_running
  • 429Too Many Requests

    container_log_rate_limited (requested less than 5 seconds ago; the body also has retry_after in seconds), or rate_limited. Both send a Retry-After header.

    • container_log_rate_limited
    • rate_limited

Examples

curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/container-log' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/renter/leases/{lease_id}/access

Get 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

Responses

  • 200OK

    Connection details.

    Response fields (8)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 404Not Found

    lease_not_found: no such lease, or it is not yours.

    • lease_not_found
  • 409Conflict

    lease_not_running, or remote_not_ready (the connection is not set up yet; retry shortly).

    • lease_not_running
    • remote_not_ready
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    remote_unconfigured, remote_relay_failed, or request_timeout.

    • remote_unconfigured
    • remote_relay_failed
    • request_timeout

Examples

curl 'https://suanzu.ai/api/v1/renter/leases/57/access' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/renter/leases/{lease_id}/stop

Stop 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited

Examples

curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/stop' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/renter/leases/{lease_id}/access/password

Change 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 404Not Found

    lease_not_found: no such lease, or it is not yours.

    • lease_not_found
  • 409Conflict

    lease_not_running, or remote_not_ready.

    • lease_not_running
    • remote_not_ready
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    remote_unconfigured, or request_timeout.

    • remote_unconfigured
    • request_timeout

Examples

curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/access/password' \
  -H 'Authorization: Bearer sz_live_...'
PUT/api/v1/renter/leases/{lease_id}/startup

Change 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

Request bodyapplication/json

  • startup_cmdstringRequired

    At 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_rev is unchanged.

    Response fields (2)
  • 400Bad Request

    bad_request (startup_cmd missing or not a string), startup_cmd_invalid.

    • bad_request
    • startup_cmd_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 404Not Found

    lease_not_found: no such lease, or it is not yours.

    • lease_not_found
  • 409Conflict

    lease_not_running, or rebuild_in_progress (a rebuild is in progress; try again after it finishes).

    • lease_not_running
    • rebuild_in_progress
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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"
}'
POST/api/v1/renter/leases/{lease_id}/startup/restart

Restart 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

Responses

  • 200OK

    The container is restarting.

    Response fields (2)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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_running
    • rebuild_in_progress
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/startup/restart' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/renter/leases/{lease_id}/rebuild

Rebuild 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[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.

  • image_idstring

    A preset image ID from GET /api/v1/renter/images.

  • imagestring

    Your own image from a public registry, for example docker.io/library/ubuntu:22.04.

  • startup_cmdstring

    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≤ 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, both image_id and image, 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_request
    • image_unchanged
    • image_invalid
    • image_registry_unsupported
    • image_gpu_mismatch
    • image_cuda_too_old
    • startup_cmd_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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), or agent_outdated (the machine's agent is too old; the host needs to upgrade it).

    • lease_not_running
    • rebuild_in_progress
    • agent_outdated
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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"
}'
GET/api/v1/renter/account

Get 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/renter/account' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/renter/ledger

List 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

  • pageinteger· query

    Range1 – 1000000Default1

  • page_sizeinteger· query

    Range1 – 100Default20

  • typestring· query

    Filter by type. referral = referral share credited to your renter balance.

    Valuesdepositrentreferral

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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/renter/ledger' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/renter/task-templates

List 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/renter/task-templates' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/renter/task-templates

Create 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.

  • namestringRequired
  • kindstringRequired

    Valuescustomhive

  • descriptionstring
  • varsobject[]

    Custom tasks only. Environment variables of the program (at most 64). Set ref to take the value from one of your wallets / variables; then send value as an empty string, it is replaced.

  • vars[].keystringRequired

    Matches ^[A-Za-z_][A-Za-z0-9_]*$; no SUANZU_ prefix and no reserved name.

  • vars[].valuestringRequired

    At most 4 KiB. Required even with ref (send an empty string).

  • vars[].refstring | null

    id of one of your wallets / variables, or null.

  • customobject
  • custom.start_commandstring

    Runs with bash -c. At most 16 KiB.

  • custom.package_urlstring

    Optional program package to download before starting.

  • custom.extractboolean

    Defaulttrue

  • hiveobject
  • hive.minerstring

    Package directory name. Empty = taken from the install_url file name.

  • hive.coinstring

    Passed as DIGITAL_CASH.

  • hive.walletstring

    Replaces %WAL%. Send an empty string with wallet_ref.

  • hive.install_urlstring

    http(s) link to a .tar.gz / .tgz package.

  • hive.algostring

    Passed as CUSTOM_ALGO.

  • hive.templatestring

    Macros are replaced in this field and in url, pass, user_config.

  • hive.urlstring
  • hive.passstring
  • hive.user_configstring
  • accelobject
  • accel.downloadboolean

    Download acceleration for the program package (GitHub release files only).

  • wallet_refstring | null

    HiveOS only. Take hive.wallet from one of your wallets / variables.

  • followstring

    Follow 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 400 follow_github_only. Not sent = "" (the template is replaced as a whole, so leaving it out turns following off).

    Valueslatestlatest_betaDefault

Responses

  • 200OK

    Created. template has the same fields as an item of GET /api/v1/renter/task-templates.

    Response fields (2)
  • 400Bad Request

    bad_request, template_invalid (the error text says which field), hive_vars_unsupported, hive_wallet_required, wallet_var_unavailable (a ref / wallet_ref is not one of yours), task_config_too_large, package_url_private_host, package_url_github_query, accel_download_github_only, or follow_github_only (following the latest version is available only for GitHub release links with a version tag).

    • bad_request
    • template_invalid
    • hive_vars_unsupported
    • hive_wallet_required
    • wallet_var_unavailable
    • task_config_too_large
    • package_url_private_host
    • package_url_github_query
    • accel_download_github_only
    • follow_github_only
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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
  }
}'
PUT/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

  • template_idstring· pathRequired

    id of your compute task template (from GET /api/v1/renter/task-templates).

    Example9c2e5b7a1d3f4e6aPattern^[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.

  • namestringRequired
  • kindstringRequired

    Valuescustomhive

  • descriptionstring
  • varsobject[]

    Custom tasks only. Environment variables of the program (at most 64). Set ref to take the value from one of your wallets / variables; then send value as an empty string, it is replaced.

  • vars[].keystringRequired

    Matches ^[A-Za-z_][A-Za-z0-9_]*$; no SUANZU_ prefix and no reserved name.

  • vars[].valuestringRequired

    At most 4 KiB. Required even with ref (send an empty string).

  • vars[].refstring | null

    id of one of your wallets / variables, or null.

  • customobject
  • custom.start_commandstring

    Runs with bash -c. At most 16 KiB.

  • custom.package_urlstring

    Optional program package to download before starting.

  • custom.extractboolean

    Defaulttrue

  • hiveobject
  • hive.minerstring

    Package directory name. Empty = taken from the install_url file name.

  • hive.coinstring

    Passed as DIGITAL_CASH.

  • hive.walletstring

    Replaces %WAL%. Send an empty string with wallet_ref.

  • hive.install_urlstring

    http(s) link to a .tar.gz / .tgz package.

  • hive.algostring

    Passed as CUSTOM_ALGO.

  • hive.templatestring

    Macros are replaced in this field and in url, pass, user_config.

  • hive.urlstring
  • hive.passstring
  • hive.user_configstring
  • accelobject
  • accel.downloadboolean

    Download acceleration for the program package (GitHub release files only).

  • wallet_refstring | null

    HiveOS only. Take hive.wallet from one of your wallets / variables.

  • followstring

    Follow 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 400 follow_github_only. Not sent = "" (the template is replaced as a whole, so leaving it out turns following off).

    Valueslatestlatest_betaDefault

Responses

  • 200OK

    Saved. template is the updated template.

    Response fields (2)
  • 400Bad Request

    bad_request, template_invalid (the error text says which field), hive_vars_unsupported, hive_wallet_required, wallet_var_unavailable (a ref / wallet_ref is not one of yours), task_config_too_large, package_url_private_host, package_url_github_query, accel_download_github_only, or follow_github_only (following the latest version is available only for GitHub release links with a version tag).

    • bad_request
    • template_invalid
    • hive_vars_unsupported
    • hive_wallet_required
    • wallet_var_unavailable
    • task_config_too_large
    • package_url_private_host
    • package_url_github_query
    • accel_download_github_only
    • follow_github_only
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • 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
  }
}'
DELETE/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

  • template_idstring· pathRequired

    id of your compute task template (from GET /api/v1/renter/task-templates).

    Example9c2e5b7a1d3f4e6aPattern^[0-9a-f]{16}$

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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_count says how many.

    • task_template_in_use
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl -X DELETE 'https://suanzu.ai/api/v1/renter/task-templates/9c2e5b7a1d3f4e6a' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/renter/leases/{lease_id}/tasks

Get 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

Responses

  • 200OK

    Tasks.

    Response fields (57)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/renter/leases/57/tasks' \
  -H 'Authorization: Bearer sz_live_...'
PUT/api/v1/renter/leases/{lease_id}/tasks

Set 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

Request bodyapplication/json

  • tasksobject[]Required

    Tasks, each from one of your templates. Each template at most once.

    Length≤ 16

  • tasks[].binding_idstring

    Optional. The current task to keep (from GET .../tasks).

  • tasks[].template_idstringRequired

    id from GET /api/v1/renter/task-templates.

  • tasks[].gpusstring[] | null

    GPU 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), or task_config_too_large.

    • bad_request
    • task_limit_reached
    • task_template_duplicate
    • task_gpus_invalid
    • task_config_too_large
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 404Not Found

    lease_not_found, or template_not_found (a template is not yours or does not exist).

    • lease_not_found
    • template_not_found
  • 409Conflict

    lease_not_running: the instance is not in phase running.

    • lease_not_running
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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
    }
  ]
}'
POST/api/v1/renter/leases/tasks

Change 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

  • lease_idsstring[]Required

    Lease IDs as decimal strings (id from GET /api/v1/renter/leases). 1-500 items; duplicates are merged.

    Length1 – 500Pattern^[1-9][0-9]{0,17}$

  • actionstringRequired

    Valuesaddreplacepauseresumerestartclear

  • tasksobject[]

    Tasks, each from one of your templates. Each template at most once.

    Length≤ 16

  • tasks[].binding_idstring

    Optional. The current task to keep (from GET .../tasks).

  • tasks[].template_idstringRequired

    id from GET /api/v1/renter/task-templates.

  • tasks[].gpusstring[] | null

    GPU 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), or task_config_too_large.

    • bad_request
    • task_limit_reached
    • task_template_duplicate
    • task_gpus_invalid
    • task_config_too_large
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • 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
    }
  ]
}'
POST/api/v1/renter/leases/{lease_id}/tasks/{binding_id}/pause

Pause 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

  • binding_idstring· pathRequired

    binding_id of the task, from GET /api/v1/renter/leases/{lease_id}/tasks.

    Example3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 404Not Found

    lease_not_found, or task_not_found (no such task on this instance).

    • lease_not_found
    • task_not_found
  • 409Conflict

    lease_not_running: the instance is not in phase running.

    • lease_not_running
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/tasks/3f9a0c1d2e4b5a60/pause' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/renter/leases/{lease_id}/tasks/{binding_id}/resume

Resume 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

  • binding_idstring· pathRequired

    binding_id of the task, from GET /api/v1/renter/leases/{lease_id}/tasks.

    Example3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 404Not Found

    lease_not_found, or task_not_found (no such task on this instance).

    • lease_not_found
    • task_not_found
  • 409Conflict

    lease_not_running: the instance is not in phase running.

    • lease_not_running
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/tasks/3f9a0c1d2e4b5a60/resume' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/renter/leases/{lease_id}/tasks/{binding_id}/restart

Restart 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

  • binding_idstring· pathRequired

    binding_id of the task, from GET /api/v1/renter/leases/{lease_id}/tasks.

    Example3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 404Not Found

    lease_not_found, or task_not_found (no such task on this instance).

    • lease_not_found
    • task_not_found
  • 409Conflict

    lease_not_running, or task_paused (resume the task first).

    • lease_not_running
    • task_paused
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/tasks/3f9a0c1d2e4b5a60/restart' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/renter/leases/{lease_id}/tasks/{binding_id}/reinstall

Download 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

  • binding_idstring· pathRequired

    binding_id of the task, from GET /api/v1/renter/leases/{lease_id}/tasks.

    Example3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 404Not Found

    lease_not_found, or task_not_found (no such task on this instance).

    • lease_not_found
    • task_not_found
  • 409Conflict

    lease_not_running, task_paused (resume it first), or task_no_package (the task has no package to reinstall).

    • lease_not_running
    • task_paused
    • task_no_package
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/tasks/3f9a0c1d2e4b5a60/reinstall' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/renter/leases/{lease_id}/tasks/{binding_id}/log

Read 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

  • binding_idstring· pathRequired

    binding_id of the task, from GET /api/v1/renter/leases/{lease_id}/tasks.

    Example3f9a0c1d2e4b5a60Pattern^[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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 404Not Found

    lease_not_found, or task_not_found (no such task on this instance).

    • lease_not_found
    • task_not_found
  • 409Conflict

    lease_not_running: the instance is not in phase running.

    • lease_not_running
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/renter/leases/57/tasks/3f9a0c1d2e4b5a60/log' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/renter/leases/{lease_id}/tasks/{binding_id}/log

Ask 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

  • lease_idstring· pathRequired

    Lease ID (id from GET /api/v1/renter/leases). A positive integer without leading zeros.

    Example57Pattern^[1-9][0-9]{0,17}$

  • binding_idstring· pathRequired

    binding_id of the task, from GET /api/v1/renter/leases/{lease_id}/tasks.

    Example3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$

Responses

  • 200OK

    Request sent.

    Response fields (2)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 404Not Found

    lease_not_found, or task_not_found (no such task on this instance).

    • lease_not_found
    • task_not_found
  • 409Conflict

    lease_not_running, or task_paused (resume the task first).

    • lease_not_running
    • task_paused
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl -X POST 'https://suanzu.ai/api/v1/renter/leases/57/tasks/3f9a0c1d2e4b5a60/log' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/renter/tags

List 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/renter/tags' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/renter/tags

Create 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

  • namestringRequired

    Length1 – 32

  • colorintegerRequired

    Range0 – 7

Responses

  • 200OK

    Created.

    Response fields (2)
  • 400Bad Request

    bad_request, tag_name_invalid (1-32 characters after trimming), or tag_color_invalid (0-7).

    • bad_request
    • tag_name_invalid
    • tag_color_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 409Conflict

    tag_name_taken, or tag_limit (1000 tags already).

    • tag_name_taken
    • tag_limit
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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
}'
PATCH/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

  • tag_idstring· pathRequired

    id of your tag (from GET /api/v1/renter/tags).

    Example12Pattern^[1-9][0-9]{0,17}$

Request bodyapplication/json

  • namestring

    Length1 – 32

  • colorinteger

    Range0 – 7

Responses

  • 200OK

    Done.

    Response fields (1)
  • 400Bad Request

    bad_request, tag_name_invalid (1-32 characters after trimming), or tag_color_invalid (0-7).

    • bad_request
    • tag_name_invalid
    • tag_color_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • 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"
}'
DELETE/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

  • tag_idstring· pathRequired

    id of your tag (from GET /api/v1/renter/tags).

    Example12Pattern^[1-9][0-9]{0,17}$

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited

Examples

curl -X DELETE 'https://suanzu.ai/api/v1/renter/tags/12' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/renter/leases/tags

Add 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

  • lease_idsstring[]Required

    Lease IDs as decimal strings (id from GET /api/v1/renter/leases). 1-500 items; duplicates are merged.

    Length1 – 500Pattern^[1-9][0-9]{0,17}$

  • tag_idsstring[]Required

    Tag IDs as decimal strings. 1-30 items; duplicates are merged.

    Length1 – 30Pattern^[1-9][0-9]{0,17}$

  • modestringRequired

    Valuesaddremove

Responses

  • 200OK

    Done. n is 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 404Not Found

    lease_not_found (an instance is not yours), or tag_not_found (a tag is not yours).

    • lease_not_found
    • tag_not_found
  • 409Conflict

    tag_lease_limit: an instance would have more than 30 tags; lease_id says which.

    • tag_lease_limit
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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"
}'
GET/api/v1/renter/wallet-vars

List 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/renter/wallet-vars' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/renter/wallet-vars

Save 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

  • namestringRequired

    Length1 – 64

  • descriptionstring

    Length≤ 256

  • valuestringRequired

    Not blank, at most 4 KiB, no NUL. Stored and shown as is.

Responses

  • 200OK

    Saved.

    Response fields (10)
  • 400Bad Request

    bad_request, or wallet_var_invalid (the error text says which field).

    • bad_request
    • wallet_var_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • 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"
}'
PUT/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

  • wallet_var_idstring· pathRequired

    id of your wallet / variable (from GET /api/v1/renter/wallet-vars).

    Example5b1c9e2d7a3f4e60Pattern^[0-9a-f]{16}$

Request bodyapplication/json

  • namestringRequired

    Length1 – 64

  • descriptionstring

    Length≤ 256

  • valuestringRequired

    Not 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 (the error text says which field), or task_config_too_large.

    • bad_request
    • wallet_var_invalid
    • task_config_too_large
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • 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"
}'
DELETE/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

  • wallet_var_idstring· pathRequired

    id of your wallet / variable (from GET /api/v1/renter/wallet-vars).

    Example5b1c9e2d7a3f4e60Pattern^[0-9a-f]{16}$

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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; templates lists them.

    • wallet_var_in_use
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl -X DELETE 'https://suanzu.ai/api/v1/renter/wallet-vars/5b1c9e2d7a3f4e60' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/account/deposits

List 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

  • targetstring· queryRequired

    rent_balance = deposits to your rent balance (needs renter:read); fee_credit = deposits to your host service-fee balance (needs host:read).

    Valuesrent_balancefee_credit

  • pageinteger· query

    Range1 – 1000000Default1

  • page_sizeinteger· query

    Range1 – 100Default20

Responses

  • 200OK

    One page of deposits.

    Response fields (6)
  • 400Bad Request

    bad_target (target missing or invalid), bad_request.

    • bad_target
    • bad_request
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied (target=rent_balance needs renter:read, target=fee_credit needs host:read), api_key_ip_denied, api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/account/deposits?target=rent_balance' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/account/deposits/pending

List 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

  • targetstring· queryRequired

    rent_balance = deposits to your rent balance (needs renter:read); fee_credit = deposits to your host service-fee balance (needs host:read).

    Valuesrent_balancefee_credit

Responses

  • 200OK

    Pending deposits.

    Response fields (5)
  • 400Bad Request

    bad_target.

    • bad_target
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied (target=rent_balance needs renter:read, target=fee_credit needs host:read), api_key_ip_denied, api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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.

GET/api/v1/host/machines

List 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

  • groupstring· query

    Device group ID (id from GET /api/v1/host/device-groups). Empty = all groups.

  • connectivitystring· query

    Valuesonlineoffline

  • statusstring· query

    Comma-separated, any of: available, rented, unlisted, unpriced, fault, noncompliant.

    Exampleavailable,rented

  • reasonstring· query

    Only machines with this code in status_reasons.

    Pattern^[a-z0-9_]{1,64}$

  • gpustring· query

    Comma-separated GPU model names (full names as in gpus[].name), up to 32.

  • tagstring· query

    none (untagged), or comma-separated tag IDs (up to 1000).

  • taskstring· query

    Comma-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· query

    Overclock template filter. Comma-separated: none, manual, or template IDs (32 hex). Up to 32.

  • fanstring· query

    Fan template filter. Same format as oc.

  • pricestring· query

    Price template filter. Same format as oc.

  • oc_vstring· query

    not_latest or a version number. Needs exactly one template ID in oc.

  • fan_vstring· query

    Same as oc_v, for fan.

  • price_vstring· query

    Same as oc_v, for price.

  • algostring· query

    Only machines whose compute tasks report this algorithm. Needs advanced features.

    Length≤ 64

  • attentionstring· query

    Only machines with this task problem. Needs advanced features.

    Valueszero_hashrategpu_missingstart_failed

  • qstring· query

    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≤ 64

  • sortstring· query

    Sort column, one of the listed keys or taskHash:<template id>. gpuCount sorts 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, sharesRej and sharesInv sort 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 with bad_request. Machines with no value are always listed last, whatever the order.

    ValuesmachinegpuStatusgpuModelsgpuCountgpuUtilvramUsagegpuTempcpucpuCorescpuTempmemorymemoryTotalmemoryUseddiskdiskSizediskTypenetworkpoweruptimeosdrivercudaagentoomlanIppublicIpstatusrestartssharesAccsharesRejsharesInvDefaultmachinePattern^taskHash:[0-9a-f]{32}$

  • orderstring· query

    ValuesascdescDefaultasc

  • pageinteger· query

    Range≥ 1Default1

  • per_pageinteger· query

    Range1 – 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    advanced_not_enabled (algo / attention used 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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    device_index_rebuilding: device data is being rebuilt. Retry shortly. Also request_timeout.

    • device_index_rebuilding
    • request_timeout

Examples

curl 'https://suanzu.ai/api/v1/host/machines?status=available,rented' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/machines/summary

Get 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    device_index_rebuilding: device data is being rebuilt. Retry shortly. Also request_timeout.

    • device_index_rebuilding
    • request_timeout

Examples

curl 'https://suanzu.ai/api/v1/host/machines/summary' \
  -H 'Authorization: Bearer sz_live_...'
GET/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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

Responses

  • 200OK

    The machine.

    Response fields (314)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    device_index_rebuilding: device data is being rebuilt. Retry shortly. Also request_timeout.

    • device_index_rebuilding
    • request_timeout

Examples

curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58' \
  -H 'Authorization: Bearer sz_live_...'
PATCH/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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

Request bodyapplication/json

Give at least one field. Unknown fields are rejected. Body at most 4 KiB.

  • aliasstring

    The new name; the system hostname is changed to it too (not in containers).

    Length1 – 63

  • expected_gpu_countinteger

    How many GPUs the machine should have; at least the detected count.

    Range1 – 64

Responses

  • 200OK

    The saved names.

    Response fields (7)
  • 400Bad Request

    bad_request (no field, unknown field), alias_invalid (also an empty alias), expected_gpu_count_invalid (below the detected GPU count or above 64).

    • bad_request
    • alias_invalid
    • expected_gpu_count_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 the Retry-After header.

    • 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"
}'
GET/api/v1/host/machines/{machine_id}/tasks

List 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

Responses

  • 200OK

    Tasks.

    Response fields (48)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    device_index_rebuilding: device data is being rebuilt. Retry shortly. Also request_timeout.

    • device_index_rebuilding
    • request_timeout

Examples

curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/tasks' \
  -H 'Authorization: Bearer sz_live_...'
PUT/api/v1/host/machines/{machine_id}/tasks

Replace 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

Request bodyapplication/json

  • itemsobject[]Required

    Length≤ 16

  • items[].template_idstringRequired
  • items[].gpusstring[] | nullRequired

    GPU bus IDs, for example 0000:01:00.0. null = all GPUs.

Responses

  • 200OK

    Saved. added has the new tasks' binding_id; updated, removed and kept are 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_request
    • task_template_duplicate
    • task_limit_reached
    • task_config_too_large
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    group_forbidden (your role in this shared group is too low), advanced_not_enabled, account_overdue_restricted, or an API key error.

    • group_forbidden
    • advanced_not_enabled
    • account_overdue_restricted
  • 404Not Found

    machine_not_found, or template_not_found (no such template, or not usable on this machine).

    • machine_not_found
    • template_not_found
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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
    }
  ]
}'
GET/api/v1/host/machines/{machine_id}/checks

Check 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

Responses

  • 200OK

    Check results.

    Response fields (20)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    device_index_rebuilding: device data is being rebuilt. Retry shortly. Also request_timeout.

    • device_index_rebuilding
    • request_timeout

Examples

curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/checks' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/machines/{machine_id}/leases

List 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

  • beforeinteger· query

    Only leases with a smaller ID. Omit for the newest.

    Range≥ 1

  • limitinteger· query

    Range1 – 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/leases' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/machines/{machine_id}/timeline

List 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

  • limitinteger· query

    Number of items.

    Range1 – 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/timeline' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/machines/{machine_id}/commands/{cmd_id}/messages

List 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

  • cmd_idstring· pathRequired

    cmd_id from the command reply or the timeline.

    Example6b1f0f2e-4c1a-4f5e-9d3e-2a7b8c9d0e1f

Responses

  • 200OK

    Messages of the command.

    Response fields (7)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • 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_...'
GET/api/v1/host/machines/{machine_id}/history

Get 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

  • rangestring· queryRequired

    Values1h6h1d3d7d30d

  • tointeger· query

    End of the period (UNIX seconds). Omit for now. Moved forward so that the period starts at most 30 days ago. 30d covers the whole 30 days, so it always returns the latest period.

    Range≥ 1

  • metricsstring· query

    hashrate = only the hash rate charts.

    Valueshashrate

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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    history_unavailable (the history store cannot be reached; retry later), device_index_rebuilding, request_timeout.

    • history_unavailable
    • device_index_rebuilding
    • request_timeout

Examples

curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/history?range=1h' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/machines/{machine_id}/faults

List 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

  • beforeinteger· query

    next_before of the previous page. Omit for the newest.

    Range≥ 1

  • limitinteger· query

    Range1 – 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/faults' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/machines/{machine_id}/remote

Get 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

Responses

  • 200OK

    Remote state.

    Response fields (26)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    device_index_rebuilding: device data is being rebuilt. Retry shortly. Also request_timeout.

    • device_index_rebuilding
    • request_timeout

Examples

curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/remote' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/host/machines/{machine_id}/remote

Open 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

Responses

  • 200OK

    Session open.

    Response fields (2)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    group_forbidden (needs operator), advanced_not_enabled, account_overdue_restricted, or an API key error.

    • group_forbidden
    • advanced_not_enabled
    • account_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).

    • rented
    • remote_busy
    • remote_too_many
    • agent_unsupported
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    remote_unconfigured, remote_relay_unavailable (no relay confirmed; nothing was opened), or request_timeout.

    • remote_unconfigured
    • remote_relay_unavailable
    • request_timeout

Examples

curl -X POST 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/remote' \
  -H 'Authorization: Bearer sz_live_...'
DELETE/api/v1/host/machines/{machine_id}/remote

Close 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

  • scopestring· query

    all closes every session on the machine. Omit to close only this key's own session.

    Valuesall

Responses

  • 200OK

    Closed.

    Response fields (2)
  • 400Bad Request

    invalid_scope (scope is not all), or bad_request.

    • invalid_scope
    • bad_request
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    group_forbidden (needs operator, or manager with scope=all when 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 the Retry-After header.

    • rate_limited

Examples

curl -X DELETE 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/remote' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/device-groups

List 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/device-groups' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/memberships

List 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/memberships' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/account

Get 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/account' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/ledger

List 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

  • pageinteger· query

    Range1 – 1000000Default1

  • page_sizeinteger· query

    Range1 – 100Default20

  • typestring· query

    Valuesfeerentdepositoffsetgiftimportwithdrawwithdraw_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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/ledger' \
  -H 'Authorization: Bearer sz_live_...'
GET/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

  • ledger_idstring· pathRequired

    id of a rent row from GET /api/v1/host/ledger. A positive integer without leading zeros.

    Example2201Pattern^[1-9][0-9]{0,17}$

Responses

  • 200OK

    The payout and its leases.

    Response fields (12)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 404Not Found

    payout_not_found: no such row, not yours, or not a rent row.

    • payout_not_found
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/rent-payouts/2201' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/earnings

Get 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

  • rangestring· query

    7d and 30d end today (UTC); month = this UTC month; last_month = the previous one.

    Values7d30dmonthlast_monthDefault7d

  • groupstring· query

    Device 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/earnings' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/earnings/leases

List 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

  • rangestring· query

    7d and 30d end today (UTC); month = this UTC month; last_month = the previous one.

    Values7d30dmonthlast_monthDefault7d

  • groupstring· query

    Device group ID. Omit for your whole account.

  • machinestring· query

    Only this machine_id.

  • qstring· query

    Case-insensitive search in machine display name and group name. At most 64 characters.

    Length≤ 64

  • sortstring· query

    recent = newest start first, income = highest total first, hours = longest first, name = by display name.

    ValuesrecentincomehoursnameDefaultrecent

  • pageinteger· query

    Range1 – 1000000Default1

  • page_sizeinteger· query

    Range1 – 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/earnings/leases' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/billing

Get 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/billing' \
  -H 'Authorization: Bearer sz_live_...'
GET/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

  • dayinteger· pathRequired

    UTC midnight in UNIX seconds (a multiple of 86400).

    Example1762300800

  • pageinteger· query

    Range1 – 1000000Default1

  • per_pageinteger· query

    Range1 – 500Default100

Responses

  • 200OK

    The bill of the day.

    Response fields (26)
  • 400Bad Request

    bad_request (day is not a UTC midnight, or bad page / per_page).

    • bad_request
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/billing/days/1762300800' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/host/machines/price

Set 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.

  • machine_idsstring[]Required

    Machine IDs (machine_id, not the device number). 1-500 items; duplicates are merged.

    Length1 – 500

  • price_per_gpu_hrstring | null

    USDT per GPU per hour. null clears it.

    Pattern^(0|[1-9][0-9]{0,6})(\.[0-9]{1,3})?$

  • price_per_cpu_hrstring | null

    USDT per CPU socket per hour. null clears it.

    Pattern^(0|[1-9][0-9]{0,6})(\.[0-9]{1,3})?$

  • rent_power_limit_winteger | null

    Power limit per GPU while rented, in W. null = no limit. Omit to keep. Must be within every GPU's allowed range.

  • rent_fan_modestring | null

    Fan mode while rented. Omit or null to keep.

    Valuesautomaxnull

Responses

  • 200OK

    Per-machine results. results[].code when ok is 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 500 machine_ids, bad rent_fan_mode, no price field), cross_group.

    • bad_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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"
}'
POST/api/v1/host/machines/listing

List 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

  • machine_idsstring[]Required

    Machine IDs (machine_id, not the device number). 1-500 items; duplicates are merged.

    Length1 – 500

  • listedbooleanRequired

Responses

  • 200OK

    Per-machine results. results[].code when ok is false: machine_not_found, group_forbidden, and when listing also price_unset, not_eligible (with reasons, see listing/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, listed missing, bad machine_ids), cross_group.

    • bad_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    device_index_rebuilding: device data is being rebuilt. Retry shortly. Also request_timeout.

    • device_index_rebuilding
    • request_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
}'
POST/api/v1/host/machines/listing/precheck

Check 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

  • machine_idsstring[]Required

    Machine IDs (machine_id, not the device number). 1-500 items; duplicates are merged.

    Length1 – 500

Responses

  • 200OK

    Per-machine results. results[].code: machine_not_found, group_forbidden, price_unset, not_eligible (with reasons), spec_syncing, master_pending.

    Response fields (6)
  • 400Bad Request

    bad_request, cross_group.

    • bad_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    device_index_rebuilding: device data is being rebuilt. Retry shortly. Also request_timeout.

    • device_index_rebuilding
    • request_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"
  ]
}'
POST/api/v1/host/machines/{machine_id}/tasks/{binding_id}/pause

Pause 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

  • binding_idstring· pathRequired

    binding_id of the task, from GET /api/v1/host/machines/{machine_id}/tasks.

    Example3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    group_forbidden (your role in this shared group is too low), advanced_not_enabled, account_overdue_restricted, or an API key error.

    • group_forbidden
    • advanced_not_enabled
    • account_overdue_restricted
  • 404Not Found

    machine_not_found, or task_not_found (no such task on this machine).

    • machine_not_found
    • task_not_found
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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_...'
POST/api/v1/host/machines/{machine_id}/tasks/{binding_id}/resume

Resume 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

  • binding_idstring· pathRequired

    binding_id of the task, from GET /api/v1/host/machines/{machine_id}/tasks.

    Example3f9a0c1d2e4b5a60Pattern^[0-9a-f]{16}$

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    group_forbidden (your role in this shared group is too low), advanced_not_enabled, account_overdue_restricted, or an API key error.

    • group_forbidden
    • advanced_not_enabled
    • account_overdue_restricted
  • 404Not Found

    machine_not_found, or task_not_found (no such task on this machine).

    • machine_not_found
    • task_not_found
  • 409Conflict

    rented: the machine is rented.

    • rented
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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_...'
POST/api/v1/host/machines/commands/task_restart

Restart 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

  • machine_idsstring[]Required

    Length1 – 1

  • argsobjectRequired
  • args.binding_idstringRequired

    Pattern^[0-9a-f]{16}$

Responses

  • 200OK

    Issued or rejected.

    Response fields (7)
  • 400Bad Request

    bad_request (not exactly one machine, or args is not {binding_id}).

    • bad_request
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 (see KeyForbidden).

    • advanced_not_enabled
    • account_overdue_restricted
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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"
  }
}'
POST/api/v1/host/machines/commands/task_logs

Fetch 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

  • machine_idsstring[]Required

    Length1 – 1

  • argsobjectRequired
  • args.binding_idstringRequired

    Pattern^[0-9a-f]{16}$

Responses

  • 200OK

    Issued or rejected.

    Response fields (7)
  • 400Bad Request

    bad_request (not exactly one machine, or args is not {binding_id}).

    • bad_request
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 the Retry-After header.

    • 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"
  }
}'
POST/api/v1/host/machines/tasks/restart

Restart 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

  • machine_idsstring[]Required

    Machine IDs (machine_id, not the device number). 1-500 items; duplicates are merged.

    Length1 – 500

Responses

  • 200OK

    Issued and rejected machines.

    Response fields (7)
  • 400Bad Request

    bad_request (bad machine_ids), cross_group.

    • bad_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 (see KeyForbidden).

    • advanced_not_enabled
    • account_overdue_restricted
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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"
  ]
}'
POST/api/v1/host/machines/tasks/redownload

Reinstall 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

  • machine_idsstring[]Required

    Machine IDs (machine_id, not the device number). 1-500 items; duplicates are merged.

    Length1 – 500

  • template_idsstring[]Required

    Compute task template IDs (id from GET /api/v1/host/task-templates, or template_id in a machine's tasks.items).

    Length1 – 100

Responses

  • 200OK

    Issued and rejected machines.

    Response fields (7)
  • 400Bad Request

    bad_request (bad machine_ids or template_ids), cross_group.

    • bad_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 (see KeyForbidden).

    • advanced_not_enabled
    • account_overdue_restricted
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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"
  ]
}'
POST/api/v1/host/machines/tasks/pause

Pause 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

  • machine_idsstring[]Required

    Machine IDs (machine_id, not the device number). 1-500 items; duplicates are merged.

    Length1 – 500

Responses

  • 200OK

    Per-machine results.

    Response fields (6)
  • 400Bad Request

    bad_request (bad machine_ids), cross_group.

    • bad_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 (see KeyForbidden).

    • advanced_not_enabled
    • account_overdue_restricted
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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"
  ]
}'
POST/api/v1/host/machines/tasks/resume

Resume 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

  • machine_idsstring[]Required

    Machine IDs (machine_id, not the device number). 1-500 items; duplicates are merged.

    Length1 – 500

Responses

  • 200OK

    Per-machine results.

    Response fields (6)
  • 400Bad Request

    bad_request (bad machine_ids), cross_group.

    • bad_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 (see KeyForbidden).

    • advanced_not_enabled
    • account_overdue_restricted
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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"
  ]
}'
POST/api/v1/host/machines/commands/reboot

Reboot 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

  • machine_idsstring[]Required

    Length1 – 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_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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"
  ]
}'
POST/api/v1/host/machines/commands/upgrade

Upgrade 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

  • machine_idsstring[]Required

    Length1 – 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_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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"
  ]
}'
GET/api/v1/host/machines/{machine_id}/driver-options

List 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

Responses

  • 200OK

    Installable driver versions.

    Response fields (17)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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_forbidden
    • driver_env_unsupported
    • driver_os_unsupported
    • driver_os_unknown
    • driver_arch_unsupported
    • agent_unsupported
    • command_pending
    • listed
    • rented
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/driver-options' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/host/machines/commands/driver_install

Install 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

  • machine_idsstring[]Required

    Length1 – 1

  • argsobjectRequired
  • args.versionstringRequired

    One of options[].version from driver-options.

  • args.cudabooleanRequired

    Also install the CUDA toolkit (nvcc).

  • args.accelbooleanRequired

    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.modulestring

    Kernel module to install. Optional; without it the recommended module from driver-options is used.

    Valuesopenproprietary

Responses

  • 200OK

    Issued or rejected.

    Response fields (7)
  • 400Bad Request

    bad_request (invalid body, for example a type field), driver_param_invalid (not exactly one machine, args misses version, cuda or accel or has other keys than these and module, module is not open or proprietary, or cuda: true on HiveOS), driver_version_invalid (the version is not in this machine's driver-options).

    • bad_request
    • driver_param_invalid
    • driver_version_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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
  }
}'
GET/api/v1/host/machines/{machine_id}/commands/{cmd_id}/progress

Get 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

  • cmd_idstring· pathRequired

    cmd_id from the command reply or the timeline.

    Example6b1f0f2e-4c1a-4f5e-9d3e-2a7b8c9d0e1f

  • offsetinteger· query

    Byte offset to read the log from; use next_offset of the previous call.

    Range0 – 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • 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_...'
GET/api/v1/host/machines/{machine_id}/messages

List 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

  • typestring· query

    Only messages of this type.

    Valuesinfookwarnerror

  • pageinteger· query

    Range1 – 1000000Default1

  • per_pageinteger· query

    Range1 – 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/machines/314d1670-872d-4d8d-be94-a4ceea1c0c58/messages' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/gpus

List 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

  • groupstring· query

    Device group ID. Omit for all machines you can see.

  • modelstring· query

    GPU model name.

  • problemstring· query

    Valuesdroppedmissingtemp_crittemp_warnfaneccxididleno_hashany

  • algostring· query

    Only GPUs running this algorithm.

  • connectivitystring· query

    Valuesonlineoffline

  • sortstring· query

    device, 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, or hash:<algo>.

  • orderstring· query

    Valuesascdesc

  • qstring· query

    Search machine names and GPU bus IDs (at most 64 characters).

    Length≤ 64

  • pageinteger· query

    Range1 – 1000000Default1

  • per_pageinteger· query

    Range1 – 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    device_index_rebuilding: device data is being rebuilt. Retry shortly. Also request_timeout.

    • device_index_rebuilding
    • request_timeout

Examples

curl 'https://suanzu.ai/api/v1/host/gpus' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/tags

List 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/tags' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/host/tags

Create 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

  • namestringRequired

    1-32 characters after trimming.

  • colorintegerRequired

    Color number used by the console.

    Range0 – 7

Responses

  • 200OK

    Created.

    Response fields (7)
  • 400Bad Request

    bad_request (missing field), tag_name_invalid (1-32 characters after trimming), or tag_color_invalid (0-7).

    • bad_request
    • tag_name_invalid
    • tag_color_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_taken
    • tag_limit
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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
}'
PATCH/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

  • tag_idstring· pathRequired

    id from GET /api/v1/host/tags.

    Example12Pattern^[1-9][0-9]*$

Request bodyapplication/json

  • namestring

    1-32 characters after trimming.

  • colorinteger

    Range0 – 7

Responses

  • 200OK

    Changed.

    Response fields (7)
  • 400Bad Request

    bad_request (missing field), tag_name_invalid (1-32 characters after trimming), or tag_color_invalid (0-7).

    • bad_request
    • tag_name_invalid
    • tag_color_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 the Retry-After header.

    • 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
}'
DELETE/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

  • tag_idstring· pathRequired

    id from GET /api/v1/host/tags.

    Example12Pattern^[1-9][0-9]*$

Responses

  • 200OK

    Deleted.

    Response fields (2)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 the Retry-After header.

    • rate_limited

Examples

curl -X DELETE 'https://suanzu.ai/api/v1/host/tags/12' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/price-templates

List 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

  • group_idstring· query

    A 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/price-templates' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/host/price-templates

Create 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

  • namestringRequired

    1-64 characters after trimming.

  • pricesobjectRequired

    gpu: GPU model name (show_name when present, otherwise name) → {price, power_w, fan}; cpu: CPU model → price. At least one row in all.

  • prices.gpuobjectRequired
  • prices.gpu.*object
  • prices.gpu.*.pricestringRequired

    More than 0, at most 100, at most 3 decimals.

  • prices.gpu.*.power_winteger | nullRequired

    Power limit per GPU while rented; null = no limit.

    Range≥ 1

  • prices.gpu.*.fanstringRequired

    Valuesautomax

  • prices.cpuobjectRequired
  • prices.cpu.*string

    Price per CPU socket per hour.

  • group_idstring | null

    null = account-wide.

Responses

  • 200OK

    Created.

    Response fields (10)
  • 400Bad Request

    bad_request, or template_invalid (the error text says which name, price, power_w or fan is wrong).

    • bad_request
    • template_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 the Retry-After header.

    • 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
}'
PATCH/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

  • price_template_idstring· pathRequired

    id from GET /api/v1/host/price-templates.

    Example5d0c6a2e9b1f4c3a8e7d6b5a4c3b2a10

Request bodyapplication/json

  • namestring
  • pricesobject

    gpu: GPU model name (show_name when present, otherwise name) → {price, power_w, fan}; cpu: CPU model → price. At least one row in all.

  • prices.gpuobjectRequired
  • prices.gpu.*object
  • prices.gpu.*.pricestringRequired

    More than 0, at most 100, at most 3 decimals.

  • prices.gpu.*.power_winteger | nullRequired

    Power limit per GPU while rented; null = no limit.

    Range≥ 1

  • prices.gpu.*.fanstringRequired

    Valuesautomax

  • prices.cpuobjectRequired
  • prices.cpu.*string

    Price per CPU socket per hour.

Responses

  • 200OK

    Changed.

    Response fields (10)
  • 400Bad Request

    bad_request, or template_invalid (the error text says which name, price, power_w or fan is wrong).

    • bad_request
    • template_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 the Retry-After header.

    • 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"
}'
DELETE/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

  • price_template_idstring· pathRequired

    id from GET /api/v1/host/price-templates.

    Example5d0c6a2e9b1f4c3a8e7d6b5a4c3b2a10

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 the Retry-After header.

    • rate_limited

Examples

curl -X DELETE 'https://suanzu.ai/api/v1/host/price-templates/5d0c6a2e9b1f4c3a8e7d6b5a4c3b2a10' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/task-templates

List 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

  • group_idstring· query

    A 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/task-templates' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/host/task-templates

Create 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.

  • namestringRequired
  • kindstringRequired

    Valuescustomhive

  • descriptionstring
  • varsobject[]

    Custom tasks only. Environment variables of the program (at most 64). Set ref to take the value from one of your wallets / variables; then send value as an empty string, it is replaced.

  • vars[].keystringRequired

    Matches ^[A-Za-z_][A-Za-z0-9_]*$; no SUANZU_ prefix and no reserved name.

  • vars[].valuestringRequired

    At most 4 KiB. Required even with ref (send an empty string).

  • vars[].refstring | null

    id of one of your wallets / variables, or null.

  • customobject
  • custom.start_commandstring

    Runs with bash -c. At most 16 KiB.

  • custom.package_urlstring

    Optional program package to download before starting.

  • custom.extractboolean

    Defaulttrue

  • hiveobject
  • hive.minerstring

    Package directory name. Empty = taken from the install_url file name.

  • hive.coinstring

    Passed as DIGITAL_CASH.

  • hive.walletstring

    Replaces %WAL%. Send an empty string with wallet_ref.

  • hive.install_urlstring

    http(s) link to a .tar.gz / .tgz package.

  • hive.algostring

    Passed as CUSTOM_ALGO.

  • hive.templatestring

    Macros are replaced in this field and in url, pass, user_config.

  • hive.urlstring
  • hive.passstring
  • hive.user_configstring
  • accelobject
  • accel.downloadboolean

    Download acceleration for the program package (GitHub release files only).

  • accel.forwardobject | null

    Domain acceleration. The machines reach this host:port through a SuanZu relay; it must appear in the task content. null = off.

  • accel.forward.hoststring
  • accel.forward.portinteger

    Range1 – 65535

  • wallet_refstring | null

    HiveOS only. Take hive.wallet from a wallet / variable (GET /api/v1/host/wallet-vars).

  • followstring

    Follow 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 400 follow_github_only. Not sent = "" (the template is replaced as a whole, so leaving it out turns following off).

    Valueslatestlatest_betaDefault

  • run_in_containerboolean

    Run the task in a container that sees only its GPUs.

  • container_imagestring

    Only with run_in_container. Empty = the default image. Common images: GET /api/v1/host/images.

  • oc_template_idstring | null

    Overclocking template for the task's GPUs (an account-wide one of yours, or one of the same group). null = none.

  • group_idstring | null

    null = account-wide.

Responses

  • 200OK

    Created.

    Response fields (24)
  • 400Bad Request

    bad_request, template_invalid (the error text 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 accelerated host:port is not in the task content), forward_forbidden_address, forward_dns_error, task_config_too_large (with machine_count), package_url_private_host, package_url_github_query, accel_download_github_only, or follow_github_only (following the latest version is available only for GitHub release links with a version tag).

    • bad_request
    • template_invalid
    • hive_vars_unsupported
    • hive_wallet_required
    • wallet_var_unavailable
    • oc_template_unavailable
    • container_image_invalid
    • forward_not_in_task
    • forward_forbidden_address
    • forward_dns_error
    • task_config_too_large
    • package_url_private_host
    • package_url_github_query
    • accel_download_github_only
    • follow_github_only
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_forbidden
    • advanced_not_enabled
    • account_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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    forward_unconfigured, forward_capacity_full or forward_unavailable: domain acceleration cannot be set up right now; nothing was saved. Retry later or turn accel.forward off. Also request_timeout.

    • forward_unconfigured
    • forward_capacity_full
    • forward_unavailable
    • request_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
}'
PUT/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

  • task_template_idstring· pathRequired

    id from GET /api/v1/host/task-templates.

    Example9c2e5b7a1d3f4e6a8b0c2d4e6f8a0b1c

Request bodyapplication/json

A host compute task template. Same as RenterTaskTemplateDraft plus the host-only fields below.

  • namestringRequired
  • kindstringRequired

    Valuescustomhive

  • descriptionstring
  • varsobject[]

    Custom tasks only. Environment variables of the program (at most 64). Set ref to take the value from one of your wallets / variables; then send value as an empty string, it is replaced.

  • vars[].keystringRequired

    Matches ^[A-Za-z_][A-Za-z0-9_]*$; no SUANZU_ prefix and no reserved name.

  • vars[].valuestringRequired

    At most 4 KiB. Required even with ref (send an empty string).

  • vars[].refstring | null

    id of one of your wallets / variables, or null.

  • customobject
  • custom.start_commandstring

    Runs with bash -c. At most 16 KiB.

  • custom.package_urlstring

    Optional program package to download before starting.

  • custom.extractboolean

    Defaulttrue

  • hiveobject
  • hive.minerstring

    Package directory name. Empty = taken from the install_url file name.

  • hive.coinstring

    Passed as DIGITAL_CASH.

  • hive.walletstring

    Replaces %WAL%. Send an empty string with wallet_ref.

  • hive.install_urlstring

    http(s) link to a .tar.gz / .tgz package.

  • hive.algostring

    Passed as CUSTOM_ALGO.

  • hive.templatestring

    Macros are replaced in this field and in url, pass, user_config.

  • hive.urlstring
  • hive.passstring
  • hive.user_configstring
  • accelobject
  • accel.downloadboolean

    Download acceleration for the program package (GitHub release files only).

  • accel.forwardobject | null

    Domain acceleration. The machines reach this host:port through a SuanZu relay; it must appear in the task content. null = off.

  • accel.forward.hoststring
  • accel.forward.portinteger

    Range1 – 65535

  • wallet_refstring | null

    HiveOS only. Take hive.wallet from a wallet / variable (GET /api/v1/host/wallet-vars).

  • followstring

    Follow 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 400 follow_github_only. Not sent = "" (the template is replaced as a whole, so leaving it out turns following off).

    Valueslatestlatest_betaDefault

  • run_in_containerboolean

    Run the task in a container that sees only its GPUs.

  • container_imagestring

    Only with run_in_container. Empty = the default image. Common images: GET /api/v1/host/images.

  • oc_template_idstring | null

    Overclocking 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 (the error text 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 accelerated host:port is not in the task content), forward_forbidden_address, forward_dns_error, task_config_too_large (with machine_count), package_url_private_host, package_url_github_query, accel_download_github_only, or follow_github_only (following the latest version is available only for GitHub release links with a version tag).

    • bad_request
    • template_invalid
    • hive_vars_unsupported
    • hive_wallet_required
    • wallet_var_unavailable
    • oc_template_unavailable
    • container_image_invalid
    • forward_not_in_task
    • forward_forbidden_address
    • forward_dns_error
    • task_config_too_large
    • package_url_private_host
    • package_url_github_query
    • accel_download_github_only
    • follow_github_only
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_forbidden
    • advanced_not_enabled
    • account_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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    forward_unconfigured, forward_capacity_full or forward_unavailable: domain acceleration cannot be set up right now; nothing was saved. Retry later or turn accel.forward off. Also request_timeout.

    • forward_unconfigured
    • forward_capacity_full
    • forward_unavailable
    • request_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
}'
DELETE/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

  • task_template_idstring· pathRequired

    id from GET /api/v1/host/task-templates.

    Example9c2e5b7a1d3f4e6a8b0c2d4e6f8a0b1c

Responses

  • 200OK

    Deleted.

    Response fields (3)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_forbidden
    • advanced_not_enabled
    • account_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[].debug as in GET /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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    forward_unconfigured, forward_capacity_full or forward_unavailable: domain acceleration cannot be set up right now; nothing was saved. Retry later or turn accel.forward off. Also request_timeout.

    • forward_unconfigured
    • forward_capacity_full
    • forward_unavailable
    • request_timeout

Examples

curl -X DELETE 'https://suanzu.ai/api/v1/host/task-templates/9c2e5b7a1d3f4e6a8b0c2d4e6f8a0b1c' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/task-templates/{task_template_id}/usage

List 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

  • task_template_idstring· pathRequired

    id from GET /api/v1/host/task-templates.

    Example9c2e5b7a1d3f4e6a8b0c2d4e6f8a0b1c

Responses

  • 200OK

    Machines.

    Response fields (7)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/task-templates/9c2e5b7a1d3f4e6a8b0c2d4e6f8a0b1c/usage' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/images

List 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/images' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/quote-coins

List 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/quote-coins' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/oc-templates

List 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

  • group_idstring· query

    A 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/oc-templates' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/host/oc-templates

Create 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

  • namestringRequired

    1-64 characters after trimming.

  • descriptionstring

    Length≤ 256

  • modelsobjectRequired

    GPU model name (show_name when present, otherwise name; generic driver names are rejected) → all 6 values (each an integer or null), plus an optional advanced (an object turns advanced settings on for that model; null or leaving it out = off).

  • models.*object
  • models.*.power_limit_winteger | nullRequired
  • models.*.core_lock_mhzinteger | nullRequired
  • models.*.mem_lock_mhzinteger | nullRequired
  • models.*.core_offset_mhzinteger | nullRequired
  • models.*.mem_offset_mhzinteger | nullRequired
  • models.*.fan_percentinteger | nullRequired
  • models.*.advancedobject | null

    Advanced settings of one GPU (or of one model in a template). An object = on; null or 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_ratio is a ratio. Out of range gives 400 oc_param_out_of_range with field, min and max. The machine needs Agent oc.adv_agent_min or later; older Agents do not get these values.

  • models.*.advanced.xbar_rationumberRequired

    XBAR ratio, 0.05-1.00 with up to 4 decimals, or 0.

  • models.*.advanced.msvdd_vmin_mvintegerRequired

    MSVDD minimum voltage offset in mV.

    Range-500 – 0

  • models.*.advanced.xbar_clock_offset_mhzintegerRequired

    XBAR clock offset in MHz.

    Range-1500 – 0

  • models.*.advanced.vcore_offset_mvintegerRequired

    Core voltage offset in mV.

    Range-200 – 0

  • group_idstring | null

    null = account-wide.

Responses

  • 200OK

    Created.

    Response fields (13)
  • 400Bad Request

    bad_request (for example group_id sent when changing), template_invalid (bad name, description or models), oc_param_out_of_range (with field, min, max and model).

    • bad_request
    • template_invalid
    • oc_param_out_of_range
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_forbidden
    • advanced_not_enabled
    • account_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 the Retry-After header.

    • 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
}'
PUT/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

  • oc_template_idstring· pathRequired

    id from GET /api/v1/host/oc-templates.

    Example7a1b2c3d4e5f60718293a4b5c6d7e8f9

Request bodyapplication/json

  • namestringRequired

    1-64 characters after trimming.

  • descriptionstring

    Length≤ 256

  • modelsobjectRequired

    GPU model name (show_name when present, otherwise name; generic driver names are rejected) → all 6 values (each an integer or null), plus an optional advanced (an object turns advanced settings on for that model; null or leaving it out = off).

  • models.*object
  • models.*.power_limit_winteger | nullRequired
  • models.*.core_lock_mhzinteger | nullRequired
  • models.*.mem_lock_mhzinteger | nullRequired
  • models.*.core_offset_mhzinteger | nullRequired
  • models.*.mem_offset_mhzinteger | nullRequired
  • models.*.fan_percentinteger | nullRequired
  • models.*.advancedobject | null

    Advanced settings of one GPU (or of one model in a template). An object = on; null or 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_ratio is a ratio. Out of range gives 400 oc_param_out_of_range with field, min and max. The machine needs Agent oc.adv_agent_min or later; older Agents do not get these values.

  • models.*.advanced.xbar_rationumberRequired

    XBAR ratio, 0.05-1.00 with up to 4 decimals, or 0.

  • models.*.advanced.msvdd_vmin_mvintegerRequired

    MSVDD minimum voltage offset in mV.

    Range-500 – 0

  • models.*.advanced.xbar_clock_offset_mhzintegerRequired

    XBAR clock offset in MHz.

    Range-1500 – 0

  • models.*.advanced.vcore_offset_mvintegerRequired

    Core voltage offset in mV.

    Range-200 – 0

Responses

  • 200OK

    Changed.

    Response fields (14)
  • 400Bad Request

    bad_request (for example group_id sent when changing), template_invalid (bad name, description or models), oc_param_out_of_range (with field, min, max and model).

    • bad_request
    • template_invalid
    • oc_param_out_of_range
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_forbidden
    • advanced_not_enabled
    • account_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 the Retry-After header.

    • 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
    }
  }
}'
DELETE/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

  • oc_template_idstring· pathRequired

    id from GET /api/v1/host/oc-templates.

    Example7a1b2c3d4e5f60718293a4b5c6d7e8f9

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_forbidden
    • advanced_not_enabled
    • account_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 the Retry-After header.

    • rate_limited

Examples

curl -X DELETE 'https://suanzu.ai/api/v1/host/oc-templates/7a1b2c3d4e5f60718293a4b5c6d7e8f9' \
  -H 'Authorization: Bearer sz_live_...'
GET/api/v1/host/fan-templates

List 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

  • group_idstring· query

    A 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/fan-templates' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/host/fan-templates

Create 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

  • namestringRequired

    1-64 characters after trimming.

  • descriptionstring

    Length≤ 256

  • paramsobjectRequired

    The 7 auto-fan values. The Agent keeps the GPU core near target_core_c and the memory near target_mem_c with the fan between min_fan and max_fan.

  • params.enabledbooleanRequired
  • params.target_core_cintegerRequired

    Range30 – 95

  • params.target_mem_cintegerRequired

    Range40 – 110

  • params.min_fanintegerRequired

    Fan %.

    Range1 – 100

  • params.max_fanintegerRequired

    Fan %, at least min_fan.

    Range1 – 100

  • params.critical_cintegerRequired

    At least target_core_c + 10. Above it for 2 rounds the GPU is handled by overheat; back below critical_c − 10 it recovers.

    Range50 – 110

  • params.overheatstringRequired

    stop_task = stop the compute tasks; hold_gpu = take only that GPU out of its tasks.

    Valuesstop_taskhold_gpu

  • group_idstring | null

    null = account-wide.

Responses

  • 200OK

    Created.

    Response fields (18)
  • 400Bad Request

    bad_request (bad name or description, group_id sent when changing, or params not exactly the 7 fields of the right types), autofan_param_invalid (a value out of range; with field, min, max).

    • bad_request
    • autofan_param_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_forbidden
    • advanced_not_enabled
    • account_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 the Retry-After header.

    • 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
}'
PUT/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

  • fan_template_idstring· pathRequired

    id from GET /api/v1/host/fan-templates.

    Example4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e

Request bodyapplication/json

  • namestringRequired
  • descriptionstring

    Length≤ 256

  • paramsobjectRequired

    The 7 auto-fan values. The Agent keeps the GPU core near target_core_c and the memory near target_mem_c with the fan between min_fan and max_fan.

  • params.enabledbooleanRequired
  • params.target_core_cintegerRequired

    Range30 – 95

  • params.target_mem_cintegerRequired

    Range40 – 110

  • params.min_fanintegerRequired

    Fan %.

    Range1 – 100

  • params.max_fanintegerRequired

    Fan %, at least min_fan.

    Range1 – 100

  • params.critical_cintegerRequired

    At least target_core_c + 10. Above it for 2 rounds the GPU is handled by overheat; back below critical_c − 10 it recovers.

    Range50 – 110

  • params.overheatstringRequired

    stop_task = stop the compute tasks; hold_gpu = take only that GPU out of its tasks.

    Valuesstop_taskhold_gpu

Responses

  • 200OK

    Changed.

    Response fields (18)
  • 400Bad Request

    bad_request (bad name or description, group_id sent when changing, or params not exactly the 7 fields of the right types), autofan_param_invalid (a value out of range; with field, min, max).

    • bad_request
    • autofan_param_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_forbidden
    • advanced_not_enabled
    • account_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 the Retry-After header.

    • 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"
  }
}'
DELETE/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

  • fan_template_idstring· pathRequired

    id from GET /api/v1/host/fan-templates.

    Example4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_forbidden
    • advanced_not_enabled
    • account_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 the Retry-After header.

    • rate_limited

Examples

curl -X DELETE 'https://suanzu.ai/api/v1/host/fan-templates/4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/host/machines/price-template

Apply 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

  • template_idstringRequired

    Length≥ 1

  • machine_idsstring[]Required

    Machine IDs (machine_id, not the device number). 1-500 items; duplicates are merged.

    Length1 – 500

Responses

  • 200OK

    Per-machine results. results[].code when ok is 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, no template_id, empty or more than 500 machine_ids), cross_group.

    • bad_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_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 the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    device_index_rebuilding: device data is being rebuilt. Retry shortly. Also request_timeout.

    • device_index_rebuilding
    • request_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"
  ]
}'
POST/api/v1/host/machines/tags

Add 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

  • machine_idsstring[]Required

    Length1 – 1000

  • tag_idsstring[]Required

    Length1 – 1000Pattern^[1-9][0-9]{0,17}$

  • modestringRequired

    Valuesaddremove

Responses

  • 200OK

    Done for the machines not in rejected.

    Response fields (5)
  • 400Bad Request

    bad_request (invalid body, bad mode, empty or too many IDs), cross_group.

    • bad_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    api_key_scope_denied, api_key_ip_denied, or api_key_route_not_allowed.

    • api_key_scope_denied
    • api_key_ip_denied
    • api_key_route_not_allowed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    device_index_rebuilding: device data is being rebuilt. Retry shortly. Also request_timeout.

    • device_index_rebuilding
    • request_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"
}'
POST/api/v1/host/machines/tasks/apply

Add, 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

  • opstringRequired

    Valuesaddreplaceclear

  • itemsobject[]Required

    Length≤ 16

  • items[].template_idstringRequired

    Length≥ 1

  • items[].positionsinteger[] | null

    Length≤ 64

  • machine_idsstring[]Required

    Length1 – 500

Responses

  • 200OK

    Per-machine results. added has the new tasks' binding_id; updated, removed and kept are binding IDs.

    Response fields (16)
  • 400Bad Request

    bad_request (bad op, items or positions, empty, duplicate or more than 500 machine_ids), task_template_duplicate, task_limit_reached (more than 16 items), cross_group.

    • bad_request
    • task_template_duplicate
    • task_limit_reached
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 (see KeyForbidden).

    • advanced_not_enabled
    • account_overdue_restricted
  • 404Not Found

    template_not_found: no such template, you cannot see it, or it is a debug version (set debug versions with PUT /api/v1/host/machines/{machine_id}/tasks).

    • template_not_found
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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"
  ]
}'
PUT/api/v1/host/machines/{machine_id}/oc

Set 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

Request bodyapplication/json

  • cardsobjectRequired

    GPU bus ID → the 6 values, plus an optional advanced.

  • cards.*object

    The 6 overclocking values of one GPU (0 = not set, use the default), plus an optional advanced.

  • cards.*.power_limit_wintegerRequired

    Range0 – 2000

  • cards.*.core_lock_mhzintegerRequired

    Range0 – 5000

  • cards.*.mem_lock_mhzintegerRequired

    Range0 – 20000

  • cards.*.core_offset_mhzintegerRequired

    Range-10000 – 10000

  • cards.*.mem_offset_mhzintegerRequired

    Range-10000 – 10000

  • cards.*.fan_percentintegerRequired

    Range0 – 100

  • cards.*.advancedobject | null

    Advanced settings of one GPU (or of one model in a template). An object = on; null or 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_ratio is a ratio. Out of range gives 400 oc_param_out_of_range with field, min and max. The machine needs Agent oc.adv_agent_min or later; older Agents do not get these values.

  • cards.*.advanced.xbar_rationumberRequired

    XBAR ratio, 0.05-1.00 with up to 4 decimals, or 0.

  • cards.*.advanced.msvdd_vmin_mvintegerRequired

    MSVDD minimum voltage offset in mV.

    Range-500 – 0

  • cards.*.advanced.xbar_clock_offset_mhzintegerRequired

    XBAR clock offset in MHz.

    Range-1500 – 0

  • cards.*.advanced.vcore_offset_mvintegerRequired

    Core voltage offset in mV.

    Range-200 – 0

  • manual_onlyboolean

    Send true to 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 (no cards or 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 (with field, min, max and busid), oc_no_gpu (the machine has no GPU that supports overclocking).

    • bad_request
    • template_invalid
    • oc_param_out_of_range
    • oc_no_gpu
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    group_forbidden (your role in this shared group is too low), advanced_not_enabled, account_overdue_restricted, or an API key error.

    • group_forbidden
    • advanced_not_enabled
    • account_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 (tasks lists them); send again with manual_only: true.

    • oc_task_managed
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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
      }
    }
  }
}'
POST/api/v1/host/machines/{machine_id}/oc/reapply

Apply 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    group_forbidden (your role in this shared group is too low), advanced_not_enabled, account_overdue_restricted, or an API key error.

    • group_forbidden
    • advanced_not_enabled
    • account_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, or oc_not_set (nothing saved yet).

    • offline
    • rented
    • oc_not_set
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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_...'
PUT/api/v1/host/machines/{machine_id}/oc/manual-only

Turn 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

Request bodyapplication/json

  • enabledbooleanRequired

Responses

  • 200OK

    Saved.

    Response fields (3)
  • 400Bad Request

    bad_request (no enabled), oc_no_gpu.

    • bad_request
    • oc_no_gpu
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    group_forbidden (your role in this shared group is too low), advanced_not_enabled, account_overdue_restricted, or an API key error.

    • group_forbidden
    • advanced_not_enabled
    • account_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 the Retry-After header.

    • 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
}'
POST/api/v1/host/machines/oc/reapply

Apply 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

  • machine_idsstring[]Required

    Machine IDs (machine_id, not the device number). 1-500 items; duplicates are merged.

    Length1 – 500

Responses

  • 200OK

    Per-machine results.

    Response fields (7)
  • 400Bad Request

    bad_request, cross_group.

    • bad_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 (see KeyForbidden).

    • advanced_not_enabled
    • account_overdue_restricted
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • 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"
  ]
}'
POST/api/v1/host/machines/oc-template

Apply 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

  • machine_idsstring[]Required

    Machine IDs (machine_id, not the device number). 1-500 items; duplicates are merged.

    Length1 – 500

  • template_idstring | nullRequired

    null restores the defaults.

  • reset_advancedboolean

    Only 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 (no template_id key, bad machine_ids, or reset_advanced with a template_id), cross_group.

    • bad_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 (see KeyForbidden).

    • advanced_not_enabled
    • account_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 the Retry-After header.

    • 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"
}'
PUT/api/v1/host/machines/{machine_id}/autofan

Set 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

Request bodyapplication/json

  • paramsobjectRequired

    The 7 auto-fan values. The Agent keeps the GPU core near target_core_c and the memory near target_mem_c with the fan between min_fan and max_fan.

  • params.enabledbooleanRequired
  • params.target_core_cintegerRequired

    Range30 – 95

  • params.target_mem_cintegerRequired

    Range40 – 110

  • params.min_fanintegerRequired

    Fan %.

    Range1 – 100

  • params.max_fanintegerRequired

    Fan %, at least min_fan.

    Range1 – 100

  • params.critical_cintegerRequired

    At least target_core_c + 10. Above it for 2 rounds the GPU is handled by overheat; back below critical_c − 10 it recovers.

    Range50 – 110

  • params.overheatstringRequired

    stop_task = stop the compute tasks; hold_gpu = take only that GPU out of its tasks.

    Valuesstop_taskhold_gpu

Responses

  • 200OK

    Saved.

    Response fields (3)
  • 400Bad Request

    bad_request (params does not have exactly the 7 fields, a wrong type, or a bad overheat), autofan_param_invalid (a value out of range; with field, min, max), oc_no_gpu (the machine has no GPU that supports it).

    • bad_request
    • autofan_param_invalid
    • oc_no_gpu
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 403Forbidden

    group_forbidden (your role in this shared group is too low), advanced_not_enabled, account_overdue_restricted, or an API key error.

    • group_forbidden
    • advanced_not_enabled
    • account_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 the Retry-After header.

    • 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"
  }
}'
POST/api/v1/host/machines/autofan-template

Apply 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

  • machine_idsstring[]Required

    Machine IDs (machine_id, not the device number). 1-500 items; duplicates are merged.

    Length1 – 500

  • template_idstring | nullRequired

    null turns auto-fan off.

Responses

  • 200OK

    Per-machine results.

    Response fields (7)
  • 400Bad Request

    bad_request (no template_id key, bad machine_ids), cross_group.

    • bad_request
    • cross_group
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 (see KeyForbidden).

    • advanced_not_enabled
    • account_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 the Retry-After header.

    • 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"
}'
POST/api/v1/host/machines/{machine_id}/remote/password

Change 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

  • machine_idstring· pathRequired

    machine_id of your machine (from GET /api/v1/host/machines), not the device number.

    Example314d1670-872d-4d8d-be94-a4ceea1c0c58

Responses

  • 200OK

    Password changed.

    Response fields (2)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_open
    • rented
    • agent_unsupported
  • 429Too Many Requests

    rate_limited. Wait for the number of seconds in the Retry-After header.

    • rate_limited
  • 503Service Unavailable

    remote_unconfigured, remote_relay_unavailable.

    • remote_unconfigured
    • remote_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_...'
GET/api/v1/host/wallet-vars

List 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

  • group_idstring· query

    A 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, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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 the Retry-After header.

    • rate_limited

Examples

curl 'https://suanzu.ai/api/v1/host/wallet-vars' \
  -H 'Authorization: Bearer sz_live_...'
POST/api/v1/host/wallet-vars

Create 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

  • group_idstring | null

    null = account-wide.

  • namestringRequired

    Length1 – 64

  • descriptionstring

    Length≤ 256

  • valuestringRequired

    Not blank, no NUL.

    Length≤ 4096

Responses

  • 200OK

    Created.

    Response fields (10)
  • 400Bad Request

    bad_request, wallet_var_invalid (bad name, description or value).

    • bad_request
    • wallet_var_invalid
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_forbidden
    • advanced_not_enabled
    • account_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 the Retry-After header.

    • 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"
}'
PUT/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

  • wallet_var_idstring· pathRequired

    id from GET /api/v1/host/wallet-vars.

    Example0f1e2d3c4b5a69788796a5b4c3d2e1f0Pattern^[0-9a-f]{32}$

Request bodyapplication/json

  • namestringRequired

    Length1 – 64

  • descriptionstring

    Length≤ 256

  • valuestringRequired

    Length≤ 4096

Responses

  • 200OK

    Changed.

    Response fields (12)
  • 400Bad Request

    bad_request (for example group_id sent), wallet_var_invalid, task_config_too_large (a task using it would get too large).

    • bad_request
    • wallet_var_invalid
    • task_config_too_large
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_forbidden
    • advanced_not_enabled
    • account_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 the Retry-After header.

    • 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"
}'
DELETE/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

  • wallet_var_idstring· pathRequired

    id from GET /api/v1/host/wallet-vars.

    Example0f1e2d3c4b5a69788796a5b4c3d2e1f0Pattern^[0-9a-f]{32}$

Responses

  • 200OK

    Done.

    Response fields (1)
  • 401Unauthorized

    api_key_invalid, api_key_expired, or unauthorized (no key sent).

    • api_key_invalid
    • api_key_expired
    • unauthorized
  • 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_forbidden
    • advanced_not_enabled
    • account_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 the Retry-After header.

    • rate_limited

Examples

curl -X DELETE 'https://suanzu.ai/api/v1/host/wallet-vars/0f1e2d3c4b5a69788796a5b4c3d2e1f0' \
  -H 'Authorization: Bearer sz_live_...'