Skip to content
Guides

Rate limits and reliability

Requests per minute:

Routes Per IP Per integrator
GET /v3/catalog 600
POST /v3/quote 600 120
POST /v3/orders 300 60
GET /v3/orders, GET /v3/orders/{id} and GET /v3/orders/{id}/changes, together 600
POST /v3/orders/{id}/actions 600

Over a limit, a route answers 429 RATE_LIMITED with retryAfterSeconds. Wait that long before you retry.

  • The per-IP limit is checked before your key, so other traffic from a shared egress IP can use up your allowance.
  • IPv6 clients are counted per /64 network, not per address, so every host in a /64 shares one per-IP allowance.
  • Requests from a Cloudflare Worker in another zone are counted per calling zone (the CF-Worker header), not by the IP that all such Workers share.
  • Limits are counted per edge location and are approximate.

Reading each open order every summary.pollAfterSeconds reaches the 600-a-minute read limit at about 100 to 150 orders in progress, since it is every 10 to 30 seconds per order. Past a few dozen, sync with GET /v3/orders?sort=updatedAt instead. One call returns up to 50 changed orders.

When maintenance pauses Khalani API order admission, POST /v3/quote and POST /v3/orders answer 503 MAINTENANCE with retryAfterSeconds and the Retry-After header:

{ "code": "MAINTENANCE", "message": "Order creation is paused for maintenance", "details": null, "field": null,
"recovery": "retry", "retryAfterSeconds": 300, "requestId": "…" }

The two routes pause together, so a quote never offers an order that creation would refuse. The catalog, order reads, sync and cancels keep working, and orders already created keep settling. GET /v3/catalog works during maintenance, so use it as your readiness check.

An API outage delays quotes, order creation, order reads and settlement. It can’t change an order’s terms, because the rate, the accounts and the deadlines are signed when the order is created, and the contracts enforce them when it publishes and settles. A filled unit always settles at no less than terms.minRate.

If the API is unavailable when an order reaches fillBy, settlement runs once service resumes. Meanwhile the funds stay in the hub contract under the order’s signed terms. If an order hasn’t settled after service is back, contact Khalani with its id.

Contact Khalani through your onboarding channel. Include the order id if there is one, the requestId of the failing response, and the time of the call. Contact Khalani in particular when:

  • an error’s recovery is contact_support,
  • an order shows a notice in summary.notices for longer than you’d expect, or
  • an order stays confirming for more than a few minutes.