curl https://compute.prentis.ai/v1/accounts/my-account/dpoJobs \
-H "Authorization: Bearer $PRENTIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"baseModel": "accounts/maas/models/your-base-model",
"inputDatasetVersion": "accounts/my-account/datasets/support-preferences",
"config": {
"outputModelId": "support-dpo-v1",
"epochs": 1,
"learningRate": "1e-5",
"dpoBeta": "0.1"
}
}'import requests
url = "https://compute.prentis.ai/v1/accounts/{account}/dpoJobs"
payload = {
"baseModel": "<string>",
"inputDatasetVersion": "<string>",
"config": {
"outputModelId": "<string>",
"loraRank": 123,
"learningRate": "<string>",
"epochs": 123,
"batchSize": 123,
"maxContextLength": 123,
"earlyStop": True,
"evalAutoCarveoutBasisPoints": 4999,
"lrSchedule": "<string>",
"warmupSteps": 123,
"dpoBeta": "<string>"
},
"evaluationDatasetVersion": "<string>"
}
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({
baseModel: '<string>',
inputDatasetVersion: '<string>',
config: {
outputModelId: '<string>',
loraRank: 123,
learningRate: '<string>',
epochs: 123,
batchSize: 123,
maxContextLength: 123,
earlyStop: true,
evalAutoCarveoutBasisPoints: 4999,
lrSchedule: '<string>',
warmupSteps: 123,
dpoBeta: '<string>'
},
evaluationDatasetVersion: '<string>'
})
};
fetch('https://compute.prentis.ai/v1/accounts/{account}/dpoJobs', 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://compute.prentis.ai/v1/accounts/{account}/dpoJobs",
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([
'baseModel' => '<string>',
'inputDatasetVersion' => '<string>',
'config' => [
'outputModelId' => '<string>',
'loraRank' => 123,
'learningRate' => '<string>',
'epochs' => 123,
'batchSize' => 123,
'maxContextLength' => 123,
'earlyStop' => true,
'evalAutoCarveoutBasisPoints' => 4999,
'lrSchedule' => '<string>',
'warmupSteps' => 123,
'dpoBeta' => '<string>'
],
'evaluationDatasetVersion' => '<string>'
]),
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://compute.prentis.ai/v1/accounts/{account}/dpoJobs"
payload := strings.NewReader("{\n \"baseModel\": \"<string>\",\n \"inputDatasetVersion\": \"<string>\",\n \"config\": {\n \"outputModelId\": \"<string>\",\n \"loraRank\": 123,\n \"learningRate\": \"<string>\",\n \"epochs\": 123,\n \"batchSize\": 123,\n \"maxContextLength\": 123,\n \"earlyStop\": true,\n \"evalAutoCarveoutBasisPoints\": 4999,\n \"lrSchedule\": \"<string>\",\n \"warmupSteps\": 123,\n \"dpoBeta\": \"<string>\"\n },\n \"evaluationDatasetVersion\": \"<string>\"\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://compute.prentis.ai/v1/accounts/{account}/dpoJobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"baseModel\": \"<string>\",\n \"inputDatasetVersion\": \"<string>\",\n \"config\": {\n \"outputModelId\": \"<string>\",\n \"loraRank\": 123,\n \"learningRate\": \"<string>\",\n \"epochs\": 123,\n \"batchSize\": 123,\n \"maxContextLength\": 123,\n \"earlyStop\": true,\n \"evalAutoCarveoutBasisPoints\": 4999,\n \"lrSchedule\": \"<string>\",\n \"warmupSteps\": 123,\n \"dpoBeta\": \"<string>\"\n },\n \"evaluationDatasetVersion\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.prentis.ai/v1/accounts/{account}/dpoJobs")
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 \"baseModel\": \"<string>\",\n \"inputDatasetVersion\": \"<string>\",\n \"config\": {\n \"outputModelId\": \"<string>\",\n \"loraRank\": 123,\n \"learningRate\": \"<string>\",\n \"epochs\": 123,\n \"batchSize\": 123,\n \"maxContextLength\": 123,\n \"earlyStop\": true,\n \"evalAutoCarveoutBasisPoints\": 4999,\n \"lrSchedule\": \"<string>\",\n \"warmupSteps\": 123,\n \"dpoBeta\": \"<string>\"\n },\n \"evaluationDatasetVersion\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "accounts/my-account/trainingJobs/01K7AY0M2N4P6R8T0V2X4Z6B8D",
"jobId": "01K7AY0M2N4P6R8T0V2X4Z6B8D",
"jobType": "JOB_TYPE_DPO",
"state": "JOB_STATE_QUEUED",
"baseModel": "accounts/maas/models/your-base-model",
"inputDatasetVersion": "accounts/my-account/datasets/support-preferences/versions/1",
"config": {
"outputModelId": "support-dpo-v1",
"learningRate": 0.00001,
"epochs": 1,
"dpoBeta": "0.1"
},
"execution": {
"thirdParty": false
},
"createTime": "2026-10-10T09:00:00Z"
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}Create a preference (DPO) job
Start preference training: for each prompt the dataset gives a preferred and a rejected answer, and the model learns to favour the first. Accepted in state JOB_STATE_QUEUED and runs in the background, like a supervised job.
curl https://compute.prentis.ai/v1/accounts/my-account/dpoJobs \
-H "Authorization: Bearer $PRENTIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"baseModel": "accounts/maas/models/your-base-model",
"inputDatasetVersion": "accounts/my-account/datasets/support-preferences",
"config": {
"outputModelId": "support-dpo-v1",
"epochs": 1,
"learningRate": "1e-5",
"dpoBeta": "0.1"
}
}'import requests
url = "https://compute.prentis.ai/v1/accounts/{account}/dpoJobs"
payload = {
"baseModel": "<string>",
"inputDatasetVersion": "<string>",
"config": {
"outputModelId": "<string>",
"loraRank": 123,
"learningRate": "<string>",
"epochs": 123,
"batchSize": 123,
"maxContextLength": 123,
"earlyStop": True,
"evalAutoCarveoutBasisPoints": 4999,
"lrSchedule": "<string>",
"warmupSteps": 123,
"dpoBeta": "<string>"
},
"evaluationDatasetVersion": "<string>"
}
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({
baseModel: '<string>',
inputDatasetVersion: '<string>',
config: {
outputModelId: '<string>',
loraRank: 123,
learningRate: '<string>',
epochs: 123,
batchSize: 123,
maxContextLength: 123,
earlyStop: true,
evalAutoCarveoutBasisPoints: 4999,
lrSchedule: '<string>',
warmupSteps: 123,
dpoBeta: '<string>'
},
evaluationDatasetVersion: '<string>'
})
};
fetch('https://compute.prentis.ai/v1/accounts/{account}/dpoJobs', 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://compute.prentis.ai/v1/accounts/{account}/dpoJobs",
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([
'baseModel' => '<string>',
'inputDatasetVersion' => '<string>',
'config' => [
'outputModelId' => '<string>',
'loraRank' => 123,
'learningRate' => '<string>',
'epochs' => 123,
'batchSize' => 123,
'maxContextLength' => 123,
'earlyStop' => true,
'evalAutoCarveoutBasisPoints' => 4999,
'lrSchedule' => '<string>',
'warmupSteps' => 123,
'dpoBeta' => '<string>'
],
'evaluationDatasetVersion' => '<string>'
]),
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://compute.prentis.ai/v1/accounts/{account}/dpoJobs"
payload := strings.NewReader("{\n \"baseModel\": \"<string>\",\n \"inputDatasetVersion\": \"<string>\",\n \"config\": {\n \"outputModelId\": \"<string>\",\n \"loraRank\": 123,\n \"learningRate\": \"<string>\",\n \"epochs\": 123,\n \"batchSize\": 123,\n \"maxContextLength\": 123,\n \"earlyStop\": true,\n \"evalAutoCarveoutBasisPoints\": 4999,\n \"lrSchedule\": \"<string>\",\n \"warmupSteps\": 123,\n \"dpoBeta\": \"<string>\"\n },\n \"evaluationDatasetVersion\": \"<string>\"\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://compute.prentis.ai/v1/accounts/{account}/dpoJobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"baseModel\": \"<string>\",\n \"inputDatasetVersion\": \"<string>\",\n \"config\": {\n \"outputModelId\": \"<string>\",\n \"loraRank\": 123,\n \"learningRate\": \"<string>\",\n \"epochs\": 123,\n \"batchSize\": 123,\n \"maxContextLength\": 123,\n \"earlyStop\": true,\n \"evalAutoCarveoutBasisPoints\": 4999,\n \"lrSchedule\": \"<string>\",\n \"warmupSteps\": 123,\n \"dpoBeta\": \"<string>\"\n },\n \"evaluationDatasetVersion\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.prentis.ai/v1/accounts/{account}/dpoJobs")
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 \"baseModel\": \"<string>\",\n \"inputDatasetVersion\": \"<string>\",\n \"config\": {\n \"outputModelId\": \"<string>\",\n \"loraRank\": 123,\n \"learningRate\": \"<string>\",\n \"epochs\": 123,\n \"batchSize\": 123,\n \"maxContextLength\": 123,\n \"earlyStop\": true,\n \"evalAutoCarveoutBasisPoints\": 4999,\n \"lrSchedule\": \"<string>\",\n \"warmupSteps\": 123,\n \"dpoBeta\": \"<string>\"\n },\n \"evaluationDatasetVersion\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "accounts/my-account/trainingJobs/01K7AY0M2N4P6R8T0V2X4Z6B8D",
"jobId": "01K7AY0M2N4P6R8T0V2X4Z6B8D",
"jobType": "JOB_TYPE_DPO",
"state": "JOB_STATE_QUEUED",
"baseModel": "accounts/maas/models/your-base-model",
"inputDatasetVersion": "accounts/my-account/datasets/support-preferences/versions/1",
"config": {
"outputModelId": "support-dpo-v1",
"learningRate": 0.00001,
"epochs": 1,
"dpoBeta": "0.1"
},
"execution": {
"thirdParty": false
},
"createTime": "2026-10-10T09:00:00Z"
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"param": "<string>"
}
}The dataset
Each row is a prompt and two answers, one preferred and one rejected. See Fine-tuning for the exact format. A file of plain conversations validates fine as a dataset — validation checks JSON Lines, not shape — and is refused when the job starts, before anything is billed.Authorizations
Authorization: Bearer <your API key> -- the same key as inference. A key reaches the account it belongs to and no other.
Headers
Your own key for making a create safe to retry (up to 255 characters). Sending the same key again returns the job the first request created instead of starting a second one.
255Path Parameters
Your account id -- the one in the console's address bar (my-account for this key). It must be the account the key belongs to.
64Body
The model to fine-tune, as a full resource name (accounts/maas/models/your-base-model). Only base models offered for training are accepted -- the console's Training page lists them.
The model to fine-tune, as a full resource name (accounts/maas/models/your-base-model). Only base models offered for training are accepted -- the console's Training page lists them.
The model to fine-tune, as a full resource name (accounts/maas/models/your-base-model). Only base models offered for training are accepted -- the console's Training page lists them.
The model to fine-tune, as a full resource name (accounts/maas/models/your-base-model). Only base models offered for training are accepted -- the console's Training page lists them.
256The training data: a dataset (accounts/{account}/datasets/{dataset}) to use its latest version, or one version (…/versions/{n}) to pin it. The dataset must be READY.
The preference data: a dataset to use its latest version, or one version to pin it. Each row needs a prompt and two answers -- see the dataset format guide. The dataset must be READY.
The training data: a dataset (accounts/{account}/datasets/{dataset}) to use its latest version, or one version (…/versions/{n}) to pin it. The dataset must be READY.
The training data: a dataset (accounts/{account}/datasets/{dataset}) to use its latest version, or one version (…/versions/{n}) to pin it. The dataset must be READY.
256How to train. outputModelId is required: the id of the model the job will create, which must not already exist in your account. The rest are optional -- loraRank, learningRate (a string, e.g. "1e-4"), epochs (1-100), batchSize, maxContextLength (longer examples are skipped and counted, never truncated), earlyStop, evalAutoCarveoutBasisPoints (0-9999, in hundredths of a percent), lrSchedule (constant, cosine or linear_decay), warmupSteps, and dpoBeta (preference jobs only; a string, default "0.1"). Fixed once the job is created.
How to train. outputModelId is required: the id of the model the job will create, which must not already exist in your account. The rest are optional -- loraRank, learningRate (a string, e.g. "1e-4"), epochs (1-100), batchSize, maxContextLength (longer examples are skipped and counted, never truncated), earlyStop, evalAutoCarveoutBasisPoints (0-9999, in hundredths of a percent), lrSchedule (constant, cosine or linear_decay), warmupSteps, and dpoBeta (preference jobs only; a string, default "0.1"). Fixed once the job is created.
How to train. outputModelId is required: the id of the model the job will create, which must not already exist in your account. The rest are optional -- loraRank, learningRate (a string, e.g. "1e-4"), epochs (1-100), batchSize, maxContextLength (longer examples are skipped and counted, never truncated), earlyStop, evalAutoCarveoutBasisPoints (0-9999, in hundredths of a percent), lrSchedule (constant, cosine or linear_decay), warmupSteps, and dpoBeta (preference jobs only; a string, default "0.1"). Fixed once the job is created.
How to train. outputModelId is required: the id of the model the job will create, which must not already exist in your account. The rest are optional -- loraRank, learningRate (a string, e.g. "1e-4"), epochs (1-100), batchSize, maxContextLength (longer examples are skipped and counted, never truncated), earlyStop, evalAutoCarveoutBasisPoints (0-9999, in hundredths of a percent), lrSchedule (constant, cosine or linear_decay), warmupSteps, and dpoBeta (preference jobs only; a string, default "0.1"). Fixed once the job is created.
Show child attributes
Show child attributes
Accepted so that the body of a create can be sent unchanged, but not used: the estimate covers the training data only.
Optional held-out data to measure evaluation loss on, in the same form as inputDatasetVersion. Leave it empty and set config.evalAutoCarveoutBasisPoints to hold out a share of the training data instead, or leave both empty for no evaluation.
Accepted so that the body of a create can be sent unchanged, but not used: the estimate covers the training data only.
Optional held-out data to measure evaluation loss on, in the same form as inputDatasetVersion. Leave it empty and set config.evalAutoCarveoutBasisPoints to hold out a share of the training data instead, or leave both empty for no evaluation.
256Response
Created.
JOB_TYPE_SFT, JOB_TYPE_DPO JOB_STATE_QUEUED, JOB_STATE_RUNNING, JOB_STATE_CHECKPOINTING, JOB_STATE_FINALIZING, JOB_STATE_SUCCEEDED, JOB_STATE_FAILED, JOB_STATE_CANCELLED, JOB_STATE_EXPIRED Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes