Reference
Errors
Every refusal has a status and a stable code. Caps and freezes refuse before any provider sees the request, so a refusal costs nothing.
Codes
StatusCodeMeaning
400invalid_requestMalformed input, or a write without an Idempotency-Key.
401unauthorizedNo credential, or one Tokex does not recognise.
402insufficient_fundsNot enough of that credit.
402budget_exceededThe request would cross a cap. Refused before any provider saw it.
403forbiddenThe key lacks the scope for this action.
403session_requiredOnly an owner session can do this, such as revoking another key.
409slippage_exceededThe pool moved past your floor. Nothing traded.
409insufficient_liquidityThe pool cannot fill that size.
423account_frozenThe account is frozen. Reads still answer.
429rate_limitedToo many requests. Back off, then retry with the same Idempotency-Key.
Retrying
On 429 rate_limited, back off, then retry with the same Idempotency-Key. After a lost reply, check the operation first (tokex_operation_status): the same key returns the first result and never runs twice.