> ## 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 on-demand model resource cost

> Estimates a model resource's on-demand hourly price without creating it.



## OpenAPI

````yaml openapi.yaml POST /v1/rl/model-resources/estimate-cost
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/rl/model-resources/estimate-cost:
    post:
      tags:
        - RL
      summary: Estimate on-demand model resource cost
      description: Estimates a model resource's on-demand hourly price without creating it.
      operationId: estimateModelResourcesCost
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.CreateModelResourcesRequest'
        required: true
      responses:
        '200':
          description: Estimated on-demand cost
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.ModelResourcesEstimateCostResponse'
        default:
          description: An unexpected error response.
          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.model_resources.estimate_cost(
                base_model="Qwen/Qwen3.5-9B",
                lora_enabled=True,
                compute_config={"gpu_type": "B200-SXM", "num_generator_replicas": 1},
            )
            print(estimate)
components:
  schemas:
    RL.CreateModelResourcesRequest:
      type: object
      description: Request to provision a standalone model resource
      required:
        - base_model
      properties:
        base_model:
          type: string
          example: Qwen/Qwen3.5-4B
          description: >-
            Base model to provision the resource for, selected from
            /rl/supported-models
        base_weights_ref:
          type: string
          maxLength: 256
          pattern: ^together://ml_[A-Za-z0-9]+(@rv_[A-Za-z0-9]+)?$
          example: together://ml_A1b2C3d4E5f6G7h8I9j0K
          description: >-
            Model in this project's model registry whose weights the resource
            trains in place of the base model's own. It must be a full-weight
            model.
        compute_config:
          $ref: '#/components/schemas/RL.ComputeConfigCreateRequest'
          description: Compute layout to provision.
        lora_enabled:
          type: boolean
          default: true
          example: true
          description: >-
            Whether the resource hosts LoRA sessions or a single full-weight
            session
        optimizer_config:
          $ref: '#/components/schemas/RL.OptimizerConfig'
          description: Optimizer configuration for this resource.
        inactive_timeout:
          type: integer
          minimum: 300
          maximum: 86400
          default: 3600
          example: 3600
          description: >-
            Seconds without activity after which the resource stops and its
            sessions expire, counted from when it becomes ready and from its
            last activity. Every operation on any of its sessions restarts the
            count, and an extend expiry call can keep it up longer.
    RL.ModelResourcesEstimateCostResponse:
      type: object
      properties:
        price_per_hour:
          type: number
          format: double
          example: 56
          description: Estimated on-demand price per hour in the currency's major unit.
        currency:
          type: string
          example: USD
          description: ISO 4217 currency code.
      required:
        - price_per_hour
        - currency
    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
    RL.ComputeConfigCreateRequest:
      type: object
      description: Compute layout to provision for a model resource
      properties:
        num_generator_replicas:
          type: integer
          format: int32
          example: 2
          default: 1
          description: >-
            Number of generator replicas. 0 runs the trainer only, with no
            generator.
        gpu_type:
          type: string
          example: B200-SXM
          enum:
            - B200-SXM
          description: GPU type to provision. Omit to use the model's default GPU type.
        num_trainer_replicas:
          type: integer
          format: int32
          minimum: 0
          maximum: 1
          example: 0
          default: 1
          description: >-
            Number of trainers: 0 or 1. Omit to use 1. Each trainer can use
            multiple GPUs. With 0, at least one generator replica is required,
            optimizer_config is not allowed, and sessions must resume from an
            inference checkpoint for sampling only.
    RL.OptimizerConfig:
      type: object
      description: Optimizer configuration
      properties:
        adam:
          $ref: '#/components/schemas/RL.AdamConfig'
          description: Use the Adam optimizer.
        muon:
          $ref: '#/components/schemas/RL.MuonConfig'
          description: Use the Muon optimizer.
    RL.AdamConfig:
      type: object
      description: Adam optimizer configuration
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
    RL.MuonConfig:
      type: object
      description: Advanced configuration for the Muon optimizer.
      properties:
        scaling_strategy:
          $ref: '#/components/schemas/RL.MuonScalingStrategy'
          example: MUON_SCALING_STRATEGY_ORIGINAL
          default: MUON_SCALING_STRATEGY_MATCH_ADAM
          description: Scaling strategy for the Muon optimizer.
    RL.MuonScalingStrategy:
      type: string
      enum:
        - MUON_SCALING_STRATEGY_UNSPECIFIED
        - MUON_SCALING_STRATEGY_MATCH_ADAM
        - MUON_SCALING_STRATEGY_ORIGINAL
      default: MUON_SCALING_STRATEGY_UNSPECIFIED
  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.