Errors and limits
Every error, the rate limits, and how to retry.
Error format
Every HTTPS error is JSON with a code you can branch on and a message you can show:
| Status | error | Meaning | What to do |
|---|---|---|---|
| 400 | invalid | A field is missing or out of range. The message names it. | Fix the request. |
| 401 | unauthorized | No key, a wrong key, or a revoked key. | Check the key. |
| 402 | credits_exhausted | Your plan's credits for this period are used up. | Show a fallback; an admin adds credits. |
| 403 | forbidden_origin | The browser's site is not on the key's allowed websites. | Add the site to the key in the Indax app. |
| 403 | server_only_key | A server-only key was used from a browser. | Use a website key in the browser. |
| 404 | unknown_company | domain names a company that is not on the Indax network. | Check the domain. |
| 429 | rate_limited | Too many requests. Retry-After says how many seconds to wait. | Wait, then retry. |
| 429 | budget | Chat is paused for today for your company. | Retry tomorrow; search still works. |
| 502 | search_failed, chat_failed | Indax could not answer. Not charged. | Retry once after 1 second. |
| 503 | unavailable | The API is paused for maintenance. | Retry later. |
In chat, errors arrive as error objects with a code: busy (a message arrived before done), rate_limited, budget (chat paused for today), invalid (empty, too long, or 30 messages reached), model_error or chat_failed (try again). WebSocket close codes: see Chat.
Limits
| Limit | Value |
|---|---|
| Searches per key | 120 a minute |
Chat messages per visitor (session_id, else IP address) | 20 every 10 minutes |
| Open chat sockets per IP address | 20 |
q | 200 characters |
| Chat message | 2,000 characters |
| Messages in one conversation | 30 visitor messages |
| Page context trail | 50 accepted, newest 20 used |
| Results per search page / per query | 50 / 100 |
| Idle chat socket | Closed after 15 minutes |
Need higher limits? Email andre@indax.co.
Retry
Send the same x-request-id on each try, so a retried search is charged once.