---
title: "Weights sync"
method: POST
path: "/rl/training-sessions/{session_id}/operations/weights-sync"
tags: ["RL"]
---

# Weights sync

`POST /rl/training-sessions/{session_id}/operations/weights-sync`

Submits a weights-sync operation that makes the session's current trained parameters available for sampling. Call this after `optim-step` when you want subsequent samples to use the updated policy.

## Path parameters

- `session_id` string, required — Training session ID

## Request body

- RLWeightsSyncBody — Request body for publishing updated policy parameters for sampling.
  - `weight_sync_type` 'WEIGHT_SYNC_TYPE_SYNCHRONOUS' | 'WEIGHT_SYNC_TYPE_BACKGROUND_PUBLISH' | 'WEIGHT_SYNC_TYPE_PIPELINE', required — How updated policy parameters are made available for sampling. SYNCHRONOUS waits for the policy update before returning; BACKGROUND_PUBLISH returns after scheduling the update; PIPELINE overlaps the update with in-flight sampling when possible.

## Response `200`

Weights-sync operation details

- RLWeightsSyncOperation — Async weights-sync 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` RLWeightsSyncResult — Result of a weights-sync operation
    - `weights_version` union, required — Policy version now available for sampling, or queued to become available for deferred sync modes. Comparable to `policy_segments[].version` on sample results.
      - 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/revisions/f26a23fab8e0/schema)
