PioCloudDocs

PioCloud API

For PioViewer and any program that solves trees on PioCloud: send a tree, pick its flops, see the price, start it, watch it solve and download the results. Everything here works with one personal key.

The same page as Markdown, for programs and agents: https://cloud.piosolver.com/api.md

Start

The API is at https://cloud.piosolver.com/api/v1. Every request carries your key; a reply is JSON.

curl -H "Authorization: Bearer pck_..." https://cloud.piosolver.com/api/v1/me
{ "id": "auth0|...", "email": "[email protected]", "balance": "12.3450" }

Keys

Conventions

Bodies
JSON objects. A field the endpoint does not know is refused, so a typo never passes silently.
Money
Credits, as strings with 4 decimals: "0.0125". Add them as whole ten-thousandths, never as floats.
Accuracy
A percent of the pot: {"pctPot": 0.35}. Exploitability comes the same way, next to the solver's own number. A preflop tree's accuracy is in bb/100: {"bb100": 1}, from 0.5 to 2 (1 is good, 0.5 as good as perfect), and its exploitability carries bb100 and bigBlind (what 1 bb is, in chips: the script's add_info_line "#BB#n" when it has one above 0, else the larger of the first two amounts of the tree's first set_pot) beside pctPot, which there is of the blinds' pot. Or give a level, {"level": "standard"} or {"level": "high"}: the solver solves the tree to its own standard or high accuracy and also stops when the solve no longer improves. Such a run's accuracy reads {"level": "standard"}; while it solves, its board's progress has a null target and "fraction", 0 to 1: how far the solve is on its way to the level, for a progress bar (null before the first reading). A level promises no exploitability: the run is charged however the solve ends.
Limits
120 requests and 30 writes a minute for each user, all keys together. Past that the reply is 429 with Retry-After in seconds.
User-Agent
Send one. Some libraries' default agents are blocked in front of the site (Python's urllib, for one); curl/8.5.0 or your program's name works.

Spots, runs and boards

Spot
A tree: its script, as PioSOLVER takes it, and every run on it. The site calls it a job.
Run
Some flops of the spot solved at one accuracy, at a fixed price in the tier you pick. A run starts as a draft with a price in each tier offered for it, then queued, running, and ends finished or cancelled (cancelling on the way). paused waits on you. A draft is reachable only by its id, is in no list, and is deleted 2 hours after its last change; so is a spot that never had a run started.
Board
One flop of a spot: queued, running, solved, failed or cancelled. A board solved once stays solved while a later run solves it again; its file is there to download.

A session

  1. POST /spots with the script: the spot's id.
  2. GET /spots/{id}/prices: every flop's price in each tier when you solve that one board alone. A job of several flops is often cheaper: get its price from a draft, the next step (Prices and flops).
  3. POST /spots/{id}/runs with the flops and the accuracy: a draft whose quotes give each tier offered for these flops together, with its price. Nothing is charged.
  4. POST /runs/{id}/start with the tier you pick. The price is charged then; with too few credits the run stays a draft and the reply says so. Knowing the tier already, the previous step takes it with "start": true.
  5. GET /spots/{id}/boards, then again with the reply's version and a wait (below): each board's state, live progress, and once solved its result and file, as soon as they change.
  6. Download each solved board's file from its url.

Endpoints

Paths are under https://cloud.piosolver.com/api/v1.

GET /me

Your account: id, email and credit balance, and in api this version's status (Versions).

