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

# Get Knowledge Status

> Check the upload and processing status of a knowledge document.

Use this endpoint to monitor the progress of a knowledge item after receiving
its document_id from the upload endpoint. The status indicates whether the item
is still being processed, has completed successfully, or has failed.

**Args**:
    `document_id`: The document_id returned when the knowledge was added (path parameter)

**Returns**:
    `dict`: Upload status information containing:
        - status: Current upload status ("QUEUED", "PROCESSING", "READY", "FAILED")
        - document_id: Document ID once upload is COMPLETED (null if still uploading)
        - created_at, completed_at, updated_at: timestamps
        - progress: not wired up yet, always null
        - eta_seconds: estimated seconds until completion (QUEUED/PROCESSING only)

**Raises**:
    - `404`: If the knowledge item is not found or doesn't belong to the user

**Example**:
    **Request**:
        ```GET /api/v3/knowledge/{document_id}/status
            Headers: {"Authorization": "Bearer <api_key>"}
        ```
    **Response**:
    ```
        {
            "status": "READY",
            "document_id": "document_01k4x9m2p7q3r5sa",
            "created_at": "2024-01-15T10:30:00Z",
            "completed_at": "2024-01-15T10:31:00Z",
            "updated_at": "2024-01-15T10:31:00Z",
            "progress": null,
            "eta_seconds": 42
        }
    ```



## OpenAPI

````yaml https://api.nugen.in/openapi-public.json get /api/v3/knowledge/{document_id}/status
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/{document_id}/status:
    get:
      tags:
        - Knowledge
      summary: Get Knowledge Status
      description: >-
        Check the upload and processing status of a knowledge document.


        Use this endpoint to monitor the progress of a knowledge item after
        receiving

        its document_id from the upload endpoint. The status indicates whether
        the item

        is still being processed, has completed successfully, or has failed.


        **Args**:
            `document_id`: The document_id returned when the knowledge was added (path parameter)

        **Returns**:
            `dict`: Upload status information containing:
                - status: Current upload status ("QUEUED", "PROCESSING", "READY", "FAILED")
                - document_id: Document ID once upload is COMPLETED (null if still uploading)
                - created_at, completed_at, updated_at: timestamps
                - progress: not wired up yet, always null
                - eta_seconds: estimated seconds until completion (QUEUED/PROCESSING only)

        **Raises**:
            - `404`: If the knowledge item is not found or doesn't belong to the user

        **Example**:
            **Request**:
                ```GET /api/v3/knowledge/{document_id}/status
                    Headers: {"Authorization": "Bearer <api_key>"}
                ```
            **Response**:
            ```
                {
                    "status": "READY",
                    "document_id": "document_01k4x9m2p7q3r5sa",
                    "created_at": "2024-01-15T10:30:00Z",
                    "completed_at": "2024-01-15T10:31:00Z",
                    "updated_at": "2024-01-15T10:31:00Z",
                    "progress": null,
                    "eta_seconds": 42
                }
            ```
      operationId: knowledge_status
      parameters:
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            title: Document Id
          description: ID of the knowledge item, returned when it was added
      responses:
        '200':
          description: >-
            Returns the upload and processing status of a knowledge document:
            QUEUED, PROCESSING, READY or FAILED, with the document_id once
            READY, and timestamps.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeStatusResponse'
        '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'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    KnowledgeStatusResponse:
      properties:
        status:
          $ref: '#/components/schemas/ResourceStatus'
          description: Current processing status
          examples:
            - READY
        document_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Id
          description: >-
            document_id once processing is READY; null while still processing or
            if failed
          examples:
            - document_01k4x9m2p7q3r5sa
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: Timestamp when the knowledge item was created
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
          description: Timestamp when processing completed; null while still running
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: Timestamp of the last status change
        progress:
          anyOf:
            - type: number
            - type: 'null'
          title: Progress
          description: Completion progress, 0.0 to 100.0. Not wired up yet, always null.
        eta_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Eta Seconds
          description: >-
            Estimated seconds until completion. Populated for QUEUED and
            PROCESSING jobs.
        eta_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Eta Start
          description: Estimated time the job will start processing.
        eta_completion:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Eta Completion
          description: Estimated time the job will complete.
      type: object
      required:
        - status
      title: KnowledgeStatusResponse
      description: Processing status of one knowledge item.
      examples:
        - completed_at: '2024-01-15T10:31:00Z'
          created_at: '2024-01-15T10:30:00Z'
          document_id: document_01k4x9m2p7q3r5sa
          status: READY
          updated_at: '2024-01-15T10:31:00Z'
        - created_at: '2024-01-15T10:30:00Z'
          eta_completion: '2024-01-15T10:31:00Z'
          eta_seconds: 42
          status: PROCESSING
          updated_at: '2024-01-15T10:30:00Z'
        - created_at: '2024-01-15T10:30:00Z'
          status: FAILED
          updated_at: '2024-01-15T10:30:30Z'
    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.
    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
    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.
  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.