> ## 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.

# Create model resources

> Provisions a standalone model resource that training sessions can attach to.



## OpenAPI

````yaml openapi.yaml POST /v1/rl/model-resources
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:
    post:
      tags:
        - RL
      summary: Create model resources
      description: >-
        Provisions a standalone model resource that training sessions can attach
        to.
      operationId: createModelResources
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.CreateModelResourcesRequest'
        required: true
      responses:
        '200':
          description: Model resource details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.ModelResources'
        '429':
          description: >-
            Model resource create request rejected because the organization GPU
            quota was exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        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()

            resource = client.post_training.model_resources.create(
                base_model="Qwen/Qwen3.5-9B",
                lora_enabled=True,
                compute_config={"gpu_type": "B200-SXM", "num_generator_replicas": 1},
            )
            print(resource.id, resource.status)
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.ModelResources:
      type: object
      description: Allocated GPU resources that training sessions attach to
      required:
        - id
        - status
        - status_details
        - base_model
        - compute_config
        - lora_enabled
        - created_at
        - updated_at
        - optimizer_config
        - created_by
        - inactive_timeout
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Unique identifier for the model resource
        status:
          $ref: '#/components/schemas/RL.ModelResourcesStatus'
          example: MODEL_RESOURCES_STATUS_READY
          description: Lifecycle status of the model resource
        error:
          $ref: '#/components/schemas/RL.ModelResourcesError'
          description: >-
            Structured detail for the model resource's current error. Set when
            the resource is in an error state.
        status_details:
          $ref: '#/components/schemas/RL.ModelResourcesStatusDetails'
          description: >-
            Details of the resource's current status, such as its place in the
            queue.
        base_model:
          type: string
          example: Qwen/Qwen3.5-4B
          description: Base model the resource is provisioned for
        base_weights_ref:
          type: string
          example: together://ml_A1b2C3d4E5f6G7h8I9j0K@rv_A1b2C3d4E5f6G7h8I9j0K
          description: >-
            Model-registry model whose weights the resource trains in place of
            the base model's own, pinned to the revision resolved when the
            resource was created. Absent when the resource trains the base
            model's own weights.
        compute_config:
          $ref: '#/components/schemas/RL.ComputeConfig'
          description: Compute layout provisioned for the resource.
        lora_enabled:
          type: boolean
          example: true
          description: Whether the resource hosts LoRA sessions or a full-weight session
        created_at:
          type: string
          format: date-time
          example: '2026-01-02T00:00:00Z'
          description: Timestamp when the model resource was created
        updated_at:
          type: string
          format: date-time
          example: '2026-01-02T00:00:05Z'
          description: Timestamp when the model resource was last updated
        optimizer_config:
          $ref: '#/components/schemas/RL.OptimizerConfig'
          description: >-
            Optimizer configuration for this resource. Unused for generator-only
            resources.
        created_by:
          type: string
          example: user_123
          description: ID of the user who created the model resource
        inactive_timeout:
          type: integer
          example: 3600
          description: >-
            Seconds without activity after which the resource stops and its
            sessions expire. Every operation on any of its sessions restarts the
            count.
        expires_at:
          type: string
          format: date-time
          example: '2026-01-02T01:00:05Z'
          description: >-
            The earliest time the resource can stop for inactivity, which also
            expires its sessions. It is the resource's last activity plus
            `inactive_timeout` seconds. Becoming ready, a session start and
            every operation on any of its sessions count as activity, and the
            resource does not stop while an operation is running. An extend
            expiry call can move it later. It never moves earlier. Refreshed
            about once a minute. Set while the resource is ready.
    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.ModelResourcesStatus:
      description: Lifecycle status of a model resource
      type: string
      enum:
        - MODEL_RESOURCES_STATUS_PENDING
        - MODEL_RESOURCES_STATUS_CREATING
        - MODEL_RESOURCES_STATUS_READY
        - MODEL_RESOURCES_STATUS_ERROR
        - MODEL_RESOURCES_STATUS_STOPPED
        - MODEL_RESOURCES_STATUS_STOPPING
    RL.ModelResourcesError:
      type: object
      description: Structured detail for the model resource's current error
      required:
        - code
        - message
        - occurred_at
      properties:
        code:
          $ref: '#/components/schemas/RL.ModelResourcesErrorCode'
          example: MODEL_RESOURCES_ERROR_CODE_CAPACITY_WAIT_TIMEOUT
          description: Finite machine-readable reason code for UI branching
        message:
          type: string
          example: Timed out waiting for cluster capacity. Try again later.
          description: User-safe human-readable detail for the current status
        occurred_at:
          type: string
          format: date-time
          example: '2026-01-02T00:00:05Z'
          description: Timestamp when this error was reported
    RL.ModelResourcesStatusDetails:
      type: object
      description: Details of a model resource's current status
      properties:
        queue_position:
          type: integer
          format: int64
          example: 3
          description: >-
            Estimated place of the resource in the queue: the number of older
            resources of the same GPU type still waiting for GPUs, plus one. Set
            only while the resource waits for GPUs.
    RL.ComputeConfig:
      type: object
      description: Compute layout for a model resource
      required:
        - num_generator_replicas
        - num_trainer_replicas
      properties:
        num_generator_replicas:
          type: integer
          format: int32
          example: 1
          description: >-
            Number of generator replicas. 0 means the resource runs the trainer
            only, with no generator.
        gpu_type:
          type: string
          example: B200-SXM
          enum:
            - H100-80GB
            - B200-SXM
          description: GPU type selected for this resource.
        num_trainer_replicas:
          type: integer
          format: int32
          example: 1
          description: >-
            Number of trainers: 0 for sampling only, or 1 for training. Each
            trainer can use multiple GPUs.
    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.ModelResourcesErrorCode:
      type: string
      description: Finite machine-readable model resource lifecycle error code
      enum:
        - MODEL_RESOURCES_ERROR_CODE_CAPACITY_WAIT_TIMEOUT
        - MODEL_RESOURCES_ERROR_CODE_PROVISIONING_FAILED
        - MODEL_RESOURCES_ERROR_CODE_RESOURCE_UNAVAILABLE
    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.