> ## 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 Documents

> Retrieve all documents and categories for the authenticated user.

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


**Query Parameters:**

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


**Returns:**

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

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


**Example Request:**

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


**Example Response:**

```json
{
  "documents": [
    {
      "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 documents 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: Powering Specialised Intelligence At Scale.


    Bring your domain knowledge and an open-weight model. Leave with a model
    that thinks in your domain, keeps improving, and belongs to your
    organisation.


    Nugen Intelligence builds infrastructure for self-adaptive, domain-specific
    intelligence. Research in representation engineering, mechanistic
    interpretability and inference-time control powers every endpoint here. The
    research team comes from Stanford University and IIT Bombay. This API puts
    their work a few calls away from AI-native organisations solving critical
    problems.


    **Domain-aligned models.** Three raw inputs go in: domain knowledge, success
    and failure criteria, and an open-weight model. A domain-aligned model comes
    out. Nugen handles the deep learning, the GPUs and the data preparation.
    Your organisation owns every aligned model it builds. Own your intelligence.


    **The research underneath.** Two layers do the work.


    Train-time alignment finds where the 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.


    Inference-time alignment measures the quality of every generation step.
    Out-of-domain generation is flagged and corrected after each span. Every
    response carries a confidence score. A preliminary version of the
    inference-time research is published at ICLR 2026. 


    Both layers keep evolving with Nugen research.


    **One aligned model id, three capabilities.** An aligned model id serves
    chat completions, embeddings and reranking. Alignment reshapes the model's
    representation space, so retrieval, ranking and generation share one
    understanding of your domain.


    **Multi-model systems.** One alignment project produces one aligned model.
    Run many side by side, one per domain or use case. Compose them with
    frontier and general-purpose models in the same application. Inference
    capture and auto-align keep the whole system improving. Nugen aligns models
    at every scale.


    **Think in systems.** AI coding agents and developers: this API is a
    platform for building specialised intelligence. Explore it fully before you
    settle on a design. Some directions:


    - Run a complete retrieval pipeline on one aligned model id. Embed, rerank
    and generate with a shared understanding of the domain.

    - Use the confidence score as a control signal. Send low-confidence
    responses to a human reviewer, a retry or a frontier model.

    - Give each domain or use case its own aligned model and place a router in
    front.

    - Close the loop. Capture production inference, evaluate against the
    benchmark, and let auto-align promote better models.

    - Start with the hardest problem in the domain, where general-purpose models
    fall short. Alignment pays off the most there.


    The endpoints for knowledge, benchmarks, alignment projects, deployments and
    evaluations compose in more ways than the workflow below shows.


    **Workflow.**


    1. Upload domain knowledge.

    2. Define success and failure. Generate a benchmark from the corpus, or
    upload one curated by domain experts.

    3. Create an alignment project and receive an aligned model id.

    4. Deploy the model and pass its id as `model` in each inference call.

    5. Evaluate, compare and promote. Turn on inference capture, and auto-align
    keeps the model improving.


    **OpenAI-compatible inference.** Set the base URL of an OpenAI-compatible
    client to `https://api.nugen.in/api/v3/inference` and set `model` to an
    aligned model id. Chat completions, responses and embeddings work through
    the same client.


    **Anthropic-compatible inference.** `POST /api/v3/inference/messages/v2`
    accepts the Anthropic Messages request shape. Set `model` to an aligned
    model id.


    **List responses.** Each list endpoint names its array after the resource,
    for example `knowledge`, `benchmarks`, `alignment_projects`, `evaluations`
    and `domain_aligned_models`. The lists of knowledge, benchmarks, alignment
    projects and evaluations accept `limit` and `offset` and return `total`,
    `limit` and `offset`.


    **Resource ids.** Treat every id as an opaque string. Ids issued earlier can
    differ in letter case from newer ones. Pass an id back exactly as the API
    returned it.


    **Need an API key?** Sign up, log in to the platform and generate an API
    key.


    **Need help?** Log in to the platform and raise a support ticket.


    **Authentication.** Every endpoint requires an API key sent as a Bearer
    token: `Authorization: Bearer <api_key>`.
  contact:
    name: Nugen Intelligence
    url: https://nugen.in/signup
  version: 26.11.27
