> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nugen.in/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Remember: Suggested flow to benefit the most from Nugen API is to upload your domain knowledgebase and documents, then create or upload a benchmark with your success criteria, then align multiple task-specific models, then deploy the aligned models, then build your applications using the inference through the aligned models.

# List Knowledge

> Retrieve all knowledge and categories for the authenticated user.

This endpoint returns a paginated, lean list row per knowledge item. Fetch `GET /knowledge/{document_id}` for the full record: filename, type, size, uploader, processing progress.


**Query Parameters:**

- `status` (optional): Filter by knowledge status
- `limit` (optional): Number of knowledge items to return (1-100, default: 10)
- `offset` (optional): Number of knowledge items to skip for pagination (default: 0)


**Returns:**

- `knowledge`: List of knowledge items, each containing:
  - `document_id`: Unique knowledge item identifier
  - `document_name`: Display name of the knowledge item
  - `status`: Processing status (`QUEUED`, `PROCESSING`, `READY`, `FAILED`)
  - `created_at`: ISO 8601 timestamp when the knowledge item was created
  - `categories`: List of category names assigned to this knowledge item

- `categories`: List of category objects, each containing:
  - `name`: Category name
  - `count`: Number of knowledge items in this category


**Example Request:**

```json
GET /api/v3/knowledge/list
Headers: {"Authorization": "Bearer <api_key>"}
```


**Example Response:**

```json
{
  "knowledge": [
    {
      "document_id": "document_01k4x9m2p7q3r5s8",
      "document_name": "Quarterly Report",
      "status": "READY",
      "created_at": "2024-01-15T10:30:00Z",
      "categories": ["financial", "2024"]
    },
    {
      "document_id": "document_01k4x9m2p7q3r5sa",
      "document_name": "Meeting Notes",
      "status": "PROCESSING",
      "created_at": "2024-01-16T14:20:00Z",
      "categories": ["meetings"]
    }
  ],
  "categories": [
    {
      "name": "financial",
      "count": 5
    },
    {
      "name": "2024",
      "count": 12
    },
    {
      "name": "meetings",
      "count": 8
    }
  ]
}
```


**Notes:**

- Categories are automatically extracted and organized for easy filtering
- Each category shows the total count of knowledge items tagged with that category



## OpenAPI

````yaml https://api.nugen.in/openapi-public.json get /api/v3/knowledge/list
openapi: 3.1.0
info:
  title: Nugen Intelligence API
  description: >
    Nugen Intelligence: build multi-model AI applications from expert models you
    own.


    Align, deploy and serve expert models on your own knowledge, through a
    single API. Build a fleet of them, and combine them with each other and with
    frontier models. Every response carries a span-by-span confidence score from
    knowledge-aware uncertainty quantification, so your application knows when
    to trust, retry or escalate.


    Nugen takes teams from raw data to aligned model endpoints in minutes, not
    months of failed experiments, with no GPU or deep learning expertise needed.
    Own your intelligence. Build multi-model intelligence.


    **Start here.**


    - Sign up: https://nugen.in/signup

    - Generate an API key: https://platform.nugen.in/api-keys

    - Documentation: https://docs.nugen.in

    - SDKs: https://github.com/nugen-in/sdk-python and
    https://github.com/nugen-in/sdk-typescript

    - Agent setup: https://nugen.in/agent-setup

    - Agent toolkit: https://github.com/nugen-in/agent-toolkit


    **If you are an AI coding agent.** Read https://docs.nugen.in/llms.txt
    first, set yourself up from the agent setup page or the agent toolkit, then
    follow the steps below.


    **Build an expert model.**


    1. Add knowledge: `POST /api/v3/knowledge/upload`. Poll its status until
    READY.

    2. Define success: `POST /api/v3/benchmarks/create` generates a benchmark
    from your knowledge, or `POST /api/v3/benchmarks/upload` takes one curated
    by your experts.

    3. Align: `POST /api/v3/alignment-projects/create` with a base model, your
    `document_ids` and the benchmark. You receive an expert model id.

    4. Deploy: `POST /api/v3/models/{model_id}/deployment`.

    5. Use: pass the model id as `model` to chat completions, responses,
    embeddings or reranking under `/api/v3/inference`.

    6. Improve: inference capture is off by default, so you stay in complete
    control of what happens with your data. Turn it on with `PATCH
    /api/v3/inference/capture`, and `POST
    /api/v3/alignment-projects/{alignment_id}/auto-align` keeps the expert
    improving from real traffic.


    Repeat for each domain or use case. One project produces one expert model.


    **Combine experts into systems.**


    - One model for all: embed, rerank and generate with the same expert model
    id, so retrieval and generation share one understanding of your domain.

    - Confidence, span by span: quality is measured during generation, after
    each span, and every response carries a confidence score. Use it to accept,
    retry or hand to a human.

    - Router: send each request to the right expert, and route low-confidence
    answers to another expert or a frontier model.


    **Works with your stack.** Point an OpenAI-compatible client at
    `https://api.nugen.in/api/v3/inference`. `POST
    /api/v3/inference/messages/v2` accepts the Anthropic Messages shape.


    **Editions.** The developer edition takes plain text knowledge files. The
    enterprise edition adds more formats and connections to cloud storage, data
    warehouses and data lakes.


    **How it works.** Nugen's research in representation engineering,
    mechanistic interpretability and inference-time control powers every
    endpoint. Two layers do the work.


    Train-time alignment finds where a model needs to change for your domain and
    improves it there. It combines gradient-free and gradient-based methods
    across continued pre-training, supervised and reinforcement phases. Bring
    your raw knowledge and your success criteria, and Nugen handles the deep
    learning, the HPC and the GPUs.


    Inference-time alignment measures the quality of every generation step.
    Out-of-domain generation is flagged and corrected after each span, and every
    response carries a confidence score.


    Alignment reshapes the model's representation space, so one expert model
    serves chat completions, embeddings and reranking with a shared
    understanding of your domain.


    The research comes from a team of AI scientists from Stanford University and
    IIT Bombay, published at ICLR, NeurIPS and ICML. Nugen's AI scientists ship
    their research to this API within days, not quarters, so both layers keep
    evolving.


    **Conventions.** Authenticate with `Authorization: Bearer <api_key>`. List
    endpoints name their array after the resource, for example `knowledge`,
    `benchmarks`, `alignment_projects`, `evaluations` and
    `domain_aligned_models`, and the lists of knowledge, benchmarks, alignment
    projects and evaluations accept `limit` and `offset` and return `total`,
    `limit` and `offset`. Treat every id as an opaque string and pass it back
    exactly as the API returned it.


    **Need an API key?** Generate one at https://platform.nugen.in/api-keys.


    **Need help?** Raise a support ticket at https://platform.nugen.in/support.
  contact:
    name: Nugen Intelligence
    url: https://nugen.in/signup
  version: 26.11.30
