---
title: "Create Rl Training Job"
method: POST
path: "/v1/preview/training-jobs"
tags: ["training-jobs"]
---

# Create Rl Training Job

`POST /v1/preview/training-jobs`

Create a new RL (Reinforcement Learning) training job.

## Request body

- CreateTrainingJob — Schema for creating a new TrainingJob.
  - `model_id` string, uuid, required
  - `trajectory_groups` TrajectoryGroup[], required
    - `trajectories` Trajectory[], required
      - `messages_and_choices` union[]
        - union
          - ChatCompletionDeveloperMessageParam — Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, `developer` messages replace the previous `system` messages.
            - `content` union, required
              - …
            - `role` 'developer', required
            - `name` string
          - ChatCompletionSystemMessageParam — Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, use `developer` messages for this purpose instead.
            - `content` union, required
              - …
            - `role` 'system', required
            - `name` string
          - ChatCompletionUserMessageParam — Messages sent by an end user, containing prompts or additional context information.
            - `content` union, required
              - …
            - `role` 'user', required
            - `name` string
          - ChatCompletionAssistantMessageParam — Messages sent by the model in response to user messages.
            - `role` 'assistant', required
            - `audio` Audio — Data about a previous audio response from the model. [Learn more](https://platform.openai.com/docs/guides/audio).
              - …
            - `content` union
              - …
            - `function_call` OpenaiTypesChatChatCompletionAssistantMessageParamFunctionCall — Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
              - …
            - `name` string
            - `refusal` string, nullable
            - `tool_calls` union[]
              - …
          - ChatCompletionToolMessageParam
            - `content` union, required
              - …
            - `role` 'tool', required
            - `tool_call_id` string, required
          - ChatCompletionFunctionMessageParam
            - `content` string, nullable, required
            - `name` string, required
            - `role` 'function', required
          - Choice
            - `finish_reason` 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call', required
            - `index` integer, required
            - `logprobs` ChoiceLogprobs — Log probability information for the choice.
              - …
            - `message` ChatCompletionMessage, required — A chat completion message generated by the model.
              - …
      - `tools` ChatCompletionFunctionToolParam[], nullable
        - `function` FunctionDefinition, required
          - `name` string, required
          - `description` string
          - `parameters` object
          - `strict` boolean, nullable
        - `type` 'function', required
      - `additional_histories` History[]
        - `messages_and_choices` union[], required
          - union
            - ChatCompletionDeveloperMessageParam — Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, `developer` messages replace the previous `system` messages.
              - …
            - ChatCompletionSystemMessageParam — Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, use `developer` messages for this purpose instead.
              - …
            - ChatCompletionUserMessageParam — Messages sent by an end user, containing prompts or additional context information.
              - …
            - ChatCompletionAssistantMessageParam — Messages sent by the model in response to user messages.
              - …
            - ChatCompletionToolMessageParam
              - …
            - ChatCompletionFunctionMessageParam
              - …
            - Choice
              - …
        - `tools` ChatCompletionFunctionToolParam[], nullable
          - `function` FunctionDefinition, required
            - `name` string, required
            - `description` string
            - `parameters` object
            - `strict` boolean, nullable
          - `type` 'function', required
      - `reward` number
      - `initial_policy_version` integer, nullable
      - `final_policy_version` integer, nullable
      - `metrics` object
      - `metadata` object
      - `logs` string[]
      - `start_time` string, date-time
  - `experimental_config` ExperimentalTrainingConfig — Schema for experimental training config.
    - `advantage_balance` number, nullable
    - `allow_training_without_logprobs` boolean, nullable
    - `epsilon` number, nullable
    - `epsilon_high` number, nullable
    - `importance_sampling_level` 'token' | 'sequence' | 'average' | 'geometric_average', nullable
    - `kimi_k2_tau` number, nullable
    - `kl_penalty_coef` number, nullable
    - `kl_penalty_reference_step` integer, nullable
    - `kl_penalty_source` 'current_learner' | 'sample', nullable
    - `kl_penalty_step_lag` integer, nullable
    - `kl_ref_adapter_path` string, nullable
    - `learning_rate` number, nullable
    - `logprob_calculation_chunk_size` integer, nullable
    - `loss_fn` 'cispo' | 'ppo', nullable
    - `mask_prob_ratio` boolean, nullable
    - `max_negative_advantage_importance_sampling_weight` number, nullable
    - `normalize_advantages` boolean, nullable
    - `num_trajectories_learning_rate_multiplier_power` number, nullable
    - `packed_sequence_length` integer, nullable
    - `plot_tensors` boolean, nullable
    - `ppo` boolean, nullable
    - `precalculate_logprobs` boolean, nullable
    - `scale_learning_rate_by_reward_std_dev` boolean, nullable
    - `scale_rewards` boolean, nullable
    - `truncated_importance_sampling` number, nullable

## Response `200`

Successful Response

- TrainingJobResponse — Schema for TrainingJob response.
  - `id` string, uuid, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/wandb/apis/serverless-training.md) · [All operations](https://skmtc.net/wandb/apis/serverless-training/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wandb/serverless-training/revisions/8d8d96fc0fd3/schema)
