Launch / Go live
Keys and limits
Which key goes where, how often you can call, and how large an order can be.
| Secret key | Publishable key | |
|---|---|---|
| Prefix | mxk_live_, mxk_test_ | mxk_pk_live_, mxk_pk_test_ |
| Lives in | Your server | Your page |
| Can | Quotes, orders, webhooks, your order list | Prices, quotes, status, address checks |
| Bound to | Nothing | The origins Maxy issued it for |
Send it as x-maxy-key or Authorization: Bearer. Maxy issues keys and keeps only a hash. A key cannot move funds or sign. Every route takes one, apart from /health, the status page and POST /sandbox/keys.
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/key"
To rotate: POST /keys/rotate, deploy the new key, then revoke the old one with DELETE /keys/{prefix}. The SDK throws if a secret key is used in a browser page.
| Code | HTTP | Cause |
|---|---|---|
invalid_api_key | 401 | Malformed or unknown |
key_revoked | 403 | Use your new key |
scope_denied | 403 | A publishable key tried to place an order |
origin_not_allowed | 403 | Used on another site, or from a server |
Rate limits
| Caller | Limit |
|---|---|
| With a key | 600 calls a minute, per key |
Without a key (/health, the status page, getting a test key) | 120 calls a minute, per IP |
| Test key | 120 calls a minute |
| Price reads | Ten times the above, counted apart |
Over the limit, the API answers 429 with Retry-After and does nothing. Ask Maxy for more. Every answer also says where you stand:
RateLimit-Limit: 600 RateLimit-Remaining: 599 RateLimit-Reset: 60
Every call except POST /webhooks can be retried as is. The order id makes it safe: the same signed order returns the same orderId, and one escrow per intent. The SDK retries reads twice on 429, 502, 503, 504 or a dropped connection. Store orderId the moment you have it. Every answer carries x-request-id: log it, and quote it to Maxy.
Order size
| Rule | Where it shows | Show the user |
|---|---|---|
| Smallest buy with an EVM coin: 546 sats after costs | limits.minSats, amount_out_of_range | "Too small: orders start at 546 sats after costs. Try a larger amount." |
| Smallest sell about $10, smallest Solana order about $2 | routes in GET /limits | The same, with the amount |
| Your key's cap, $100 unless agreed | issues.orderCap, order_cap_exceeded | "Order size is capped for this API key. Try $100 or less." |
Prices and quotes answer at any size, so the user always sees what an order would get, and the button stays live. The order size cap is checked when the user moves to place it, before anything is signed.
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/limits"
Offer the fix on the same screen: "Use $100" fills in issues.orderCap.capUsd. To ask for a higher cap: POST /limits/requests.
A quote Maxy cannot fill answers 200 with liquidityAvailable: false and no steps. No figure is named. When the user clicks, offer a smaller amount; an aggregator ranks the next source.