> ## 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 rollout time and price

> Estimates rollout-only time, generator GPU-hours, billed GPU-hours of the whole model resource, and price for a supported model and GPU type. Each generator replica may contain several inference servers or span multiple nodes. Assumes identical episodes, exact reuse of generated tokens between turns, turns that start together within a replica, no environment delay, and no concurrent computation of the same initial prompt. Prompt-cache reuse and capacity misses are approximate, especially for multi-turn episodes. Rates are measured in the training mode reported by lora_enabled. Cache-transfer and request-preemption delays are not included, so long multi-turn rollouts with distinct prompts can take longer than estimated.



## OpenAPI

````yaml openapi.yaml POST /v1/rl/rollouts/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/rl/rollouts/estimate:
    post:
      tags:
        - RL
      summary: Estimate rollout time and price
      description: >-
        Estimates rollout-only time, generator GPU-hours, billed GPU-hours of
        the whole model resource, and price for a supported model and GPU type.
        Each generator replica may contain several inference servers or span
        multiple nodes. Assumes identical episodes, exact reuse of generated
        tokens between turns, turns that start together within a replica, no
        environment delay, and no concurrent computation of the same initial
        prompt. Prompt-cache reuse and capacity misses are approximate,
        especially for multi-turn episodes. Rates are measured in the training
        mode reported by lora_enabled. Cache-transfer and request-preemption
        delays are not included, so long multi-turn rollouts with distinct
        prompts can take longer than estimated.
      operationId: estimateRollout
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.EstimateRolloutRequest'
        required: true
      responses:
        '200':
          description: Estimated rollout time and price
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.EstimateRolloutResponse'
        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.rollouts.estimate(
                base_model="Qwen/Qwen3.5-9B",
                episodes=1024,
                concurrency=64,
                prompt_tokens=2000,
                turns=4,
                added_tokens_per_turn=1500,
                generated_tokens_per_turn=500,
                compute_config={"gpu_type": "B200-SXM", "num_generator_replicas": 1},
            )

            print(estimate.wall_seconds, estimate.estimated_price,
            estimate.currency)
