> ## 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 FP4 preparation cost

> Reports the price and expected wall-clock time for preparing the model named by `model_object_id` or the deprecated `adapter_object_id` without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit.




## OpenAPI

````yaml openapi.yaml POST /v1/shaping/prepare-for-fp4-inference/estimate
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
    description: Default environment for APIs
security:
  - bearerAuth: []
paths:
  /v1/shaping/prepare-for-fp4-inference/estimate:
    post:
      tags:
        - Shaping
      summary: Estimate FP4 preparation cost
      description: >
        Reports the price and expected wall-clock time for preparing the model
        named by `model_object_id` or the deprecated `adapter_object_id` without
        creating a job. The request body is the same as POST
        /shaping/prepare-for-fp4-inference, so a caller can price exactly the
        job it is about to submit.
      operationId: estimateQuantizationJob
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuantizationRequest'
      responses:
        '200':
          description: Estimate for the described job.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuantizationEstimate'
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '503':
          description: Preparing models for FP4 inference is not available.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      x-codeSamples:
        - lang: Python
          label: Together AI SDK (Python)
          source: >
            from together import Together


            client = Together()


            estimate =
            client.post_training.prepare_for_fp4_inference.estimate_cost(
                inputs={
                    "model_object_id": "ml_abc123",
                    "model_revision_id": "rv_abc123",
                },
            )

            print(estimate.price_usd, estimate.time_hours,
            estimate.allowed_to_proceed)
        - lang: Shell
          label: cURL
          source: >
            curl -X POST
            "https://api.together.ai/v1/shaping/prepare-for-fp4-inference/estimate"
            \
                 -H "Authorization: Bearer $TOGETHER_API_KEY" \
                 -H "Content-Type: application/json" \
                 -d '{
                   "inputs": {
                     "model_object_id": "ml_abc123",
                     "model_revision_id": "rv_abc123"
                   }
                 }'
components:
  schemas:
    QuantizationRequest:
      type: object
      description: Request body for preparing a fine-tuned model for FP4 inference.
      required:
        - inputs
      properties:
        inputs:
          $ref: '#/components/schemas/QuantizationPipelineInputs'
          description: Inputs naming the fine-tuned model to prepare.
    QuantizationEstimate:
      type: object
      description: Price and duration estimate for a quantization job.
      required:
        - price_usd
        - time_hours
        - credit_limit
        - allowed_to_proceed
      properties:
        price_usd:
          type: number
          format: double
          description: Expected total run cost in US dollars.
          example: 28.76
        time_hours:
          type: number
          format: double
          description: Expected wall-clock run time in hours, excluding queue time.
          example: 4
        credit_limit:
          type: number
          format: double
          description: Project credit limit in US dollars.
          example: 500
        allowed_to_proceed:
          type: boolean
          description: Whether a create request at this price would be accepted.
          example: true
    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
    QuantizationPipelineInputs:
      type: object
      description: >
        The model to prepare: an adapter or a full model. A request names it by
        the `model_*` fields or the deprecated `adapter_*` fields, never a mix
        of the two, and gives a revision only beside the ID it belongs to. A job
        returns both names, with the same values.
      properties:
        model_object_id:
          type: string
          pattern: ^ml_.+
          description: >
            Model object ID of the model to prepare. It names the input model;
            it is not the `results.model_object_id` of a job, which names the
            model the job produced.
        model_revision_id:
          type: string
          pattern: ^rv_.+
          description: >
            Revision ID of the model to prepare. Omit to use the model's current
            revision. Only valid with `model_object_id`.
        calibration_file_id:
          type: string
          pattern: ^file-.+
          description: >
            Conversation dataset file ID to use for calibration. Upload it first
            with `POST /v1/files` using purpose `calibration` and file type
            `jsonl`. Each JSONL row must contain a `messages` array and may
            contain a `tools` array.

            When provided, the job draws half of the calibration corpus from
            this file and half from a general-text corpus. When omitted, the job
            calibrates on the general-text corpus only.

            The request is rejected unless the file exists in the request
            project, has finished uploading, has passed files API validation as
            a conversation dataset, is not empty, and is at most 64 MiB. A
            `fine-tune` purpose file is also accepted so a training file can be
            reused.
          example: file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35
      example:
        model_object_id: ml_CeG3fF6pyEViU8dE8pk7R
        model_revision_id: rv_CeG3faPBj2ABwbAaHPTmx
        calibration_file_id: file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-bearer-format: bearer
      x-default: default

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.