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

# Create Alignment

> Create a new domain alignment workflow.


This endpoint initiates a domain alignment workflow that aligns a base model to your domain corpus using provided documents.


**Request Body:**

- `alignment_name`: Name of the domain alignment project
- `base_model_id`: Base model to use for alignment (e.g., `qwen-v2p5-0p5b-instruct`)
- `document_ids`: List of document IDs to use for training data. Documents are snapshotted when the project is created; later edits to documents never change an existing alignment
- `workflow_id` (optional): Custom workflow identifier
- `benchmark_id` (optional): Benchmark ID for post-alignment evaluation
- `description` (optional): Description of the alignment project


**Importing models:**

Any Hugging Face model can be imported by passing `"base_model_id": "hf://<model-name>"`. This is an enterprise edition feature; request access or enquire through a support ticket. For security reasons, models that require custom code execution are unsupported by default; raise a support ticket to discuss your case.


**Returns:**

- `alignment_id`: Unique alignment identifier for tracking workflow progress
- `status`: Initial workflow status (always `PROCESSING`)


**Raises:**

- `400`: If the base model does not support alignment
- `404`: If document IDs are not found or don't belong to user


**Example Request:**

```json
POST /api/v3/alignment-projects/create
Headers: {"Authorization": "Bearer <api_key>"}

{
  "alignment_name": "Customer Support Domain Alignment",
  "base_model_id": "qwen-v2p5-0p5b-instruct",
  "document_ids": ["document_01k4x9m2p7q3r5se", "document_01k4x9m2p7q3r5sf", "document_01k4x9m2p7q3r5sg"],
  "benchmark_id": "benchmark_01k4x9m2p7q3r6a1",
  "description": "Alignment for customer support documentation and FAQs"
}
```


**Example Response:**

```json
{
  "alignment_id":"alignment_01k4x9m2p7q3r8c1",
  "status": "PROCESSING"
}
```


**Notes:**

- Use `/alignment-projects/{id}/status` to track workflow progress
- If `benchmark_id` is provided, the model will be evaluated automatically after alignment
- Only models that support alignment can be used.



## OpenAPI

````yaml https://api.nugen.in/openapi-public.json post /api/v3/alignment-projects/create
openapi: 3.1.0
info:
  title: Nugen Intelligence API
  description: >+
    Nugen Intelligence: Powering Specialized Intelligence At Scale.


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


    **Need help?** Sign up, log in to the platform and raise a support ticket.


    **What this API does.** Align models to your domain corpus and run them with

    confidence. Train-time alignment builds domain-aligned adaptors through

    proprietary methods spanning pre-training, supervised and reinforcement

    stages. Inference-time alignment quantifies uncertainty across the full

    generation trajectory, producing confidence scores and keeping every

    response on domain.


    **Workflow.** Upload documents, create or generate a benchmark, create an

    alignment project, receive an aligned model id. That one id serves chat

    completions, completions, embeddings and reranking, and its embeddings carry

    your domain's representation space, making retrieval domain aware. You
    define the success

    criteria for your domain; the platform handles the deep learning, the GPUs

    and the data preparation.


    **Authentication.** Every endpoint requires an API key sent as a Bearer
    token:

    `Authorization: Bearer <api_key>`.

  contact:
    name: Nugen Intelligence - Customer Support
    url: https://nugen.in/signup
    email: support@nugen.in
  version: 25.4.20
servers:
  - url: https://api.nugen.in
    description: Production
security: []
paths:
  /api/v3/alignment-projects/create:
    post:
      tags:
        - General
      summary: Create Alignment
      description: >-
        Create a new domain alignment workflow.



        This endpoint initiates a domain alignment workflow that aligns a base
        model to your domain corpus using provided documents.



        **Request Body:**


        - `alignment_name`: Name of the domain alignment project

        - `base_model_id`: Base model to use for alignment (e.g.,
        `qwen-v2p5-0p5b-instruct`)

        - `document_ids`: List of document IDs to use for training data.
        Documents are snapshotted when the project is created; later edits to
        documents never change an existing alignment

        - `workflow_id` (optional): Custom workflow identifier

        - `benchmark_id` (optional): Benchmark ID for post-alignment evaluation

        - `description` (optional): Description of the alignment project



        **Importing models:**


        Any Hugging Face model can be imported by passing `"base_model_id":
        "hf://<model-name>"`. This is an enterprise edition feature; request
        access or enquire through a support ticket. For security reasons, models
        that require custom code execution are unsupported by default; raise a
        support ticket to discuss your case.



        **Returns:**


        - `alignment_id`: Unique alignment identifier for tracking workflow
        progress

        - `status`: Initial workflow status (always `PROCESSING`)



        **Raises:**


        - `400`: If the base model does not support alignment

        - `404`: If document IDs are not found or don't belong to user



        **Example Request:**


        ```json

        POST /api/v3/alignment-projects/create

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


        {
          "alignment_name": "Customer Support Domain Alignment",
          "base_model_id": "qwen-v2p5-0p5b-instruct",
          "document_ids": ["document_01k4x9m2p7q3r5se", "document_01k4x9m2p7q3r5sf", "document_01k4x9m2p7q3r5sg"],
          "benchmark_id": "benchmark_01k4x9m2p7q3r6a1",
          "description": "Alignment for customer support documentation and FAQs"
        }

        ```



        **Example Response:**


        ```json

        {
          "alignment_id":"alignment_01k4x9m2p7q3r8c1",
          "status": "PROCESSING"
        }

        ```



        **Notes:**


        - Use `/alignment-projects/{id}/status` to track workflow progress

        - If `benchmark_id` is provided, the model will be evaluated
        automatically after alignment

        - Only models that support alignment can be used.
      operationId: alignment_projects_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAlignmentRequest'
        required: true
      responses:
        '200':
          description: >-
            Returns a unique identifier for the initiated domain alignment
            workflow along with the initial workflow status. This endpoint
            starts an asynchronous process to align a base model to your domain
            corpus using provided documents and optional benchmark evaluation,
            allowing users to track progress and retrieve results once
            completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAlignmentProjectResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateAlignmentRequest:
      properties:
        alignment_name:
          type: string
          title: Alignment Name
          description: Name of the domain alignment project
          examples:
            - My Alignment Project
        base_model_id:
          type: string
          title: Base Model Id
          description: Base model that alignment will be based on
          examples:
            - qwen-v2p5-0p5b-instruct
        workflow_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Id
          description: This id is to orchestrate the entire flow
          examples:
            - workflow-abc123
        benchmark_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Benchmark Id
          description: >-
            Benchmark ID for evaluation (created via /benchmarks/create or
            /benchmarks/upload)
          examples:
            - benchmark_01k4x9m2p7q3r6a1
        document_ids:
          items:
            type: string
          type: array
          title: Document Ids
          description: List of document IDs to train the alignment on
          examples:
            - - document_01k4x9m2p7q3r5s8
              - document_01k4x9m2p7q3r5s9
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional project description
          examples:
            - >-
              This project aims to align the model for better customer support
              performance.
      type: object
      required:
        - alignment_name
        - base_model_id
        - document_ids
      title: CreateAlignmentRequest
    CreateAlignmentProjectResponse:
      properties:
        alignment_id:
          type: string
          title: Alignment Id
          description: Created alignment project identifier
          examples:
            - alignment-project-123
        status:
          type: string
          title: Status
          description: Initial alignment project status
          default: PROCESSING
          examples:
            - PROCESSING
      type: object
      required:
        - alignment_id
      title: CreateAlignmentProjectResponse
      description: Response schema for alignment project creation endpoint
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````