> ## Documentation Index
> Fetch the complete documentation index at: https://docs.together.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Estimate price

> Estimate the price of a fine-tuning job.



## OpenAPI

````yaml POST /fine-tunes/estimate-price
openapi: 3.1.0
info:
  title: Together APIs
  description: The Together REST API. See https://docs.together.ai for more details.
  version: 2.0.0
  termsOfService: https://www.together.ai/terms-of-service
  contact:
    name: Together Support
    url: https://www.together.ai/contact
  license:
    name: MIT
    url: https://github.com/togethercomputer/openapi/blob/main/LICENSE
servers:
  - url: https://api.together.ai/v1
    description: Default environment for APIs
  - url: https://api-inference.together.ai/v2
    description: Optimized environment for inference
security:
  - bearerAuth: []
paths:
  /fine-tunes/estimate-price:
    post:
      tags:
        - Fine-tuning
      summary: Estimate price
      description: Estimate the price of a fine-tuning job.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - training_file
              properties:
                training_file:
                  type: string
                  description: File-ID of a training file uploaded to the Together API
                validation_file:
                  type: string
                  description: File-ID of a validation file uploaded to the Together API
                model:
                  type: string
                  description: Name of the base model to run fine-tune job on
                n_epochs:
                  type: integer
                  default: 1
                  description: >-
                    Number of complete passes through the training dataset
                    (higher values may improve results but increase cost and
                    risk of overfitting)
                n_evals:
                  type: integer
                  default: 0
                  description: >-
                    Number of evaluations to be run on a given validation set
                    during training
                training_method:
                  type: object
                  oneOf:
                    - $ref: '#/components/schemas/TrainingMethodSFT'
                    - $ref: '#/components/schemas/TrainingMethodDPO'
                  description: >-
                    The training method to use. 'sft' for Supervised Fine-Tuning
                    or 'dpo' for Direct Preference Optimization.
                training_type:
                  type: object
                  default: null
                  nullable: true
                  oneOf:
                    - $ref: '#/components/schemas/FullTrainingType'
                    - $ref: '#/components/schemas/LoRATrainingType'
                  description: The training type to use. Defaults to LoRA if not provided.
                from_checkpoint:
                  type: string
                  description: >-
                    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.
      responses:
        '200':
          description: Price estimated successfully
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    x-stainless-variantName: AvailableEstimate
                    required:
                      - estimation_available
                    properties:
                      estimation_available:
                        type: boolean
                        enum:
                          - true
                        x-stainless-const: true
                        description: >-
                          Whether price estimation is available for the
                          requested fine-tune job.
                      estimated_total_price:
                        type: number
                        description: The price of the fine-tuning job
                      allowed_to_proceed:
                        type: boolean
                        description: >-
                          Whether you are allowed to proceed with the
                          fine-tuning job.
                        example: true
                      user_limit:
                        type: number
                        description: Your credit limit in dollars.
                      estimated_train_token_count:
                        type: number
                        description: The estimated number of tokens to be trained
                      estimated_eval_token_count:
                        type: number
                        description: The estimated number of tokens for evaluation
                  - type: object
                    x-stainless-variantName: UnavailableEstimate
                    required:
                      - estimation_available
                      - unavailable_reason
                    properties:
                      estimation_available:
                        type: boolean
                        enum:
                          - false
                        x-stainless-const: true
                        description: >-
                          Whether price estimation is available for the
                          requested fine-tune job.
                      unavailable_reason:
                        type: string
                        description: >-
                          Reason price estimation is unavailable for the
                          requested fine-tune job.
                        enum:
                          - multimodal_dataset
                          - train_file_not_validated
                          - eval_file_not_validated
                          - train_file_invalid
                          - eval_file_invalid
                        example: multimodal_dataset
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
components:
  schemas:
    TrainingMethodSFT:
      type: object
      properties:
        method:
          type: string
          enum:
            - sft
        train_on_inputs:
          oneOf:
            - type: boolean
            - type: string
              enum:
                - auto
          type: boolean
          default: auto
          description: >-
            Whether to mask user messages in conversational data or prompts in
            instruction data.
      required:
        - method
        - train_on_inputs
    TrainingMethodDPO:
      type: object
      properties:
        method:
          type: string
          enum:
            - dpo
        dpo_beta:
          type: number
          default: 0.1
        rpo_alpha:
          type: number
          default: 0
        dpo_normalize_logratios_by_length:
          type: boolean
          default: false
        dpo_reference_free:
          type: boolean
          default: false
        simpo_gamma:
          type: number
          default: 0
      required:
        - method
    FullTrainingType:
      type: object
      properties:
        type:
          type: string
          enum:
            - Full
      required:
        - type
    LoRATrainingType:
      type: object
      properties:
        type:
          type: string
          enum:
            - Lora
        lora_r:
          type: integer
        lora_alpha:
          type: integer
        lora_dropout:
          type: number
          default: 0
        lora_trainable_modules:
          type: string
          default: all-linear
          description: >-
            Comma-separated LoRA target modules. Use `all-linear` for model
            defaults; MoE expert modules (`w_up`, `w_gate`, `w_down`) are
            supported on compatible models and cannot be mixed with attention
            modules.
      required:
        - type
        - lora_r
        - lora_alpha
    ErrorData:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              nullable: false
            type:
              type: string
              nullable: false
            param:
              type: string
              nullable: true
              default: null
            code:
              type: string
              nullable: true
              default: null
          required:
            - type
            - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-bearer-format: bearer
      x-default: default

````