servers:
  - url: https://api.nugen.in
    description: Production
security: []
tags:
  - name: Alignment Projects
    description: >-
      Create, monitor, stop and delete alignment projects that align a base
      model to your knowledge and produce an expert model. Run one per domain or
      base model. Next: deploy the expert model.
  - name: BYOC
    description: Bring Your Own Cloud model deployment
  - name: Benchmarks
    description: >-
      Generate benchmarks from your knowledge or upload expert curated ones, and
      read their questions and status. Next: align a base model in an alignment
      project.
  - name: Evaluations
    description: >-
      Evaluate and compare expert models on the same benchmark to choose, route
      and promote them
  - name: Inference
    description: >-
      Generate, embed and rerank with one expert model id, with span-by-span
      confidence scores and OpenAI and Anthropic compatible APIs. Next: evaluate
      and compare your experts.
  - name: Knowledge
    description: >-
      Connect or upload the knowledge your expert models learn from, and track
      its processing. Next: define success with a benchmark.
  - name: Models
    description: >-
      List base models and your aligned expert models, deploy or undeploy them,
      import any base model from Hugging Face and export to Hugging Face. Next:
      call the expert model through inference.
paths:
  /api/v3/knowledge/list:
    get:
      tags:
        - Knowledge
      summary: List Knowledge
      description: >-
        Retrieve all knowledge and categories for the authenticated user.


        This endpoint returns a paginated, lean list row per knowledge item.
        Fetch `GET /knowledge/{document_id}` for the full record: filename,
        type, size, uploader, processing progress.



        **Query Parameters:**


        - `status` (optional): Filter by knowledge status

        - `limit` (optional): Number of knowledge items to return (1-100,
        default: 10)

        - `offset` (optional): Number of knowledge items to skip for pagination
        (default: 0)



        **Returns:**


        - `knowledge`: List of knowledge items, each containing:
          - `document_id`: Unique knowledge item identifier
          - `document_name`: Display name of the knowledge item
          - `status`: Processing status (`QUEUED`, `PROCESSING`, `READY`, `FAILED`)
          - `created_at`: ISO 8601 timestamp when the knowledge item was created
          - `categories`: List of category names assigned to this knowledge item

        - `categories`: List of category objects, each containing:
          - `name`: Category name
          - `count`: Number of knowledge items in this category


        **Example Request:**


        ```json

        GET /api/v3/knowledge/list

        Headers: {"Authorization": "Bearer <api_key>"}

        ```



        **Example Response:**


        ```json

        {
          "knowledge": [
            {
              "document_id": "document_01k4x9m2p7q3r5s8",
              "document_name": "Quarterly Report",
              "status": "READY",
              "created_at": "2024-01-15T10:30:00Z",
              "categories": ["financial", "2024"]
            },
            {
              "document_id": "document_01k4x9m2p7q3r5sa",
              "document_name": "Meeting Notes",
              "status": "PROCESSING",
              "created_at": "2024-01-16T14:20:00Z",
              "categories": ["meetings"]
            }
          ],
          "categories": [
            {
              "name": "financial",
              "count": 5
            },
            {
              "name": "2024",
              "count": 12
            },
            {
              "name": "meetings",
              "count": 8
            }
          ]
        }

        ```



        **Notes:**


        - Categories are automatically extracted and organized for easy
        filtering

        - Each category shows the total count of knowledge items tagged with
        that category
      operationId: knowledge_list
      parameters:
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by knowledge status
            title: Status
          description: Filter by knowledge status
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Number of knowledge items to return
            default: 10
            title: Limit
          description: Number of knowledge items to return
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Number of knowledge items to skip
            default: 0
            title: Offset
          description: Number of knowledge items to skip
      responses:
        '200':
          description: >-
            Returns a lean list of all knowledge connected or uploaded by the
            authenticated user, and the available categories with counts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeListResponse'
        '401':
          description: Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Authorization header missing or not a Bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    KnowledgeListResponse:
      properties:
        total:
          type: integer
          title: Total
          description: Total number of records matching the filters
          examples:
            - 25
        limit:
          type: integer
          title: Limit
          description: Page size used for this response
          examples:
            - 10
        offset:
          type: integer
          title: Offset
          description: Number of records skipped before this page
          examples:
            - 0
        knowledge:
          items:
            $ref: '#/components/schemas/KnowledgeListItem'
          type: array
          title: Knowledge
          description: List of all knowledge items the user connected or uploaded
        categories:
          items:
            $ref: '#/components/schemas/KnowledgeCategory'
          type: array
          title: Categories
          description: >-
            List of all categories with knowledge item counts for filtering and
            organisation
        storage:
          $ref: '#/components/schemas/KnowledgeStorageStats'
          description: Aggregate storage stats for all knowledge owned by the user
      type: object
      required:
        - total
        - limit
        - offset
        - knowledge
        - categories
        - storage
      title: KnowledgeListResponse
      description: The caller's knowledge.
      examples:
        - categories:
            - count: 5
              name: financial
          knowledge:
            - categories:
                - financial
                - '2024'
              created_at: '2024-01-15T10:30:00Z'
              document_id: document_01k4x9m2p7q3r5s8
              document_name: Quarterly Report
              status: READY
          storage:
            total_size: 12.5
            total_words: 48200
    ErrorResponse:
      description: Body of an error response.
      properties:
        detail:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ErrorDetail'
          description: >-
            Human readable explanation of the error, or an object with a message
            and the id of the resource concerned
          examples:
            - Model not found
          title: Detail
      required:
        - detail
      title: ErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
      description: Body of a request validation error.
    KnowledgeListItem:
      properties:
        document_id:
          type: string
          title: Document Id
          description: Unique identifier for the knowledge item
          examples:
            - document_01k4x9m2p7q3r5s8
        document_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Name
          description: >-
            Display name of the knowledge item. Defaults to the document id if
            not set when added.
          examples:
            - Master Services Agmt
        status:
          $ref: '#/components/schemas/ResourceStatus'
          description: >-
            Current processing status of the knowledge item (QUEUED, PROCESSING,
            READY, FAILED)
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when the knowledge item was created
        categories:
          items:
            type: string
          type: array
          title: Categories
          description: >-
            List of category tags assigned to the knowledge item for
            organisation and retrieval
          examples:
            - - customer_support
              - documentation
      type: object
      required:
        - document_id
        - status
        - created_at
        - categories
      title: KnowledgeListItem
      description: One knowledge item in a list.
    KnowledgeCategory:
      properties:
        name:
          type: string
          title: Name
          description: Name of the category
          examples:
            - financial
            - customer_support
            - legal
            - 2024-q1
        count:
          type: integer
          minimum: 0
          title: Count
          description: Number of knowledge items tagged with this category
          examples:
            - 5
            - 12
            - 8
      type: object
      required:
        - name
        - count
      title: KnowledgeCategory
      description: A category that groups knowledge items.
      examples:
        - count: 5
          name: financial
        - count: 12
          name: customer_support
    KnowledgeStorageStats:
      properties:
        total_size:
          type: number
          title: Total Size
          description: Total size of all knowledge in MB
        total_words:
          type: integer
          title: Total Words
          description: Total word count across all knowledge
      type: object
      required:
        - total_size
        - total_words
      title: KnowledgeStorageStats
      description: Storage used by the caller's knowledge.
    ErrorDetail:
      additionalProperties: true
      description: >-
        Structured error detail: a message, with the id of the resource it
        concerns as an extra key.
      properties:
        message:
          description: Human readable explanation of the error
          title: Message
          type: string
      required:
        - message
      title: ErrorDetail
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
      description: One request validation problem.
    ResourceStatus:
      type: string
      enum:
        - CREATED
        - QUEUED
        - PROCESSING
        - READY
        - FAILED
        - STOPPED
      title: ResourceStatus
      description: >-
        Lifecycle status of a resource that runs asynchronously. Stored as is
        and

        returned as is, with no translation in between.


        - `CREATED`: record saved to the DB, not yet placed on the worker queue

        - `QUEUED`: on the worker queue, waiting for a worker to pick it up

        - `PROCESSING`: running

        - `READY`: finished successfully

        - `FAILED`: failed at any stage

        - `STOPPED`: stopped by the user before completion
  securitySchemes:
    ApiKeyAuth:
      type: http
      description: Your Nugen API key, sent as a Bearer token
      scheme: bearer
      bearerFormat: API key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.