curl --request POST \
--url https://api.nugen.in/api/v3/alignment-projects/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My Alignment Project",
"base_model": "qwen-v2p5-0p5b-instruct",
"document_ids": [
"doc-abc123",
"doc-def456"
],
"workflow_id": "workflow-abc123",
"benchmark_id": "benchmark-abc123",
"description": "This project aims to align the model for better customer support performance."
}
'import requests
url = "https://api.nugen.in/api/v3/alignment-projects/create"
payload = {
"name": "My Alignment Project",
"base_model": "qwen-v2p5-0p5b-instruct",
"document_ids": ["doc-abc123", "doc-def456"],
"workflow_id": "workflow-abc123",
"benchmark_id": "benchmark-abc123",
"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: 'qwen-v2p5-0p5b-instruct',
document_ids: ['doc-abc123', 'doc-def456'],
workflow_id: 'workflow-abc123',
benchmark_id: 'benchmark-abc123',
description: 'This project aims to align the model for better customer support performance.'
})
};
fetch('https://api.nugen.in/api/v3/alignment-projects/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-projects/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' => 'qwen-v2p5-0p5b-instruct',
'document_ids' => [
'doc-abc123',
'doc-def456'
],
'workflow_id' => 'workflow-abc123',
'benchmark_id' => 'benchmark-abc123',
'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-projects/create"
payload := strings.NewReader("{\n \"name\": \"My Alignment Project\",\n \"base_model\": \"qwen-v2p5-0p5b-instruct\",\n \"document_ids\": [\n \"doc-abc123\",\n \"doc-def456\"\n ],\n \"workflow_id\": \"workflow-abc123\",\n \"benchmark_id\": \"benchmark-abc123\",\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-projects/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Alignment Project\",\n \"base_model\": \"qwen-v2p5-0p5b-instruct\",\n \"document_ids\": [\n \"doc-abc123\",\n \"doc-def456\"\n ],\n \"workflow_id\": \"workflow-abc123\",\n \"benchmark_id\": \"benchmark-abc123\",\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-projects/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\": \"qwen-v2p5-0p5b-instruct\",\n \"document_ids\": [\n \"doc-abc123\",\n \"doc-def456\"\n ],\n \"workflow_id\": \"workflow-abc123\",\n \"benchmark_id\": \"benchmark-abc123\",\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>"
}
]
}Create Alignment Project
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 projectbase_model: 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 alignmentworkflow_id(optional): Custom workflow identifierbenchmark_id(optional): Benchmark ID for post-alignment evaluationdescription(optional): Description of the alignment project
Importing models:
Any Hugging Face model can be imported by passing "base_model": "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 progressstatus: Initial workflow status (alwaysPROCESSING)
Raises:
400: If the base model does not support alignment404: If document IDs are not found or don’t belong to user
Example Request:
POST /api/v3/alignment/create
Headers: {"Authorization": "Bearer <api_key>"}
{
"alignment_name": "Customer Support Domain Alignment",
"base_model": "qwen-v2p5-0p5b-instruct",
"document_ids": ["doc-123", "doc-456", "doc-789"],
"benchmark_id": "task-abc123",
"description": "Alignment for customer support documentation and FAQs"
}
Example Response:
{
"alignment_id":"alignment-xyz789",
"status": "PROCESSING"
}
Notes:
- Use
/alignment-project/{id}/statusto track workflow progress - If
benchmark_idis provided, the model will be evaluated automatically after alignment - Only models that support alignment can be used.
curl --request POST \
--url https://api.nugen.in/api/v3/alignment-projects/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My Alignment Project",
"base_model": "qwen-v2p5-0p5b-instruct",
"document_ids": [
"doc-abc123",
"doc-def456"
],
"workflow_id": "workflow-abc123",
"benchmark_id": "benchmark-abc123",
"description": "This project aims to align the model for better customer support performance."
}
'import requests
url = "https://api.nugen.in/api/v3/alignment-projects/create"
payload = {
"name": "My Alignment Project",
"base_model": "qwen-v2p5-0p5b-instruct",
"document_ids": ["doc-abc123", "doc-def456"],
"workflow_id": "workflow-abc123",
"benchmark_id": "benchmark-abc123",
"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: 'qwen-v2p5-0p5b-instruct',
document_ids: ['doc-abc123', 'doc-def456'],
workflow_id: 'workflow-abc123',
benchmark_id: 'benchmark-abc123',
description: 'This project aims to align the model for better customer support performance.'
})
};
fetch('https://api.nugen.in/api/v3/alignment-projects/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-projects/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' => 'qwen-v2p5-0p5b-instruct',
'document_ids' => [
'doc-abc123',
'doc-def456'
],
'workflow_id' => 'workflow-abc123',
'benchmark_id' => 'benchmark-abc123',
'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-projects/create"
payload := strings.NewReader("{\n \"name\": \"My Alignment Project\",\n \"base_model\": \"qwen-v2p5-0p5b-instruct\",\n \"document_ids\": [\n \"doc-abc123\",\n \"doc-def456\"\n ],\n \"workflow_id\": \"workflow-abc123\",\n \"benchmark_id\": \"benchmark-abc123\",\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-projects/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Alignment Project\",\n \"base_model\": \"qwen-v2p5-0p5b-instruct\",\n \"document_ids\": [\n \"doc-abc123\",\n \"doc-def456\"\n ],\n \"workflow_id\": \"workflow-abc123\",\n \"benchmark_id\": \"benchmark-abc123\",\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-projects/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\": \"qwen-v2p5-0p5b-instruct\",\n \"document_ids\": [\n \"doc-abc123\",\n \"doc-def456\"\n ],\n \"workflow_id\": \"workflow-abc123\",\n \"benchmark_id\": \"benchmark-abc123\",\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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Name of the domain alignment project
"My Alignment Project"
Base model that alignment will be based on
"qwen-v2p5-0p5b-instruct"
List of document IDs to generate synthetic training data from
["doc-abc123", "doc-def456"]
This id is to orchestrate the entire flow
"workflow-abc123"
Benchmark ID for evaluation (created via /benchmark/create or /benchmark/upload)
"benchmark-abc123"
Optional project description
"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 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.
Was this page helpful?