Skip to main content
POST
/
api
/
v3
/
alignment-project
/
create
Create Alignment
curl --request POST \
  --url https://api.nugen.in/api/v3/alignment-project/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "My Alignment Project",
  "base_model": "nugen-flash-instruct",
  "document_ids": [
    "doc-abc123",
    "doc-def456"
  ],
  "workflow_id": "workflow-abc123",
  "benchmark_id": "benchmark-xyz789",
  "description": "This project aims to align the model for better customer support performance."
}
'
import requests

url = "https://api.nugen.in/api/v3/alignment-project/create"

payload = {
"name": "My Alignment Project",
"base_model": "nugen-flash-instruct",
"document_ids": ["doc-abc123", "doc-def456"],
"workflow_id": "workflow-abc123",
"benchmark_id": "benchmark-xyz789",
"description": "This project aims to align the model for better customer support performance."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My Alignment Project',
base_model: 'nugen-flash-instruct',
document_ids: ['doc-abc123', 'doc-def456'],
workflow_id: 'workflow-abc123',
benchmark_id: 'benchmark-xyz789',
description: 'This project aims to align the model for better customer support performance.'
})
};

fetch('https://api.nugen.in/api/v3/alignment-project/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nugen.in/api/v3/alignment-project/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'My Alignment Project',
'base_model' => 'nugen-flash-instruct',
'document_ids' => [
'doc-abc123',
'doc-def456'
],
'workflow_id' => 'workflow-abc123',
'benchmark_id' => 'benchmark-xyz789',
'description' => 'This project aims to align the model for better customer support performance.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.nugen.in/api/v3/alignment-project/create"

payload := strings.NewReader("{\n \"name\": \"My Alignment Project\",\n \"base_model\": \"nugen-flash-instruct\",\n \"document_ids\": [\n \"doc-abc123\",\n \"doc-def456\"\n ],\n \"workflow_id\": \"workflow-abc123\",\n \"benchmark_id\": \"benchmark-xyz789\",\n \"description\": \"This project aims to align the model for better customer support performance.\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.nugen.in/api/v3/alignment-project/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Alignment Project\",\n \"base_model\": \"nugen-flash-instruct\",\n \"document_ids\": [\n \"doc-abc123\",\n \"doc-def456\"\n ],\n \"workflow_id\": \"workflow-abc123\",\n \"benchmark_id\": \"benchmark-xyz789\",\n \"description\": \"This project aims to align the model for better customer support performance.\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.nugen.in/api/v3/alignment-project/create")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My Alignment Project\",\n \"base_model\": \"nugen-flash-instruct\",\n \"document_ids\": [\n \"doc-abc123\",\n \"doc-def456\"\n ],\n \"workflow_id\": \"workflow-abc123\",\n \"benchmark_id\": \"benchmark-xyz789\",\n \"description\": \"This project aims to align the model for better customer support performance.\"\n}"

response = http.request(request)
puts response.read_body
{
  "alignment_id": "alignment-project-123",
  "status": "PROCESSING"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Name of the domain alignment project

Example:

"My Alignment Project"

base_model
string
required

Base model that alignment will be based on

Example:

"nugen-flash-instruct"

document_ids
string[]
required

List of document IDs to generate synthetic training data from

Example:
["doc-abc123", "doc-def456"]
workflow_id
string | null

This id is to orchestrate the entire flow

Example:

"workflow-abc123"

benchmark_id
string | null

Benchmark ID for evaluation (created via /benchmark/create or /benchmark/upload)

Example:

"benchmark-xyz789"

description
string | null

Optional project description

Example:

"This project aims to align the model for better customer support performance."

Response

Returns a unique identifier for the initiated domain alignment workflow along with the initial workflow status. This endpoint starts an asynchronous process to fine-tune a base model using provided documents and optional benchmark evaluation, allowing users to track progress and retrieve results once completed.

Response schema for alignment project creation endpoint

alignment_id
string
required

Created alignment project task identifier

Example:

"alignment-project-123"

status
string
default:PROCESSING

Initial alignment project status

Example:

"PROCESSING"