The answer shape
A successful answer is JSON withdata and meta. A list also has page.
An error has a different shape. See Limits and errors.
Three routes answer in their own standard format, with no
data and no meta:
GET /v1/openapi.jsonanswers a plain OpenAPI 3.1 document.GET /v1/idl.jsonanswers the program’s plain Anchor IDL.GET /v1/machines/{machine}/brief.mdanswers Markdown, not JSON.
Amounts are strings of base units
Every on-chain amount is a whole number written as a string, for example"912000000". JSON numbers lose precision above 2^53, and a Solana u64 can be much larger. So the API never sends an amount as a JSON number.
The string counts base units: the token’s smallest unit. To show an amount, divide it by 10 to the power of the token’s decimals. A machine’s coin decimals are in tokenDecimals. USDC has 6 decimals, and SOL has 9 (one SOL is 1,000,000,000 lamports).
Keep amounts as BigInt while you add, compare or multiply. Turn them into text only at the end.
tickets, multiplierBps, tokenDecimals, count, attempts and the stats counters. Times are Unix milliseconds as JSON numbers, for example createdAt and at. Slots and sequence numbers are u64 values, so they are strings.
Basis points and tickets
- A basis point (bps) is one hundredth of a percent. 10,000 bps is 100%. A tier’s
multiplierBpsof 15,000 pays 1.5 times the coins the pack bought. - A ticket is one equal chance in a draw. Every machine’s tiers add up to 65,536 tickets. A tier’s chance is
tickets / 65536. See Prizes and odds.
Pages
A list route sends at mostlimit rows. It also sends page.nextCursor. To get the next page, send that value back as cursor. When page.nextCursor is null, you have the last page.
400 bad_request. Start again from the first page.
Query parameters are strict
Each route accepts only its own query parameters. An unknown parameter, or a parameter sent twice, answers400 bad_request. The message names the parameters that the route accepts. So a typo fails at once and does not quietly do nothing.
Only the two list routes, /v1/machines and /v1/machines/{machine}/pulls, take limit and cursor. /v1/machines also takes mint. Every other route takes no query parameters.
Headers
Your browser code can read
retry-after and x-gabox-cluster, because the API exposes both to scripts.
To send an API key, add Authorization: Bearer gbx_.... Reads do not need a key.
How fresh the data is
The API reads the Gabox index, not the chain directly. The index usually follows the chain within seconds. A brand-new machine or draw can answer404 not_found for a short time, until the index sees it. Ask again after a second or two.
GET /v1/stats returns indexedSlot, the newest slot that the index has read.