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

# Optimizer step

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

## Request

- Base URL: `https://api.together.ai`
- URL: `https://api.together.ai/v1/rl/training-sessions/{session_id}/operations/optim-step`
- Auth: HTTP bearer

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

## Headers

- `Idempotency-Key` string, required: Required key that makes retries return the original operation; use a new key for changed request bodies.

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

## Changes

- **2026-10-22** `bb5257b3173a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/together/apis/together-apis/changes/v1/rl/training-sessions/:session_id/operations/optim-step/post.md)

---

[API](https://skmtc.dev/together/apis/together-apis.md) - [All operations](https://skmtc.dev/together/apis/together-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/together/apis/together-apis/revisions/93438ddac711?raw)
