canonical: https://jentic.com/apis/contextual.ai/contextual

# Contextual AI API

Jentic publishes the only available OpenAPI specification for Contextual AI API, keeping it validated and agent-ready. Contextual AI is an enterprise platform for building production-grade Retrieval-Augmented Generation (RAG) agents that combine retrieval against governed datastores with grounded language-model responses. The current public API surface exposes endpoints to list and create agents and to list datastores, with bearer-token authentication scoped to the customer's workspace.

## For AI agents

List and create RAG agents on the Contextual AI platform and list datastores that those agents query, authenticated with a bearer token.

## Scope

Does not handle direct LLM inference, embedding generation, or end-user chat - use for managing Contextual AI RAG agents and listing datastores only.

## Capabilities

- List the RAG agents configured in the Contextual AI workspace
- Create a new RAG agent definition tied to one or more datastores
- List the datastores available to be attached to an agent
- Authenticate per request with a bearer API key scoped to the workspace
- Inspect agent configuration to understand what each production RAG agent is wired to

## Use cases

### Provisioning Production RAG Agents

Platform engineering teams use POST /agents to provision new Contextual AI agents from infrastructure-as-code or admin tooling, instead of clicking through the dashboard. Each agent is bound to a datastore, so agents are repeatable and code-reviewed. This standardises how RAG agents are launched across multiple business lines.

Example prompt: POST /agents with name='policy-bot' and a datastore reference for the finance-policy datastore, then verify the agent is listed via GET /agents

### Datastore Inventory and Governance

Compliance and data-governance teams use GET /datastores to inventory the datastores backing the workspace's RAG agents and confirm that each agent is connected to a sanctioned source. The list can be cross-referenced against the agents returned by GET /agents to catch agents pointing to deprecated datastores. This avoids RAG agents quietly serving answers from outdated content.

Example prompt: GET /datastores, GET /agents, and produce a report of agents whose configured datastore is no longer in the active datastore list

### AI Agent Bootstrap via Jentic

An AI agent helping an internal platform engineer uses Jentic to create new Contextual AI agents on demand. The agent reads the schema, fills in name and datastore, and POSTs to /agents, then returns the new agent id. Through Jentic the bearer token is held in your Jentic One instance so the agent never sees the raw key.

Example prompt: Search Jentic for 'create a contextual ai agent', execute with name='hr-bot' and the datastore_id for the HR-policies datastore, and return the new agent id

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/agents` | List RAG agents in the workspace |
| POST | `/agents` | Create a new RAG agent |
| GET | `/datastores` | List datastores available in the workspace |

## Key resources

- **Agents** — RAG agent definitions: configurable retrieval-and-generate units bound to one or more datastores
- **Datastores** — Backing knowledge sources that agents query at run time

## Why Jentic

- **Setup:** Wiring the Contextual AI API by hand means sending a bearer token on every request and mapping the agent and datastore operations yourself. Through Jentic you install once, import the Contextual AI API from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** The Contextual AI API takes its targets in the request body rather than the URL path, so you limit the agent to the operations it needs, such as listing agents or listing datastores, and it can call nothing outside that set. Creating an agent is only reachable if you include that operation in the allowed set.
- **Credential handling:** Your Contextual AI bearer token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a RAG agent' or 'list datastores', and Jentic returns the matching Contextual AI operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Pinecone API** — Pinecone is a vector database where developers compose retrieval pipelines themselves rather than buy a managed agent platform.
- **OpenAI API** — OpenAI provides the language model that Contextual AI agents can layer over their retrieval step.
- **Context Link API** — Context Link offers a single retrieval endpoint over connected sources without the agent-management layer.

## FAQ

### Why is there no official OpenAPI spec for Contextual AI API?

Contextual AI publishes API reference docs at docs.contextual.ai but does not host a stable OpenAPI 3 file at a permanent URL. Jentic generates and maintains this spec so that AI agents and developers can call Contextual AI API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Contextual AI API use?

Each request must include an Authorization: Bearer header with a workspace API key. Through Jentic the bearer token is stored in your Jentic One instance and applied at call time, so the agent does not handle the raw key.

### Can I create a new RAG agent with the Contextual AI API?

Yes. POST /agents creates a new agent record bound to a datastore, and the new agent appears in GET /agents. The agent can then be invoked through Contextual AI's runtime endpoints once provisioning completes.

### What are the rate limits for the Contextual AI API?

Contextual AI applies per-workspace rate limits sized to the customer's plan; current limits and usage are visible in the Contextual AI dashboard. Through Jentic, retries with exponential backoff are handled at the SDK level so transient throttling does not surface to agent code.

### How do I list datastores with the Contextual AI API through Jentic?

Run `jentic.search('list contextual ai datastores')`, load the operation, and execute. Jentic resolves this to GET /datastores and returns the datastores available in the workspace ready to attach to a new agent.

### Does the Contextual AI API expose runtime query endpoints?

The current OpenAPI surface covers agent and datastore management via /agents and /datastores; the runtime query endpoints for invoking an agent are documented separately in Contextual AI's API reference. Use this spec for provisioning and inventory, and contact Contextual AI for the runtime invocation endpoint shape.

### Can I limit what my agent is allowed to do with the Contextual AI API?

Yes. Because you run Jentic One yourself, your own rules decide which Contextual AI operations and credentials the agent may use, so you can allow it only to list agents (GET /agents) and list datastores (GET /datastores) and nothing else. Since the API takes its targets in the request body rather than the URL path, creating an agent (POST /agents) is reachable only if you include that operation in the allowed set. The operator controls this scope, and the bearer token stays in your instance rather than the agent's context.
