All articles
DevelopersOctober 12, 20266 min read

Build an internal knowledge assistant with the AI Box developer API

Connect your intranet, help desk or chat tool to AI Box in a few lines of Python or JavaScript, using its OpenAI-compatible endpoint and folder-scoped keys.

Written for: Software engineers, solution architects, IT teams

Most staff questions — 'what is our leave policy?', 'which form do I use for a refund?' — already have answers in a document somewhere. AI Box can answer them with citations, and its API lets you put that answer inside the tools people already use.

Two endpoints to know

EndpointUse it forKey type
POST /api/queryGrounded answers with page citations from one folderFolder key
POST /v1/chat/completionsDrop-in for tools that already speak the OpenAI formatDeveloper key

A minimal Python example

import requests — then: r = requests.post('http://aibox.local:8000/api/query', headers={'Authorization': 'Bearer aib_live_...'}, json={'question': 'How many leave days do new staff get?'}); print(r.json()['answer']). The response also contains a citations list with document, page and snippet, which your bot can show as links.

Using the OpenAI SDK

Point the official OpenAI library at the box by setting base_url to http://aibox.local:8000/v1 and api_key to your developer key. Existing code, LangChain chains or LiteLLM configs then work with little change.

Good practice

  • Create one folder key per integration so you can rotate or revoke it alone.
  • Keep keys on your server, never in browser code.
  • Show citations to users so they can check the source page.
  • Test requests first in the in-app API tester before writing code.
Full reference

The public Developer API page lists every endpoint with curl, Python and JavaScript examples.

Try it on a document of your own

Ask a sample document a question and see the answer with the exact page it came from — then configure the box your team needs.

Keep reading