Get started

Keys and authentication

Every request carries a key. A test key is free and returns placeholder numbers. A live key returns real solutions and is charged.

In short

  • Send the key in the Authorization header: Bearer and the key.
  • A test key is free and returns placeholder numbers. A live key returns real solutions and costs one call for each solve.
  • A live key works as soon as the account has calls.
  • Keep keys on your server. You see a key one time, when you create it.

Send the key

Send your key in the Authorization header of every request. The open routes GET /v1/health, GET /v1/hands and GET /v1/pricing need no key.

Authorization: Bearer gecko_live_...
How a key looks, where to keep it, and what to do when one leaks

You create keys in the console. A key is the prefix gecko_live_ or gecko_test_, then 40 random characters and 6 check characters. You see a key one time, when you create it.

Keep it in a secret store on your server. Never put a key in a browser page or in a mobile app.

If a key leaks, disable it in the console at once and tell us: it stops working within 20 seconds. An account can hold 20 keys. To make room, delete a disabled key.

Go live

  1. Build your flow with a test key.
  2. Buy a plan or calls in the console under Billing. Payment is by card; the calls are on your account within a minute.
  3. Create a live key in the console under API keys.
  4. Send the same requests with the live key. Only the key changes.

A live key on an account without calls answers 402 insufficient_credits. Nothing is charged for a refused request.

Look it up

Test keys against live keys

what is real with a test key
Live keyTest key
Prefixgecko_live_gecko_test_
Runs onThe solverThe sandbox. No solver runs.
Format of the resultRealReal: the same fields, so your parsing code works. It adds "sandbox": true and a note, and has no root block.
Betting tree and exitsReal. Lines that no hand reaches are left out.Real. Every line of the tree is there.
Strategies and EVsRealPlaceholders: every action equally likely, every EV zero.
Request checksAllThe same checks of field names and plain limits. It does not check locks and node_actions, and it refuses ICM.
ChargeOne call for each solveNone. Your balance does not change. credits and credits_charged in an answer show what a live key would pay.
Speed, queue, cold startRealNot real: no queue and no cold start. One test solve finishes in about a second. A request with many solves takes longer: hundreds of solves take minutes. Do not measure time with a test key.
Solve field"livemode": true"livemode": false

With a test key nothing is charged. A solve still shows "credits": 1, and a request with many solves still counts credits_charged: these numbers show what a live key would pay for the same request.

A test key can read the live solves of its account. It cannot continue them, and a live key cannot continue a test solve: the answer is 422 invalid_request. An Idempotency-Key counts for one mode only.

Live access

Test keys work as soon as you create them. Live keys work as soon as the account has calls: buy a plan or calls in the console, and the next request with a live key is solved. There is no waiting period.

Limits on a key

daily and monthly calls, addresses, expiry

Each key can have its own daily and monthly limit of calls (daily_credits, monthly_credits). Set them in the console. A key that reaches its limit starts no more solves until the next day or month (UTC); other keys of the account continue.

A key can also have a list of allowed IP addresses and an expiry date: contact us to set those. The console shows them on the key.

Check a key

GET /v1/account

GET /v1/account shows the calls you have left (credits), the limits in force and the usage of the key you send.

curl -sS "$GECKO_API/v1/account" -H "Authorization: Bearer $GECKO_KEY"
The answer
{
  "id": "acct_00VcT0dVK9hYwgNL7TOtz",
  "name": "Rivertown Poker Labs",
  "status": "active",
  "credits": 14547,
  "plan": null,
  "limits": {
    "account": {"max_concurrent": 1, "monthly_credits": null, "max_credits_per_request": 20000, "expand_all": true},
    "key": {"rpm": 120, "daily_credits": 5000, "monthly_credits": null}
  },
  "usage": {"account_month": 453, "key_day": 12, "key_month": 453},
  "key": {"id": "key_00VcT0dVWUNMMpSY2DTbJ", "name": "Production server", "env": "live", "hint": "gecko_live_qfP...evB1"}
}

Rotate a key

  • Keep keys on your server. The API is made to be called from a server. Never send a key to a browser or put it in an app.
  • Rotate a key in four steps: create the new key in the console, switch your service to it, disable the old key (it stops within 20 seconds), then delete it. A deleted key cannot be brought back.
  • Use one key for each service or environment, with a name that says where it runs. Give each key a daily limit of calls.
  • If a key leaks, disable it at once and tell us.