Contextual AI website screenshot

Contextual AI

Contextual AI is an enterprise RAG platform built around a Grounded Language Model (GLM) engineered to minimize hallucinations. Its REST API exposes end-to-end RAG agents (create, configure, query) plus standalone component APIs - Generate, Rerank, Parse, and LMUnit - over datastores of ingested documents, all authenticated with a Bearer API key.

7 APIs 0 Features
AIRAGLLMGrounded Language ModelEnterprise

APIs

Contextual AI Agents API

Create, configure, edit, copy, reset, and delete enterprise RAG agents, including system prompts, suggested queries, templates, and associated datastores.

Contextual AI Agent Query API

Query an agent for grounded responses with inline attributions, retrieval contents, and groundedness scores; supports SSE token streaming via stream=true, retrievals-only mode, ...

Contextual AI Datastores & Documents API

Create and manage datastores and ingest documents (PDF, HTML, DOC(X), PPT(X), images) with custom metadata; list, retrieve, update, and delete documents and their parsed chunks.

Contextual AI Generate API

Standalone grounded generation with the Grounded Language Model (GLM v1/v2) - responses are grounded in supplied knowledge to minimize hallucinations, with a 32,000-token reques...

Contextual AI Rerank API

Instruction-following reranker (ctxl-rerank-v2 multilingual / mini and v1) that reorders retrieved passages by relevance, steerable with natural-language instructions on recency...

Contextual AI Parse API

Asynchronous document parsing that converts PDFs, Office files, and images into AI-ready markdown with inferred hierarchy and positional metadata; submit a job, then poll status...

Contextual AI LMUnit Evaluation API

Evaluate model responses with fine-grained natural-language unit tests, returning a continuous 1-5 score for criteria such as conciseness, technical precision, and groundedness.

Collections

Pricing Plans

Rate Limits

Contextual Ai Rate Limits

6 limits

RATE LIMITS

FinOps

Event Specifications

Contextual AI Agent Query Streaming (HTTP + SSE)

AsyncAPI 2.6 description of Contextual AI's **agent query streaming** surface. Contextual AI does not publish a WebSocket API. The only asynchronous / event-style transport docu...

ASYNCAPI

Resources

👥
GitHubOrganization
GitHubOrganization
🔗
LinkedIn
LinkedIn
🔗
Website
Website
🔗
Documentation
Documentation
🔗
Plans
Plans
🔗
RateLimits
RateLimits
🔗
FinOps
FinOps

Sources

Raw ↑
opencollection: 1.0.0
info:
  name: Contextual AI Platform API
  version: '1.0'
request:
  auth:
    type: bearer
    token: '{{bearerToken}}'
items:
- info:
    name: Agents
    type: folder
  items:
  - info:
      name: Create Agent
      type: http
    http:
      method: POST
      url: https://api.contextual.ai/v1/agents
      body:
        type: json
        data: "{\n  \"name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"system_prompt\": \"<string>\",\n  \"datastore_ids\"\
          : []\n}"
    docs: Create a new RAG agent. If no datastore is provided, one is created automatically.
  - info:
      name: List Agents
      type: http
    http:
      method: GET
      url: https://api.contextual.ai/v1/agents
    docs: Retrieve a list of agents in the workspace.
  - info:
      name: Get Agent Metadata
      type: http
    http:
      method: GET
      url: https://api.contextual.ai/v1/agents/{{agent_id}}
    docs: Get metadata for a single agent.
  - info:
      name: Delete Agent
      type: http
    http:
      method: DELETE
      url: https://api.contextual.ai/v1/agents/{{agent_id}}
    docs: Delete an agent.
- info:
    name: Agent Query
    type: folder
  items:
  - info:
      name: Query Agent
      type: http
    http:
      method: POST
      url: https://api.contextual.ai/v1/agents/{{agent_id}}/query
      body:
        type: json
        data: "{\n  \"messages\": [\n    { \"role\": \"user\", \"content\": \"<string>\" }\n  ],\n  \"stream\": false\n}"
    docs: Query an agent for a grounded response with attributions. Set stream=true for SSE.
  - info:
      name: Provide Feedback
      type: http
    http:
      method: POST
      url: https://api.contextual.ai/v1/agents/{{agent_id}}/feedback
      body:
        type: json
        data: "{\n  \"message_id\": \"<uuid>\",\n  \"feedback\": \"thumbs_up\"\n}"
    docs: Provide feedback on an agent message.
- info:
    name: Datastores & Documents
    type: folder
  items:
  - info:
      name: Create Datastore
      type: http
    http:
      method: POST
      url: https://api.contextual.ai/v1/datastores
      body:
        type: json
        data: "{\n  \"name\": \"<string>\"\n}"
    docs: Create a new datastore.
  - info:
      name: List Datastores
      type: http
    http:
      method: GET
      url: https://api.contextual.ai/v1/datastores
    docs: Retrieve a list of datastores.
  - info:
      name: Ingest Document
      type: http
    http:
      method: POST
      url: https://api.contextual.ai/v1/datastores/{{datastore_id}}/documents
      body:
        type: multipart-form
        data: []
    docs: Ingest a document (PDF, HTML, DOC(X), PPT(X), image) into a datastore.
  - info:
      name: Delete Datastore
      type: http
    http:
      method: DELETE
      url: https://api.contextual.ai/v1/datastores/{{datastore_id}}
    docs: Delete a datastore.
- info:
    name: Generate
    type: folder
  items:
  - info:
      name: Generate
      type: http
    http:
      method: POST
      url: https://api.contextual.ai/v1/generate
      body:
        type: json
        data: "{\n  \"model\": \"v2\",\n  \"messages\": [\n    { \"role\": \"user\", \"content\": \"<string>\" }\n  ],\n \
          \ \"knowledge\": [\"<string>\"]\n}"
    docs: Generate a grounded response with the Grounded Language Model.
- info:
    name: Rerank
    type: folder
  items:
  - info:
      name: Rerank
      type: http
    http:
      method: POST
      url: https://api.contextual.ai/v1/rerank
      body:
        type: json
        data: "{\n  \"query\": \"<string>\",\n  \"documents\": [\"<string>\"],\n  \"model\": \"ctxl-rerank-v2-instruct-multilingual\"\
          \n}"
    docs: Rerank documents against a query with the instruction-following reranker.
- info:
    name: Parse
    type: folder
  items:
  - info:
      name: Parse File
      type: http
    http:
      method: POST
      url: https://api.contextual.ai/v1/parse
      body:
        type: multipart-form
        data: []
    docs: Submit a document to be parsed into AI-ready markdown. Returns a job_id.
  - info:
      name: Parse Status
      type: http
    http:
      method: GET
      url: https://api.contextual.ai/v1/parse/jobs/{{job_id}}/status
    docs: Get the status of a parse job.
  - info:
      name: Parse Result
      type: http
    http:
      method: GET
      url: https://api.contextual.ai/v1/parse/jobs/{{job_id}}/results
    docs: Retrieve the results of a completed parse job.
- info:
    name: LMUnit
    type: folder
  items:
  - info:
      name: LMUnit
      type: http
    http:
      method: POST
      url: https://api.contextual.ai/v1/lmunit
      body:
        type: json
        data: "{\n  \"query\": \"<string>\",\n  \"response\": \"<string>\",\n  \"unit_test\": \"<string>\"\n}"
    docs: Evaluate a model response against a natural-language unit test (score 1-5).