> ## 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 training session

> Creates a training session and returns its details.



## OpenAPI

````yaml openapi.yaml POST /rl/training-sessions
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:
  /rl/training-sessions:
    post:
      tags:
        - RL
      summary: Create training session
      description: Creates a training session and returns its details.
      operationId: startTrainingSession
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.StartTrainingSessionRequest'
        required: true
      responses:
        '200':
          description: Training session details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.TrainingSession'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
components:
  schemas:
    RL.StartTrainingSessionRequest:
      type: object
      required:
        - model_resources_id
      properties:
        resume_from_checkpoint_id:
          description: >-
            Checkpoint ID to resume from. LoRA training checkpoints may resume
            on another model resource with compatible base-model weights.
            Full-weight training checkpoints require the original base model.
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
        lora_config:
          $ref: '#/components/schemas/RL.LoraConfig'
          description: LoRA adapter configuration for the session
        model_resources_id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: ID of the model resource to use for this training session.
        display_name:
          type: string
          maxLength: 128
          example: gsm8k-experiment-2
          description: Optional display name used to identify the training session
        metadata:
          $ref: '#/components/schemas/RL.TrainingSessionMetadata'
          description: Optional auxiliary metadata to associate with the training session
        load_optimizer:
          description: >-
            Whether to restore optimizer state and step from a training
            checkpoint. Omitted or true restores them; false loads weights only
            with a fresh optimizer and step 0. Not valid for inference
            checkpoints, which have no optimizer state.
          type: boolean
          example: true
    RL.TrainingSession:
      type: object
      description: A training session and its current state
      required:
        - id
        - metadata
        - status
        - inference_checkpoints
        - training_checkpoints
        - step
        - created_at
        - updated_at
        - model_resources_id
        - created_by
        - base_model
        - policy_state
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: ID of the training session
        display_name:
          type: string
          maxLength: 128
          example: gsm8k-experiment-2
          description: Display name used to identify the training session
        metadata:
          $ref: '#/components/schemas/RL.TrainingSessionMetadata'
          description: Auxiliary metadata associated with the training session
        status:
          $ref: '#/components/schemas/RL.TrainingSessionStatus'
          example: TRAINING_SESSION_STATUS_RUNNING
          description: Status of the training session
        error:
          $ref: '#/components/schemas/RL.TrainingSessionError'
          description: >-
            Structured detail for the training session's current error. Set when
            the session is in an error state.
        inference_checkpoints:
          type: array
          items:
            $ref: '#/components/schemas/RL.InferenceCheckpoint'
            type: object
          description: List of saved inference checkpoints for this session
        training_checkpoints:
          type: array
          items:
            $ref: '#/components/schemas/RL.TrainingCheckpoint'
            type: object
          description: List of saved training checkpoints for this session
        resume_from_checkpoint_id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Checkpoint ID this session was resumed from
        step:
          description: Current training step
          oneOf:
            - type: string
            - type: integer
          example: '100'
          default: '0'
        created_at:
          type: string
          format: date-time
          example: '2026-01-02T00:00:00Z'
          description: Timestamp when the training session was created
        updated_at:
          type: string
          format: date-time
          example: '2026-01-02T00:00:05Z'
          description: Timestamp when the training session was last updated
        lora_config:
          $ref: '#/components/schemas/RL.LoraConfig'
          description: >-
            LoRA adapter configuration. Present only for sessions running on a
            LoRA-enabled model resource.
        model_resources_id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: ID of the model resource used by this training session.
        base_model:
          type: string
          example: Qwen/Qwen3.5-4B
          description: >-
            Base model the session trains, taken from the model resource it is
            attached to
        created_by:
          type: string
          example: user_123
          description: ID of the user who created the training session
        policy_state:
          $ref: '#/components/schemas/RL.SessionPolicyState'
          description: Session-scoped policy and weight versions for this session
    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.LoraConfig:
      type: object
      description: LoRA adapter configuration
      properties:
        rank:
          type: integer
          example: 32
          default: 32
          description: Rank of the LoRA adapter
        alpha:
          type: integer
          example: 64
          default: 64
          description: Alpha of the LoRA adapter
        dropout:
          type: number
          example: 0
          default: 0
          description: Dropout of the LoRA adapter
        seed:
          oneOf:
            - type: string
            - type: integer
          example: '59'
          description: >-
            Random seed for initializing LoRA adapter weights. Ignored when LoRA
            is disabled or the session resumes from a checkpoint.
        train_unembed:
          type: boolean
          example: true
          default: true
          description: >-
            Whether to also train a LoRA adapter on the output head. Defaults to
            true.
    RL.TrainingSessionMetadata:
      type: object
      description: Auxiliary metadata associated with a training session
      properties:
        wandb:
          $ref: '#/components/schemas/RL.WandbMetadata'
          description: Weights & Biases details associated with the training session
    RL.TrainingSessionStatus:
      description: Status of the training session
      default: TRAINING_SESSION_STATUS_UNSPECIFIED
      type: string
      enum:
        - TRAINING_SESSION_STATUS_UNSPECIFIED
        - TRAINING_SESSION_STATUS_CREATING
        - TRAINING_SESSION_STATUS_RUNNING
        - TRAINING_SESSION_STATUS_STOPPED
        - TRAINING_SESSION_STATUS_STOPPING
        - TRAINING_SESSION_STATUS_ERROR
        - TRAINING_SESSION_STATUS_EXPIRED
    RL.TrainingSessionError:
      type: object
      description: Structured detail for the training session's current error
      required:
        - code
        - message
        - occurred_at
      properties:
        code:
          $ref: '#/components/schemas/RL.TrainingSessionErrorCode'
          example: TRAINING_SESSION_ERROR_CODE_RESOURCE_AT_CAPACITY
          description: Finite machine-readable reason code for UI branching
        message:
          type: string
          example: >-
            The session could not start because the selected resource has no
            available capacity.
          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.InferenceCheckpoint:
      type: object
      description: Saved inference checkpoint
      required:
        - id
        - step
        - created_at
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Unique identifier for the checkpoint
        step:
          oneOf:
            - type: string
            - type: integer
          example: '42'
          description: Training step at time of save
        created_at:
          type: string
          format: date-time
          example: '2026-01-02T00:00:00Z'
          description: Timestamp when the checkpoint was created
        registration:
          $ref: '#/components/schemas/RL.InferenceCheckpointRegistration'
          description: >-
            Model registry artifacts to deploy or download this checkpoint from.
            Absent when the checkpoint was not uploaded to the registry.
    RL.TrainingCheckpoint:
      type: object
      description: Saved training checkpoint
      required:
        - id
        - step
        - created_at
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Unique identifier for the checkpoint
        step:
          oneOf:
            - type: string
            - type: integer
          example: '42'
          description: Training step at time of save
        created_at:
          type: string
          format: date-time
          example: '2026-01-02T00:00:00Z'
          description: Timestamp when the checkpoint was created
        registration:
          $ref: '#/components/schemas/RL.ModelRegistryArtifact'
          description: >-
            Model registry artifact holding this checkpoint's training state,
            used to resume training rather than to deploy. Absent when the
            checkpoint was not uploaded to the registry.
    RL.SessionPolicyState:
      type: object
      description: >-
        Policy and weight versions for this training session. Compare these with
        `policy_segments[].version` on sample results from the same session.
        Versions may reset after session recovery or resume.
      required:
        - trainer_step
        - target_weights_version
        - applied_weights_version
        - pending_publish
      properties:
        trainer_step:
          description: >-
            Policy version produced by the last completed optimizer step.
            Distinct from `TrainingSession.step`, which is the durable
            optimizer-step counter.
          oneOf:
            - type: string
            - type: integer
          example: '7'
        target_weights_version:
          description: Policy version promised to the generator by the latest weights-sync.
          oneOf:
            - type: string
            - type: integer
          example: '7'
        applied_weights_version:
          description: >-
            Policy version successfully applied to the generator for this
            session.
          oneOf:
            - type: string
            - type: integer
          example: '6'
        pending_publish:
          type: boolean
          example: true
          description: >-
            True when a generator publish has been requested but has not
            finished.
    RL.WandbMetadata:
      type: object
      description: Details that associate a training session with a Weights & Biases run
      properties:
        entity:
          type: string
          maxLength: 256
          example: example-org
          description: Weights & Biases username or team that owns the project
        project:
          type: string
          maxLength: 256
          example: grpo-gsm8k
          description: Weights & Biases project containing the run
        group:
          type: string
          maxLength: 256
          example: gsm8k-35b-sweep
          description: Weights & Biases group used to organize related runs
        run_name:
          type: string
          maxLength: 256
          example: exp2-thinking-4k-ctx
          description: Human-readable name of the Weights & Biases run
        run_id:
          type: string
          maxLength: 256
          example: abc123
          description: Unique identifier assigned to the run by Weights & Biases
        url:
          type: string
          maxLength: 2048
          example: https://wandb.ai/example-org/example-project/runs/run-id
          description: HTTPS URL for the Weights & Biases run
    RL.TrainingSessionErrorCode:
      type: string
      description: Finite machine-readable training session lifecycle error code
      enum:
        - TRAINING_SESSION_ERROR_CODE_RESOURCE_UNAVAILABLE
        - TRAINING_SESSION_ERROR_CODE_RESOURCE_AT_CAPACITY
        - TRAINING_SESSION_ERROR_CODE_TIMED_OUT
        - TRAINING_SESSION_ERROR_CODE_SESSION_FAILED
    RL.InferenceCheckpointRegistration:
      type: object
      description: >-
        Where an inference checkpoint's weights are stored in the Together model
        registry. At least one of `model` and `adapter` is set.
      properties:
        model:
          $ref: '#/components/schemas/RL.ModelRegistryArtifact'
          description: >-
            Full model weights. Set for full-weight training, and for LoRA
            training on custom base weights, where the merged model is deployed
            instead of the adapter.
        adapter:
          $ref: '#/components/schemas/RL.ModelRegistryArtifact'
          description: >-
            LoRA adapter weights, deployed on top of the base model. Set for
            LoRA training on the base model's own weights.
    RL.ModelRegistryArtifact:
      type: object
      description: A specific revision of a model in the Together model registry
      required:
        - id
        - revision_id
      properties:
        id:
          type: string
          example: ml_abc123
          description: >-
            ID of the model in the Together model registry, as used by the
            models API
        revision_id:
          type: string
          example: rv_def456
          description: Revision of the model that holds this checkpoint
  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.