RESOURCES — API REFERENCE

9xAI's APIs, documented.

Copilot session APIs, the model router, agent APIs, RAG and knowledge APIs, and document intelligence — reference documentation for every endpoint.

Authentication

Every request is authenticated with an API key, passed as a Bearer token in the Authorization header. Keys are managed from your account dashboard.

Authorization: Bearer YOUR_API_KEY

Creating a copilot session

A session is the basic unit of interaction with any of the 14 industry copilots, or with the general-purpose 9xChat. The copilot in the URL path determines which domain-specific context handles the session.

const res = await fetch("https://api.9xai.in/copilot/engineering/sessions", {
  method: "POST",
  headers: { Authorization: "Bearer YOUR_API_KEY" },
  body: JSON.stringify({ title: "New session" })
});

Replace engineering with any of the 14 industry copilots, or use the general-purpose 9xChat endpoint for work that doesn't need a specific domain lens.

Sending a message into a session

const res = await fetch("https://api.9xai.in/copilot/engineering/sessions/SESSION_ID/messages", {
  method: "POST",
  headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({ text: "Check this isometric against the P&ID" })
});

Model Router (direct access)

Most integrations let the Model Router run automatically as part of a copilot session. For custom pipelines that need a routing decision on its own, the router is also available directly.

const res = await fetch("https://api.9xai.in/router/decide", {
  method: "POST",
  headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({ task: "Summarize this 40-page contract", domain: "legal" })
});

Returns the model selected for the request along with the reasoning behind the selection. See the blog post on using the Model Router programmatically for more on when direct access makes sense.

Other endpoints

Agent APIs

Multi-step task execution via 9xAgents — reading documents, checking systems, and carrying a task through to completion.

RAG & Knowledge APIs

Connect your own organization's data as context for copilot responses.

Document Intelligence

Programmatic access to document digitisation and structured extraction.

Vision

Image and drawing analysis, used internally by copilots like Engineering and Agriculture.

For a narrative walkthrough of a first integration, see A first integration with the 9xAI API.

Ready to put 9xAI to work?