Running it

Errors

This page lists every error code of the API: what it means, what to do, and whether the same request can work later.

In short

  • Every error is one JSON document with a stable code. Write your program against the code, not against the text.
  • An error answer never costs a call.
  • Retry only 429 and 503, after the wait in Retry-After.
  • Send us the request_id when you ask about an error.

The shape of an error

Every error has one shape: a JSON document of the type application/problem+json. code is stable: write your program against it, not against the text. detail is a sentence for a person.

request_id is the same as the Request-Id header. Some errors add fields, such as estimate, lines or solve_id. type is a link to the code's row on this page.

{
  "type": "https://api.gtogecko.com/docs/errors#error-no_such_line",
  "title": "No such line",
  "status": 422,
  "code": "no_such_line",
  "detail": "That line does not end the street with chips behind. The lines are: c c; c b33 c; c b33 b199 c; b33 c; b33 b199 c",
  "request_id": "req_6ac2d4ca499b41b8e0e1",
  "lines": [["c", "c"], ["c", "b33", "c"], ["c", "b33", "b199", "c"], ["b33", "c"], ["b33", "b199", "c"]]
}
A sample that sends a bad request and reads the error

The sample sends a small request with a misspelled field and reads the error. It starts no solve.

# -i shows the status and the Request-Id header
jq '. + {bet_size: [0.5]}' spot.json > bad.json
curl -sS -i -X POST "$GECKO_API/v1/solves" \
  -H "Authorization: Bearer $GECKO_KEY" -H "Content-Type: application/json" \
  -d @bad.json

Every code

“Retry” says whether the same request can work later without a change. “Charged” is always no: an error answer never costs a call. The type of an error is a link to its row here.

The key and the account

invalid_key, key_disabled, key_expired, ip_not_allowed, account_suspended, live_access_pending, rate_limited, credit_limit
CodeStatusMeaning, and what to doRetryCharged

invalid_key

401The key is missing, malformed or not known. Send Authorization: Bearer and the whole key.NoNo

key_disabled

401The key is disabled. Enable it in the console or use another key.NoNo

key_expired

401The key is past its expiry date. Create a new key.NoNo

ip_not_allowed

403The key has a list of allowed addresses and this request came from another one.NoNo

account_suspended

403The account is suspended. Contact us.NoNo

live_access_pending

403Live keys are not switched on for this account. This is not in use today: live keys work as soon as the account has calls. If you get it, write to us.NoNo

rate_limited

429Too many requests a minute for this key. Wait the seconds in Retry-After (also retry_after in the body).Yes, after the waitNo

credit_limit

403A daily or monthly limit of calls of the key or the account is reached. The answer has solve_id: the request is kept as skipped. Raise the key's limit in the console, ask us about the account's limit, or wait for the next day or month (UTC).After the limit changesNo

The request

invalid_request, request_too_large, no_such_line, max_credits_exceeded, insufficient_credits, expand_not_allowed, idempotency_conflict, request_in_progress, not_started, not_found, method_not_allowed, http_error
CodeStatusMeaning, and what to doRetryCharged

invalid_request

422The body is not JSON of the expected shape, a field name is not known, a value is outside its limits, or the solver refused the spot. detail names the field and the reason. A POST without the header Content-Type: application/json is refused with “Send the body as JSON with the header Content-Type: application/json.” When the solver refused the spot, the answer has solve_id and the solve is kept as failed.No: change the requestNo

request_too_large

413The body is above 2 MiB, or the spot is too large with its locks. Lock fewer hands.NoNo

no_such_line

422A line, in the request or in a then step or expand level, is not a line that ends its street with chips behind. lines has the lines that do.No: change the lineNo

max_credits_exceeded

422The estimate is above the budget of the request. The answer has estimate and max_credits. Raise max_credits, name fewer lines or cards, or send allow_partial.NoNo

insufficient_credits

