API reference

Service

Three open routes that need no key: the state of the service, the order of the hands, and the price list.

In short

  • Three open routes: no key is needed.
  • GET /v1/health answers 503 with "status": "degraded" when the solver cannot be reached.

The Python and JavaScript samples use API from the quick start.

The routes

GET /v1/health

State of the service, what the solver supports, warm or cold.

The state of the service now: whether the solver can be reached, what it supports, whether it is warm, and the typical time of a solve on each street.

No keyFree

Request

curl -sS "$GECKO_API/v1/health"

Answer

{
  "status": "ok",
  // solver: its version, and what it supports (rake, tree options, locks, iterations, accuracy, ICM)
  "solver": {"model_id": "2bf1217b..."},
  "pool": {
    "state": "warm",
    "typical_seconds": {"flop": 4.0, "turn": 2.0, "river": 1.5},
    "cold_start_seconds": 45,
    "waiting": 0
  }
}

When the solver cannot be reached, status is "degraded", solver is null and the HTTP status is 503. solver.status is the solver's own word for its state: "ready" when it takes requests.

solver also lists what the solver takes now: rake_range, tree_options, node_locks, iterations, accuracy and icm. More in warm and cold solver.

GET /v1/hands

The order of the 1,326 hands.

The names of the 1,326 hands in the order of every list of weights: in a range you send as a list, and in a result.

No keyFree

Request

curl -sS "$GECKO_API/v1/hands" | jq '{order, count: (.hands | length), first: .hands[0], last: .hands[-1]}' 

Answer

{
  "order": "pio-rank-cdhs-high-low-v1",
  "hands": ["2d2c", "2h2c", "2h2d", "2s2c", "2s2d", "2s2h", "3c2c", ..., "AsAc", "AsAd", "AsAh"]
}

A hand is written with the higher card first, and for a pair the higher suit first in the order c, d, h, s. More in ranges.

GET /v1/pricing

The price of a call, plans and packs.

The price list: what one solve costs in calls, the monthly plans, and the pay-per-call packs at the price without a plan.

No keyFree

Request

curl -sS "$GECKO_API/v1/pricing" | jq '{currency, plans: [.plans[].id], packs: [.packs[].id]}' 

Answer

{
  "currency": "usd",
  "credits": {"street": {"flop": 1, "turn": 1, "river": 1}, "iterations": {"500": 1, "2000": 1}, "accuracy": {"fast": 1, "accurate": 1}},
  "packs": [{"id": "calls-500", "name": "500 calls", "credits": 500, "amount": 5000}, ...],
  "plans": [{"id": "starter", "name": "Starter: 5,000 calls a month", "credits": 5000, "amount": 25000, "overage_cents": 7}, ...],
  "pay_as_you_go": {"cents_per_call": 10},
  "enterprise": {"name": "Enterprise", "amount": 675000, "note": "Unlimited calls on a dedicated GPU. Contact us."},
  "cents_per_extra_call": 10,
  "lowest_pack_price_per_credit": 0.1
}

amount is in cents. overage_cents is the price of one call above the plan, in cents; it can be 2.5. cents_per_extra_call is the price of one more call, in cents: the pay-per-call price here, because this route takes no key.

lowest_pack_price_per_credit is the lowest price of one call in a pack, in the main unit of the currency: 0.1 is ten cents. The numbers in this sample can be out of date: the price list shows the live ones.