Skip to main content
POST
cURL

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
string
header
required

Authorization: Bearer <your API key> -- the same key as inference. A key reaches the account it belongs to and no other.

Headers

Idempotency-Key
string

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.

Maximum string length: 255

Path Parameters

account
string
required

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.

Maximum string length: 64

Body

application/json
baseModel
string
required

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.

Maximum string length: 256
inputDatasetVersion
string
required

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

Maximum string length: 256
config
object
required

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.

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.

evaluationDatasetVersion
string

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.

Maximum string length: 256

Response

Created.

name
string
jobId
string
jobType
enum<string>
Available options:
JOB_TYPE_SFT,
JOB_TYPE_DPO
state
enum<string>
Available options:
JOB_STATE_QUEUED,
JOB_STATE_RUNNING,
JOB_STATE_CHECKPOINTING,
JOB_STATE_FINALIZING,
JOB_STATE_SUCCEEDED,
JOB_STATE_FAILED,
JOB_STATE_CANCELLED,
JOB_STATE_EXPIRED
stateDetail
string
errorClass
string
baseModel
string
inputDatasetVersion
string
evaluationDatasetVersion
string
outputModel
string
config
object
progress
object
estimatedCost
object
execution
object
createdBy
string
createTime
string<date-time>
startTime
string<date-time>
completeTime
string<date-time>