---
title: "Optimizer step"
method: POST
path: "/rl/training-sessions/{session_id}/operations/optim-step"
tags: ["RL"]
---

# Optimizer step

`POST /rl/training-sessions/{session_id}/operations/optim-step`

Submits an optimizer step operation that will asynchronously apply accumulated gradients to update model parameters. Does not make the updated parameters available for sampling; call `weights-sync` afterwards when you want subsequent samples to use the updated policy.

## Path parameters

- `session_id` string, required — Training session ID

## Request body

- RLOptimStepBody — Request body for an optimizer step.
  - `adam_params` RLAdamParams — Per-step Adam optimizer overrides.
    - `learning_rate` number — Learning rate for the Adam-tuned parameters
    - `beta1` number — Exponential decay rate for the first-moment estimate
    - `beta2` number — Exponential decay rate for the second-moment estimate
    - `eps` number — Epsilon for numerical stability
    - `weight_decay` number — Weight decay coefficient
    - `grad_clip_norm` number — Maximum gradient norm for this step, gradients across all model parameters are clipped to this value. Set to 0 to disable gradient clipping. When unset, gradients are clipped to the session default (1.0).
  - `muon_params` RLMuonParams — Per-step Muon optimizer overrides
    - `learning_rate` number — Learning rate for this Muon optimizer step.
    - `momentum` number — Momentum coefficient
    - `newton_schulz_steps` integer — Number of Newton-Schulz iterations
    - `weight_decay` number — Weight decay coefficient
    - `grad_clip_norm` number — Maximum gradient norm for this step, gradients across all model parameters are clipped to this value. Set to 0 to disable gradient clipping. When unset, gradients are clipped to the session default (1.0).
    - `adam` RLAdamParams — Per-step Adam optimizer overrides.
      - `learning_rate` number — Learning rate for the Adam-tuned parameters
      - `beta1` number — Exponential decay rate for the first-moment estimate
      - `beta2` number — Exponential decay rate for the second-moment estimate
      - `eps` number — Epsilon for numerical stability
      - `weight_decay` number — Weight decay coefficient
      - `grad_clip_norm` number — Maximum gradient norm for this step, gradients across all model parameters are clipped to this value. Set to 0 to disable gradient clipping. When unset, gradients are clipped to the session default (1.0).

## Response `200`

Optimizer step operation details

- RLOptimStepOperation — Async optimizer step operation
  - `id` string, required — Operation ID
  - `status` 'TRAINING_OPERATION_STATUS_UNSPECIFIED' | 'TRAINING_OPERATION_STATUS_PENDING' | 'TRAINING_OPERATION_STATUS_RUNNING' | 'TRAINING_OPERATION_STATUS_COMPLETED' | 'TRAINING_OPERATION_STATUS_FAILED', required
  - `output` RLOptimStepResult — Result of an optimizer step operation
    - `step` union, required — Step number
      - string
      - integer
  - `error` RLTrainingOperationError — Error details for a failed training operation
    - `code` 'TRAINING_OPERATION_ERROR_CODE_UNSPECIFIED' | 'TRAINING_OPERATION_ERROR_CODE_RESOURCE_EXHAUSTED' | 'TRAINING_OPERATION_ERROR_CODE_TIMEOUT' | 'TRAINING_OPERATION_ERROR_CODE_INTERNAL_ERROR' | 'TRAINING_OPERATION_ERROR_CODE_SESSION_NOT_ACTIVE' | 'TRAINING_OPERATION_ERROR_CODE_INVALID_INPUT' | 'TRAINING_OPERATION_ERROR_CODE_NON_FINITE_LOSS' — Application error code for a failed training operation
    - `message` string — Human-readable error message

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/together/apis/together-apis.md) · [All operations](https://skmtc.net/together/apis/together-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/together/together-apis/versions/f26a23fab8e0/schema)
