Keys and credits
Create a key, keep it safe, and what each request costs.
Create a key
In the Indax app, open API › Create key and choose Products. Only company admins can create and revoke keys.
| Allowed websites | Key works from | Use it for |
|---|---|---|
Your sites, e.g. https://www.example.com | Those sites' pages, and servers | A search box or chat window in the browser |
| Empty | Servers only | Your back end, a proxy, a nightly job |
https://example.com and https://www.example.com are different sites: list each, plus staging. A key used from another site gets 403 forbidden_origin; a server-only key used from a browser gets 403 server_only_key.
Send it
X-Api-Key also works. On the WebSocket, send it in the hello frame, never in the URL.
Keep it safe
- A website key is visible in page code. That is expected: allowed websites and rate limits protect it.
- Never put a server-only key in page code or a mobile app. Keep it in an environment variable.
- One key per place (site, staging, agency), so you can revoke one alone. Revoked keys stop within a minute.
Credits
Requests use your Indax plan's credits.
| Request | Credits |
|---|---|
| Search | 1 |
| Chat turn | 1 or more by tokens; most turns are 1 or 2 |
Errors on Indax's side, retries with the same x-request-id | 0 |
Every response says what it used (credits_used). Usage in the Indax app shows API search and chat per key. When credits run out, search returns 402 credits_exhausted and chat closes with 4402.