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

# Delete Knowledge

> Permanently delete a knowledge item.

This endpoint removes a knowledge item from the system. Note that this only deletes
the item record and metadata.

**Args**:
    `document_id`: The document_id of the knowledge item to delete (path parameter)

**Returns**:
    `KnowledgeDeleteResponse`: Deletion confirmation containing:
        - `document_id`: document_id of the deleted knowledge item
        - `message`: Success confirmation message

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

**Example**:
    **Request**:
    ```
        DELETE /api/v3/knowledge/document_01k4x9m2p7q3r5sa
        Headers: {"Authorization": "Bearer <api_key>"}
    ```
    **Response**:
    ```
        {
            "document_id": "document_01k4x9m2p7q3r5sa",
            "message": "Document Deleted Successfully"
        }
    ```



## OpenAPI

````yaml https://api.nugen.in/openapi-public.json delete /api/v3/knowledge/{document_id}
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}:
    delete:
      tags:
        - Knowledge
      summary: Delete Knowledge
      description: >-
        Permanently delete a knowledge item.


        This endpoint removes a knowledge item from the system. Note that this
        only deletes

        the item record and metadata.


        **Args**:
            `document_id`: The document_id of the knowledge item to delete (path parameter)

        **Returns**:
            `KnowledgeDeleteResponse`: Deletion confirmation containing:
                - `document_id`: document_id of the deleted knowledge item
                - `message`: Success confirmation message

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

        **Example**:
            **Request**:
            ```
                DELETE /api/v3/knowledge/document_01k4x9m2p7q3r5sa
                Headers: {"Authorization": "Bearer <api_key>"}
            ```
            **Response**:
            ```
                {
                    "document_id": "document_01k4x9m2p7q3r5sa",
                    "message": "Document Deleted Successfully"
                }
            ```
      operationId: knowledge_delete
      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 a confirmation message with the document_id of the deleted
            knowledge item. The item is permanently deleted from the system,
            including its metadata and any associated records.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeDeleteResponse'
        '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:
    KnowledgeDeleteResponse:
      properties:
        document_id:
          type: string
          title: Document Id
          description: document_id of the deleted knowledge item
          examples:
            - document_01k4x9m2p7q3r5s8
        message:
          type: string
          title: Message
          description: Deletion Message
          examples:
            - Document document_01k4x9m2p7q3r5s8 has been successfully deleted.
      type: object
      required:
        - document_id
        - message
      title: KnowledgeDeleteResponse
      description: Confirmation of a knowledge item deletion.
    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.
    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.