Starting a run needs a PioCloud subscription, which comes with a PioSOLVER license whose Support Extension is valid. Under subscription (null: none): its plan, when it started and ends, and its credits left this month (also as remainingPct of the month's), gone at creditsUntil. They are a currency apart from balance, your purchased credits: a run's price is taken from them first, 1:1, and the rest from the balance.

{ "id": "auth0|...", "email": "[email protected]", "balance": "12.5000",
  "subscription": { "plan": "PioCloud25", "since": "2026-11-08T09:00:00.000Z",
                    "until": "2027-05-08T09:00:00.000Z", "credits": "20.0000",
                    "remainingPct": 80, "creditsUntil": "2026-12-08T09:00:00.000Z" }, ... }

POST /spots

A new spot. name: 1 to 200 characters; script: the tree's script, up to 1,000,000 bytes, no line over 320,000 bytes and no control characters but tabs. A script the solver cannot take is refused with invalid_script and its errors.

{ "name": "BTN vs BB 3bet", "script": "set_pot 0 0 60\nset_eff_stack 970\n..." }
201 { "id": "nmV7WYmxxEJu", "name": "BTN vs BB 3bet", "createdAt": "2026-11-04T08:00:00.000Z",
      "warnings": ["line 12: go 20 seconds is left out: PioCloud solves to the run's accuracy and saves the file itself"] }

See What a script may contain for the lines it refuses or replaces.

GET /spots

Your spots, the one a run was last added to first, a page at a time: limit (1 to 200, 50 by default) and page (from 0). trashed=true lists the trash instead; the usual list leaves it out. A spot appears once a run on it has started. Each spot has its board counts, what it was charged, and updatedAt: the latest change of the spot, its runs or its boards. Poll the first page and read the boards only of the spots that changed. submittedAt and readySeconds are its latest run's, as on a run.

A spot of one board has it in board: the board, its state and, once solved, its exploitability, stop reason and file size, as in its boards. A list of single-board spots needs no call per spot; the file's url and a solve's live progress are on the boards. A spot of more boards has board null.

{ "data": [ { "id": "nmV7WYmxxEJu", "name": "BTN vs BB 3bet", "status": "running",
              "latestRun": { "id": "aERPMJYppi0y", "status": "running", "accuracy": { "pctPot": 0.35 } },
              "boards": { "total": 30, "queued": 12, "running": 2, "solved": 16, "failed": 0, "cancelled": 0 },
              "board": null, "chargedCredits": "0.4120", "updatedAt": "...",
              "submittedAt": "...", "finishedAt": null, "readySeconds": null,
              "trashed": false, "deleteAfter": null },
            { "id": "G9ecKd88uBQ2", "name": "BTN vs BB KsJs8h", "status": "finished",
              "latestRun": { "id": "YiGKtMvdVvzr", "status": "finished", "accuracy": { "pctPot": 0.35 } },
              "boards": { "total": 1, "queued": 0, "running": 0, "solved": 1, "failed": 0, "cancelled": 0 },
              "board": { "board": "KsJs8h", "status": "solved",
                         "exploitability": { "value": 0.549, "pctPot": 0.09982 },
                         "stopReason": "(required accuracy reached)", "bytes": 15919467 },
              "chargedCredits": "0.0163", "updatedAt": "...",
              "submittedAt": "...", "finishedAt": "...", "readySeconds": 135.7,
              "trashed": false, "deleteAfter": null } ],
  "total": 41, "page": 0, "limit": 50, "next": null }

GET /spots/{id}

One spot and its runs.

POST /spots/{id}/trash

Moves the spot to the trash; it is deleted later, files included. A spot with a run still going is refused (409 wrong_state, with the run's id): cancel the run first. Trashing a spot in the trash does nothing.

GET /spots/{id}/prices?pctPot=0.35

These are the prices for solving one board alone. A job of several flops is often cheaper: for its price, make a draft run with its flops (POST /spots/{id}/runs without start) and read its quotes.

Every flop's price in each tier at that accuracy (0.35 by default; 0.05 to 5 are priced). A tier lists the flops it cannot take under tooLarge and at most maxBoards flops a run (null: any). A flop the tier is not offered for as a one-flop run is in neither its prices nor tooLarge, and a tier offered for no flop alone is not listed. A flop no tier can price is in the last such tier's tooLarge only, so its reason shows once; a tier left with nothing to show is not listed. See Prices and flops.

A preflop tree has one price, under "preflop", at ?bb100=1 (the default; 0.5 to 2) or at ?level=standard or ?level=high.

{ "spotId": "nmV7WYmxxEJu", "accuracy": { "pctPot": 0.35 },
  "tiers": [ { "tier": "standard", "name": "Standard",
               "prices": { "AsAhAd": "0.0048", "AsKh5d": "0.0125", ... },
               "tooLarge": { "boards": [], "message": "This tree is too large" },
               "maxBoards": null, "maxBoardsMessage": null }, ... ] }

POST /prices

The same prices for a script that is not stored: send script and, if not the default, accuracy as a run names it. Nothing is kept, so a client can show a price before the user decides. The reply is that of a spot's prices, with spotId null and the script's warnings; a script PioCloud would not run is refused as creating a spot refuses it (400 invalid_script).

{ "script": "...", "accuracy": { "pctPot": 0.35 } }

GET /spots/{id}/boards

Every board of the spot, across all its runs, in one reply: its state, its live progress while a run solves it, and once solved its exploitability, stop reason, file size and file url.

?after=<version>&wait=<seconds>
Optional, together: wait up to 1 to 30 seconds for a change past the version an earlier reply gave, and answer as soon as one comes; unchanged at the end of the wait. See Waiting for changes.
{ "spotId": "nmV7WYmxxEJu", "name": "BTN vs BB 3bet",
  "boards": [ { "board": "7d6s2h", "status": "running", "runId": "aERPMJYppi0y",
                "exploitability": null,
                "progress": { "runId": "aERPMJYppi0y",
                              "exploitability": { "value": 6.2, "pctPot": 1.55 },
                              "first": { "value": 6.2, "pctPot": 1.55 },
                              "target": { "pctPot": 0.05 } },
                "phase": "solving", "stopReason": null, "url": null, "bytes": null },
              { "board": "AsKh5d", "status": "solved", "runId": "3LKVwZn6iAiR",
                "exploitability": { "value": 0.619, "pctPot": 0.1548 }, "progress": null,
                "phase": null, "stopReason": "(required accuracy reached)",
                "url": "https://cloud.piosolver.com/download/sims/...", "bytes": 18734211 } ],
  "totalBytes": null, "version": "1793893771517", "nextCheckS": 10 }

POST /spots/{id}/runs

A run on the spot. Fields:

boards
1 to 1755 flops, any suits: "Ks5h2s", each at most once. A weight may follow: "Ks5h2s:15.76". A preflop tree is solved whole, on the flops its script names: ["preflop"], and its one file is preflop.cfr.
accuracy
{"pctPot": 0.35}, the default. For a preflop tree {"bb100": 1}, the default, from 0.5 to 2, or {"level": "standard"} / {"level": "high"}. The other kind's unit is refused.
start
true starts it at once and charges its price; without it the run is a draft whose reply has the price in each tier offered for it under quotes. A tier not offered for these flops is left out; when no tier takes them, one tier is listed, with the reason.
tier
standard or fast; the first one offered when left out.
saveSize
What the files keep: no_rivers (the default) or no_turns. A preflop tree is saved as no_turns only: leave it out or send no_turns; another value is refused.
flopSubset
Only for a preflop tree: solve it on one of PioSOLVER's flop subsets instead of the flops its script names. The number of flops of the subset, from 3 to 362, for example 26, 50, 96 or 184; a number that is no subset's size is refused, with the sizes in the error. The same field on the prices prices the tree on that subset.
name
Renames the spot, 1 to 200 characters: a spot made before its name was known gets it as it runs. Left out, the name stays.
{ "boards": ["Ks5h2s", "AhKc5s"], "accuracy": { "pctPot": 0.35 }, "tier": "standard", "start": true }

A draft's reply carries its prices:

"quotes": { "tiers": [ { "tier": "standard", "name": "Standard", "credits": "9.3996", "refusal": null },
                         { "tier": "fast", "name": "Fast", "credits": "14.9561", "refusal": null } ],
              "estimateError": null }

The reply (201) is the run, as below. Too few credits: 402 insufficient_credits; no subscription: 402 subscription_required. Either way the draft is kept, with its id in details.

With start, expectedCredits is the price the user saw, as the prices give it ("9.3996": the run's total in its tier). If the run costs anything else now, nothing is charged: 409 price_changed, with the price now as credits and the kept draft's runId in details. Show the new price, and start that draft with it when the user agrees.

GET /runs/{id}

A run: status, settings, board counts and money. price is what it costs; once it settles, returnedCredits is what came back for boards it did not deliver, and chargedCredits what it cost in the end: what was charged and not returned. notChargedCredits splits what was not charged by why: accuracy (boards that did not reach the accuracy), error (boards that failed, or were stopped by us) and cancelled (boards you canceled); all zero until the run settles. notCharged has the reason per board. submittedAt is when it was submitted (null for a draft); once it has finished, readySeconds is the time from then until all its boards could be downloaded.

{ "id": "aERPMJYppi0y", "spotId": "nmV7WYmxxEJu", "status": "running", "endReason": null,
  "createdAt": "...", "submittedAt": "...", "startedAt": "...", "finishedAt": null, "readySeconds": null,
  "settings": { "accuracy": { "pctPot": 0.05 }, "saveSize": "no_rivers" },
  "boards": { "total": 1, "queued": 0, "running": 1, "solved": 0, "failed": 0, "cancelled": 0 },
  "chargedCredits": "0.0389",
  "price": { "tier": "standard", "credits": "0.0389", "settled": false,
             "returnedCredits": "0.0000", "notCharged": {},
             "notChargedCredits": { "accuracy": "0.0000", "error": "0.0000", "cancelled": "0.0000" } },
  "quotes": null }

POST /runs/{id}/start

Starts a draft, in tier if given, and renames its spot to name if given. Only a draft starts (409 wrong_state otherwise). expectedCredits works as on a run made with start.

POST /runs/{id}/cancel

Stops a run. Boards already solving finish and are charged; the others are not, and their price comes back when the run settles. Solved boards stay downloadable.

POST /batches

A batch is a set of draft runs priced as one and started all or none. A tier offered only from some price is judged on the batch's total, and a large total may get a discount. The reply (201) carries the batch's id.

POST /batches/{id}/runs

Makes up to 25 drafts in one call, each on a spot of yours, and puts them in the batch. A batch takes at most 500 runs and 20,000 boards.

{ "runs": [ { "spotId": "V1StGXR8_Z5j", "boards": ["Ks5h2s"], "accuracy": { "pctPot": 0.35 } },
            { "spotId": "Qm3xP0s8dK2w", "boards": ["AhKc5s", "7d6d2c"], "saveSize": "no_turns" } ] }

The reply (201) lists each job with its runId, or its error when it was not added. A draft made with POST /spots/{id}/runs joins a batch with "batch": "<id>", and DELETE /batches/{id}/runs/{runId} takes one out.

GET /batches/{id}

The batch: its runs, its boards by state, what it was charged, and while it is a draft its price in each tier:

"status": "draft",
  "quotes": { "tiers": [ { "tier": "standard", "name": "Standard", "listCredits": "112.4000",
                           "discountPct": 10, "credits": "101.1600", "refusal": null, "refusedRuns": [] } ],
              "notPriced": [] }

listCredits is the sum of the runs' prices, credits what the batch costs after discountPct percent off. A tier with a refusal cannot start the batch; refusedRuns names the runs it cannot take, and notPriced the drafts no tier can price. chargedCredits is what its runs were charged and not returned, and notChargedCredits what they were not charged, split as on a run.

POST /batches/{id}/start

Starts every draft of the batch in tier (the first tier that takes the batch when left out), or none: one charge for the total. Too few credits: 402 insufficient_credits, and nothing starts. A started batch takes no more runs. Each run then goes on as any run does, with its own boards, files and settlement; its price is its share of the batch's, the discount taken off every board.

POST /batches/{id}/cancel

Cancels every run of a started batch that is still going, as POST /runs/{id}/cancel does for one.

What a script may contain

A spot's script is a PioSOLVER script for one tree, postflop or preflop. PioCloud checks it when the spot is made: a refused line fails POST /spots with invalid_script and an error naming the line; a line PioCloud replaces comes back in the reply's warnings.

Run as written:

Tree
set_range, set_eff_stack, set_pot, add_line, remove_line, force_line, clear_lines
EV models
set_rake, set_icm, set_icm_point, reset_icm_tables
Locks and strategies
set_freq_lock, clear_freq_lock, clear_freq_locks, eliminate_path, lock_node, unlock_node, combo_lock_node, show_locked_combos, set_strategy, set_equal_strats, set_mes, round_up_to
Incentives
set_incentives_node, set_incentives_line, clear_incentives
Info
add_info_line
Folded ranges
set_folded_range, clear_folded_ranges
Preflop tree
add_preflop_line, remove_preflop_line, clear_preflop_lines, build_preflop_tree, add_to_subset, reset_subset, add_schematic_tree, add_all_flops

PioCloud's own, whatever the script says:

Accepted only at PioCloud's value, as PioViewer writes them:

Refused, each with its line in the error:

And the script as a whole:

Prices and flops

A flop's key in the list, in JavaScript:

// The key of a flop in the price list: ranks high to low, suits renamed
// the way PioSOLVER writes its flop subsets (AhKc5s is AsKh5d)
function priceKey(flop) {
  const R = "23456789TJQKA";
  const [a, b, c] = flop
    .match(/../g)
    .map((card) => ({ r: card[0].toUpperCase(), s: card[1].toLowerCase() }))
    .sort((x, y) => R.indexOf(y.r) - R.indexOf(x.r));
  const same = (x, y) => x.s === y.s;
  let s2, s3;
  if (a.r === b.r && b.r === c.r) [s2, s3] = ["h", "d"];
  else if (a.r === b.r) [s2, s3] = ["h", same(c, a) || same(c, b) ? "s" : "d"];
  else if (b.r === c.r) [s2, s3] = same(a, b) || same(a, c) ? ["s", "h"] : ["h", "d"];
  else {
    s2 = same(b, a) ? "s" : "h";
    s3 = same(c, a) ? "s" : same(c, b) ? s2 : s2 === "s" ? "h" : "d";
  }
  return a.r + "s" + b.r + s2 + c.r + s3;
}

Progress

While a run solves a board, the board carries progress: the latest exploitability the solver printed, the first one of this solve, and the run's accuracy as the target. The solver prints its exploitability every few seconds on a fast tree and at least once a minute on a slow one; a new value reaches the API within about 10 seconds. Before the first, progress is null.

A board waits for a machine as queued; once a machine has it, it is running and has phase: "preparing" while the solver builds the tree, "solving" from its first iteration, "saving" once it has stopped and the tree is being saved, "uploading" while the file goes to PioCloud's storage. The board is solved once its file can be downloaded. From the stop, the latest exploitability is the result: at or below the target, or short of it at the time limit. Saving and uploading take seconds on a small tree and longer on a big one; a new phase reaches the API within a few seconds. A board no run solves has phase null.

Waiting for changes. Each boards reply has a version. Send it back as after with a wait of up to 30 seconds: PioCloud holds the request until the spot changes (a board's state, phase or reading, a new run) and answers within about half a second of it, or answers unchanged when the wait is over. Then ask again with the new version. A client sees each change at once and asks about twice a minute while nothing happens; a held request counts once against the limits. Keep at most one waiting request per spot.

GET /spots/nmV7WYmxxEJu/boards                              → version "1793893771517"
GET /spots/nmV7WYmxxEJu/boards?after=1793893771517&wait=30  → held, then the next change

A client that does not wait can read nextCheckS: when a new read is worth it, in seconds. 2 around a solve's start and end, 10 while a board solves (a new reading reaches the API at most every 10 seconds), 30 while boards wait for machines, null once no board is queued or running.

PioCloud's own bar fills on the solve's log scale, from the first value to the target:

fill = now <= target ? 1 : log(first / now) / log(first / target)

Exploitability in % of the pot is the solver's number in chips over the pot; on an ICM tree, its utility turned into chips first.

Downloads

A solved board's url is its file. Fetch it with the same Authorization: Bearer pck_... header, and follow redirects (curl -L): the answer may be a redirect to a link that is valid for ten minutes and needs no header. Ask the url again for a new link. The url appears from the spot's first solved board. bytes is the file's size, and totalBytes the spot's, once every size is known.

Errors

A refused request has an HTTP status and a stable code to branch on:

{ "error": { "code": "wrong_state", "message": "Only a draft starts", "details": { "status": "running" } } }
400
validation_failed (a field or parameter; details say which), invalid_request (not JSON), invalid_script, not_priceable (the tree or a flop cannot be priced)
401, 403
unauthorized (no key, or a revoked one), forbidden
402
insufficient_credits, subscription_required (see /me)
404
not_found: no such object of yours, or no such endpoint
409
wrong_state: not now, in this state; price_changed: the price is not the one expected
410
api_version_retired: this version of the API is no longer served (Versions)
413
payload_too_large: a body over 2 MB
429
rate_limited: wait Retry-After seconds
500, 503
internal_error, estimator_unavailable: try again in a minute

Versions

This is version 1, at /api/v1. Within a version, changes only add: new fields in replies, new optional fields in requests, new endpoints. Ignore reply fields you do not know, and your client keeps working as the API grows.

A change that would break a client (a field removed, renamed or meaning something else) comes as a new version beside this one, at /api/v2. The old version keeps working for at least three months after that. Meanwhile every one of its replies carries a Sunset header with the date it ends, and GET /me says so in api:

"api": { "version": "v1", "status": "deprecated", "sunsetAt": "2027-03-01T00:00:00.000Z", "docs": "..." }

status is current until then. Check it now and then, and tell your users before the date. After it, every call to the old version answers 410 api_version_retired, with the date and a link here.