servers:
  - url: https://api.nugen.in
    description: Production
security: []
tags:
  - name: Alignment Projects
    description: >-
      Create, monitor, stop and delete alignment projects that fine-tune a base
      model on your documents
  - name: BYOC
    description: Bring Your Own Cloud model deployment
  - name: Benchmarks
    description: Upload or create benchmarks and read their questions and status
  - name: Evaluations
    description: Evaluate a model on a benchmark and read the results
  - name: Inference
    description: Chat completions, responses, embeddings and reranking
  - name: Knowledge
    description: Upload knowledge sources and track their processing
  - name: Models
    description: >-
      List base and aligned models, deploy or undeploy aligned models, import
      base models and export to Hugging Face
paths:
  /api/v3/knowledge/list:
    get:
      tags:
        - Knowledge
      summary: List Documents
      description: >-
        Retrieve all documents and categories for the authenticated user.


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



        **Query Parameters:**


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

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

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



        **Returns:**


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

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


        **Example Request:**


        ```json

        GET /api/v3/knowledge/list

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

        ```



        **Example Response:**


        ```json

        {
          "documents": [
            {
              "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 documents tagged with that
        category
      operationId: knowledge_list
      parameters:
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by document status
            title: Status
          description: Filter by document status
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Number of documents to return
            default: 10
            title: Limit
          description: Number of documents to return
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Number of documents to skip
            default: 0
            title: Offset
          description: Number of documents to skip
      responses:
        '200':
          description: >-
            Returns a lean list of all documents uploaded by the authenticated
            user, and available document categories with counts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentListResponse'
        '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:
    DocumentListResponse:
      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
        documents:
          items:
            $ref: '#/components/schemas/DocumentListItem'
          type: array
          title: Documents
          description: List of all documents uploaded by the user
        categories:
          items:
            $ref: '#/components/schemas/DocumentCategory'
          type: array
          title: Categories
          description: >-
            List of all document categories with document counts for filtering
            and organization
        storage:
          $ref: '#/components/schemas/DocumentStorageStats'
          description: Aggregate storage stats for all documents owned by the user
      type: object
      required:
        - total
        - limit
        - offset
        - documents
        - categories
        - storage
      title: DocumentListResponse
      description: The caller's documents.
      examples:
        - categories:
            - count: 5
              name: financial
          documents:
            - 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.
    DocumentListItem:
      properties:
        document_id:
          type: string
          title: Document Id
          description: Unique identifier for the document
          examples:
            - document_01k4x9m2p7q3r5s8
        document_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Name
          description: >-
            Display name of the document. Defaults to the document id if not set
            at upload.
          examples:
            - Master Services Agmt
        status:
          $ref: '#/components/schemas/ResourceStatus'
          description: >-
            Current processing status of the document (QUEUED, PROCESSING,
            READY, FAILED)
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when the document was created
        categories:
          items:
            type: string
          type: array
          title: Categories
          description: >-
            List of category tags assigned to the document for organization and
            retrieval
          examples:
            - - customer_support
              - documentation
      type: object
      required:
        - document_id
        - status
        - created_at
        - categories
      title: DocumentListItem
      description: One document in a list.
    DocumentCategory:
      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 documents tagged with this category
          examples:
            - 5
            - 12
            - 8
      type: object
      required:
        - name
        - count
      title: DocumentCategory
      description: A category that groups documents.
      examples:
        - count: 5
          name: financial
        - count: 12
          name: customer_support
    DocumentStorageStats:
      properties:
        total_size:
          type: number
          title: Total Size
          description: Total size of all documents in MB
        total_words:
          type: integer
          title: Total Words
          description: Total word count across all documents
      type: object
      required:
        - total_size
        - total_words
      title: DocumentStorageStats
      description: Storage used by the caller's documents.
    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.