Skip to main content
POST
/
fine-tunes
/
estimate-price
Estimate price
curl --request POST \
  --url https://api.together.ai/v1/fine-tunes/estimate-price \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "training_file": "<string>",
  "validation_file": "<string>",
  "model": "<string>",
  "n_epochs": 1,
  "n_evals": 0,
  "training_method": {
    "method": "sft",
    "train_on_inputs": "auto"
  },
  "training_type": {
    "type": "Full"
  },
  "from_checkpoint": "<string>"
}
'
{
  "estimation_available": true,
  "estimated_total_price": 123,
  "allowed_to_proceed": true,
  "user_limit": 123,
  "estimated_train_token_count": 123,
  "estimated_eval_token_count": 123
}

Authorizations

Authorization
string
header
default:default
required

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

Body

application/json
training_file
string
required

File-ID of a training file uploaded to the Together API

validation_file
string

File-ID of a validation file uploaded to the Together API

model
string

Name of the base model to run fine-tune job on

n_epochs
integer
default:1

Number of complete passes through the training dataset (higher values may improve results but increase cost and risk of overfitting)

n_evals
integer
default:0

Number of evaluations to be run on a given validation set during training

training_method
object

The training method to use. 'sft' for Supervised Fine-Tuning or 'dpo' for Direct Preference Optimization.

training_type
object

The training type to use. Defaults to LoRA if not provided.

from_checkpoint
string

The checkpoint identifier to continue training from a previous fine-tuning job. Format is {$JOB_ID} or {$OUTPUT_MODEL_NAME} or {$JOB_ID}:{$STEP} or {$OUTPUT_MODEL_NAME}:{$STEP}. The step value is optional; without it, uses the final checkpoint.

Response

Price estimated successfully

estimation_available
enum<boolean>
required

Whether price estimation is available for the requested fine-tune job.

Available options:
true
estimated_total_price
number

The price of the fine-tuning job

allowed_to_proceed
boolean

Whether you are allowed to proceed with the fine-tuning job.

Example:

true

user_limit
number

Your credit limit in dollars.

estimated_train_token_count
number

The estimated number of tokens to be trained

estimated_eval_token_count
number

The estimated number of tokens for evaluation