For AI coding agents
One page an AI coding agent can read to build a working integration.
This page is written for an AI coding agent (Claude Code, Cursor, Copilot and others). Give it this page, or the whole section as one file: https://indax.co/docs/products-api/llms-full.txt. Every docs page is also available as Markdown: add .md to its URL.
Task brief
You are adding Indax search and chat to a company's website. Indax indexes the company's public website (products, parts, pages, PDFs) and runs Dax, an assistant scoped to that company. You build the user interface; the API does the rest.
- Base URL:
https://api.indax.net - Key: from the company's Indax app, the API page of the Indax app. Format
indax_live_+ 32 characters. Read it from configuration, never hard-code it in source control. - Two key kinds: website keys (allowed websites listed; used in browser code) and server-only keys (no allowed websites; used only from servers).
Endpoints
Search
Response:
Rules: only q is required. domain picks the company (any company on the Indax network; unknown → 404 unknown_company); each result has company. filters: {category, brand, cert, specs} and facets: true filter products. Link each result to url. Show image when present. Page with cursor = previous next_cursor until it is null.
Chat (WebSocket)
Rules:
- Send
hellofirst, within 10 seconds. Sendmessageonly afterready. - One
messageat a time: wait fordoneorerrorbefore the next. A second message while answering returnserrorwithcode: "busy". - The server keeps the conversation. Send only the new text. Store
conversation_idinsessionStorageand send it inhelloafter a reconnect. - Close codes:
4401bad or missing key → stop and show "chat unavailable";4403site not allowed → stop;4402out of credits → stop and show a contact link;4400bad frame → fix the client. Any other close → reconnect after 2 seconds. - Render
deltatext as plain text, or as Markdown with HTML disabled. Never insert it as raw HTML.
Chat (HTTP fallback)
POST /v1/chat with Authorization and {"text": "...", "conversation_id": "..."} returns text/event-stream: one data: <frame JSON> line per server frame above. Use it from a server or where WebSockets are blocked.
Context (optional, both endpoints)
Only URLs on the company's domain are used; the newest 20 trail pages count. It improves ranking and answers. Build it from location.href, document.title and a sessionStorage list of visited pages.
Errors (HTTPS)
{"error":"<code>","message":"<safe to show>"} with status: 400 invalid, 401 unauthorized, 402 credits_exhausted, 403 forbidden_origin | server_only_key, 429 rate_limited | budget (honor Retry-After), 502 search_failed | chat_failed (retry once), 503 unavailable.
Limits
Searches: 120 a minute per key. Chat: 20 messages every 10 minutes per visitor (session_id, else IP). Message ≤ 2,000 characters; 30 visitor messages per conversation; 20 open sockets per IP.
Credits
Search = 1 credit. Chat turn = max(1, ⌈(input − 0.9·cached + 5·output tokens) ÷ 20,000⌉), usually 1–2. Each response returns credits_used. Debounce search-as-you-type (250 ms, 2+ characters).
Minimal working client (TypeScript, browser)
Common mistakes
- Putting the key in the WebSocket URL. Send it in
hello. - Using a server-only key in the browser (
403 server_only_key), or a website key from a site not on its list (403 forbidden_origin). - Sending the whole conversation each turn. Send only the new message; keep
conversation_id. - Sending a second
messagebeforedone. - Inserting
deltatext as HTML. - Calling search on every keystroke without a debounce.
- Sending names or emails in
session_idor context.
Test checklist
- A search for a known product returns it first, with a link to the company's page.
- Paging with
next_cursorreturns no duplicates. - The chat streams
deltaframes, thendone; a follow-up question keeps the context. - Reloading the page resumes the conversation (
ready.resumed: true). - An invalid key shows a friendly message (close
4401/401). -
429waits forRetry-After;402shows a contact link. - The key is read from configuration and is not in the repository.