components:
  schemas:
    RL.EstimateRolloutRequest:
      type: object
      description: >-
        Episode shape, model, GPU type, and concurrency for a rollout-only
        estimate
      required:
        - episodes
        - concurrency
        - prompt_tokens
        - turns
        - added_tokens_per_turn
        - generated_tokens_per_turn
        - base_model
      properties:
        episodes:
          type: integer
          minimum: 1
          maximum: 10000000
          description: Total number of episodes (N). Must be between 1 and 10000000.
        concurrency:
          type: integer
          minimum: 1
          description: >-
            Maximum concurrent episodes across all generator replicas (B). Must
            be positive.
        prompt_tokens:
          type: integer
          minimum: 1
          description: Initial prompt tokens per episode (P). Must be positive.
        turns:
          type: integer
          minimum: 1
          maximum: 1024
          description: Assistant turns per episode (T). Must be between 1 and 1024.
        added_tokens_per_turn:
          type: integer
          description: >-
            Tokens added before each later turn (K), including the prior
            generated tokens followed by environment tokens. Must be at least
            generated_tokens_per_turn.
        generated_tokens_per_turn:
          type: integer
          minimum: 1
          description: Tokens generated on each turn (O). Must be positive.
        distinct_prompts_per_replica:
          type: integer
          minimum: 1
          description: >-
            Number of distinct initial prompts among the concurrent episodes of
            one replica (Q). When episodes_per_prompt is given, defaults to
            ceil(concurrent episodes / G). Otherwise defaults to 1 when
            shared_prefix_tokens equals prompt_tokens, and to the concurrent
            episodes per replica when it does not. Must be 1 when
            shared_prefix_tokens equals prompt_tokens.
        episodes_per_prompt:
          type: integer
          minimum: 1
          description: >-
            Maximum sibling episodes per initial prompt (G). When
            distinct_prompts_per_replica is given, defaults to ceil(concurrent
            episodes / Q). Otherwise defaults to the concurrent episodes per
            replica when shared_prefix_tokens equals prompt_tokens, and to 1
            when it does not. When shared_prefix_tokens equals prompt_tokens,
            must be at least the concurrent episodes per replica.
        shared_prefix_tokens:
          type: integer
          default: 0
          description: >-
            Leading tokens shared by all distinct initial prompts (H). Defaults
            to 0; cannot exceed prompt_tokens.
        base_model:
          type: string
          minLength: 1
          maxLength: 256
          pattern: ^[A-Za-z0-9._/-]+$
          example: zai-org/GLM-5.3
          description: >-
            Base model to estimate. The model, GPU type, and training mode must
            support rollout estimates.
        compute_config:
          $ref: '#/components/schemas/RL.ComputeConfigCreateRequest'
          description: >-
            Compute layout to estimate, as for a model resource. Omitted fields
            use the model's default GPU type and one generator replica (D);
            num_generator_replicas must be positive.
        lora_enabled:
          type: boolean
          default: true
          example: true
          description: >-
            Whether to estimate a resource that hosts LoRA sessions (true,
            default) or a single full-weight session (false), as in a model
            resource. The model and GPU type must support rollout estimates in
            this mode.
    RL.EstimateRolloutResponse:
      type: object
      description: Estimated rollout elapsed time, tokens, throughput, GPU-hours, and price
      required:
        - wall_seconds
        - allocated_gpu_hours
        - submitted_prompt_tokens
        - generated_tokens
        - effective_decode_tokens_per_second
        - effective_distinct_prompts_per_replica
        - effective_episodes_per_prompt
        - effective_shared_prefix_tokens
        - lora_enabled
        - billed_gpu_hours
        - estimated_price
        - currency
        - effective_prefill_tokens_per_second
      properties:
        wall_seconds:
          type: number
          format: double
          description: Estimated time until all rollout episodes finish, in seconds.
        allocated_gpu_hours:
          type: number
          format: double
          description: Generator GPUs across all replicas times wall time, in GPU-hours.
        submitted_prompt_tokens:
          description: >-
            Prompt tokens submitted across all turns. JSON encodes this count as
            a decimal string.
          oneOf:
            - type: string
            - type: integer
        generated_tokens:
          description: >-
            Generated output tokens across all turns. JSON encodes this count as
            a decimal string.
          oneOf:
            - type: string
            - type: integer
        effective_decode_tokens_per_second:
          type: number
          format: double
          description: generated_tokens divided by wall_seconds.
        effective_distinct_prompts_per_replica:
          type: integer
          description: >-
            Effective distinct_prompts_per_replica (Q) for the largest
            concurrent batch of one replica.
        effective_episodes_per_prompt:
          type: integer
          description: >-
            Effective episodes_per_prompt (G) for the largest concurrent batch
            of one replica.
        effective_shared_prefix_tokens:
          type: integer
          description: Effective shared_prefix_tokens (H).
        lora_enabled:
          type: boolean
          description: >-
            Whether the estimate is for a LoRA resource (true) or a full-weight
            resource (false).
        billed_gpu_hours:
          type: number
          format: double
          description: >-
            GPUs of the whole model resource, trainer and generator, times wall
            time, in GPU-hours. A model resource is billed for all of its GPUs
            while the rollouts run. An approximation measured on single-wave
            rollouts (concurrency equal to episodes) of up to four turns on one
            generator replica: actual usage can be up to about 45% higher when
            episodes share a prompt, and about 20% higher or lower otherwise.
            Longer multi-turn rollouts with distinct prompts can take longer
            than estimated.
        estimated_price:
          type: number
          format: double
          description: >-
            Estimated on-demand price of the rollouts: billed_gpu_hours times
            the GPU type's list price per GPU-hour, the rate the model resource
            cost estimate uses. An approximation that inherits the uncertainty
            of billed_gpu_hours; it is not a quote.
        currency:
          type: string
          example: USD
          description: Currency of estimated_price.
        effective_prefill_tokens_per_second:
          type: number
          format: double
          description: >-
            submitted_prompt_tokens divided by wall_seconds, counting prompt
            tokens served from the prompt cache.
    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.
  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.