402The estimate is above your balance. The answer has estimate and credits, or, when a request with allow_partial could not start its first solve, solve_id: that request is kept as skipped. Buy calls, or send allow_partial.After you buy callsNo

expand_not_allowed

403This account cannot expand all lines with all or distinct cards. Name the lines or the cards.NoNo

idempotency_conflict

409This Idempotency-Key was used with another body in the last 24 hours. Use a new key for a new request.NoNo

request_in_progress

409The first request with this Idempotency-Key is still being created. Wait the seconds in Retry-After.Yes, after the waitNo

not_started

422The request could not start its first solve. detail says why.NoNo

not_found

404There is no such route, or no such solve in this account. An id that is not a solve id answers the same.NoNo

method_not_allowed

405The route does not take this HTTP method.NoNo

http_error

4xxThe service could not handle the HTTP request. detail says why.NoNo

Solves and results

parent_not_complete, parent_expired, not_ready, not_a_solve, no_such_node, expired, result_unavailable
CodeStatusMeaning, and what to doRetryCharged

parent_not_complete

409The parent is not a complete solve of one street. Wait for it, or check its status.When the parent is completeNo

parent_expired

410The parent's result has expired. Solve the spot again.NoNo

not_ready

409The solve has no result: it is not complete yet, or it ended without one. solve_status has its status.When the solve is completeNo

not_a_solve

409A batch has no result of its own. Read the solves under it with /children.NoNo

no_such_node

404The result has no node with this id. List the nodes with GET /v1/solves/{id}/nodes.NoNo

expired

410The result is past expires_at. Solve the spot again.NoNo

result_unavailable

410, 502The result cannot be read any more. Solve the spot again.NoNo

The service

solver_unavailable, temporarily_unavailable, internal_error, billing_unavailable
CodeStatusMeaning, and what to doRetryCharged

solver_unavailable

503The solver cannot be reached now.Yes, with back-offNo

temporarily_unavailable

503The service could not finish this request. Wait the seconds in Retry-After (also retry_after in the body).Yes, with back-offNo

internal_error

500A fault on our side. Sending the request again will not help. Contact us with the request id.NoNo

billing_unavailable

503Card payments are not set up. Contact us for an invoice.NoNo

Look it up

Refusals that leave a record

a refusal with a solve_id

Most refusals come from a check before anything is made. They leave nothing behind.

A few refusals come after the request was made. These have a solve_id in their body.

RefusalWhenThe solve it leaves
403 credit_limitA limit of calls of the key or the account is reached.skipped
402 insufficient_credits with solve_idThe calls ran out when the first solve was about to start: with allow_partial, or when another request used them first.skipped
403 account_suspended with solve_idThe account was suspended when the first solve was about to start.skipped
422 invalid_request with solve_idThe solver refused the spot.failed

That solve shows in GET /v1/solves and in the console under Requests, with the reason in its error. It was not charged. A repeat with the same Idempotency-Key and body gets the same refusal again.

The usual 402 insufficient_credits is a check: the estimate is above your balance. It has estimate and credits, no solve_id, and it leaves nothing.

Errors on a solve

a solve that ends failed, skipped or cancelled

A request that was accepted can still end without a result. Then the HTTP status is 200 and the solve has "status": "failed", "skipped" or "cancelled" and an error with a code and a message. None of these is charged.

solver_failedfailed
The solver could not solve this spot, or the result was above 16 MiB. For the size: use fewer sizes.
solver_timeoutfailed
The solver did not finish in 30 minutes.
solver_unavailablefailed
The solver could not be reached after several tries. Send the solve again later.
invalid_requestfailed
The solver refused the spot, for example accurate mode on a street that is not a turn inside a then or expand request.
parent_unavailablefailed
The street before cannot be continued any more: its result is gone, or the solver was updated after it was solved. Solve the street before it again.
max_credits, insufficient_credits, credit_limit, account_suspendedskipped
The request stopped before this solve started. The same word is in tree.stop_reason.
cancelledcancelled
You cancelled the request before this solve started.