RL

Extend model resources expiry

Changed on

Keeps a ready model resource from stopping for inactivity for at least the given number of seconds from now. It moves the resource's expires_at to at least that time, and never earlier. Every operation on the resource's sessions already keeps it up for inactive_timeout seconds, so use this only to stay up longer without operations, for example while you compute rewards. Fails if the resource is not ready.

post/v1/rl/model-resources/{model_resources_id}/extend-expiry

Request

  • Base URL
    https://api.together.ai
  • URL
    https://api.together.ai/v1/rl/model-resources/{model_resources_id}/extend-expiry
  • Auth
    HTTP bearer

Path parameters

model_resources_idstring required

ID of the model resource

Request body

secondsinteger required

Seconds from now the resource must not stop for inactivity.

Example request

{
  "seconds": 7200
}

Response

Model resource details

idstring required

Unique identifier for the model resource

status'MODEL_RESOURCES_STATUS_PENDING' | 'MODEL_RESOURCES_STATUS_CREATING' | 'MODEL_RESOURCES_STATUS_READY' | 'MODEL_RESOURCES_STATUS_ERROR' | 'MODEL_RESOURCES_STATUS_STOPPED' | 'MODEL_RESOURCES_STATUS_STOPPING' required

Lifecycle status of a model resource

base_modelstring required

Base model the resource is provisioned for

base_weights_refstring

Model-registry model whose weights the resource trains in place of the base model's own, pinned to the revision resolved when the resource was created. Absent when the resource trains the base model's own weights.

lora_enabledboolean required

Whether the resource hosts LoRA sessions or a full-weight session

created_atstring date-time required

Timestamp when the model resource was created

updated_atstring date-time required

Timestamp when the model resource was last updated

created_bystring required

ID of the user who created the model resource

inactive_timeoutinteger required

Seconds without activity after which the resource stops and its sessions expire. Every operation on any of its sessions restarts the count.

expires_atstring date-time

The earliest time the resource can stop for inactivity, which also expires its sessions. It is the resource's last activity plus inactive_timeout seconds. Becoming ready, a session start and every operation on any of its sessions count as activity, and the resource does not stop while an operation is running. An extend expiry call can move it later. It never moves earlier. Refreshed about once a minute. Set while the resource is ready.

Example response

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "error": {
    "message": "Timed out waiting for cluster capacity. Try again later.",
    "occurred_at": "2026-01-02T00:00:05Z"
  },
  "status_details": {
    "queue_position": 3
  },
  "base_model": "Qwen/Qwen3.5-4B",
  "base_weights_ref": "together://ml_A1b2C3d4E5f6G7h8I9j0K@rv_A1b2C3d4E5f6G7h8I9j0K",
  "compute_config": {
    "num_generator_replicas": 1,
    "gpu_type": "B200-SXM"
  },
  "lora_enabled": true,
  "created_at": "2026-01-02T00:00:00Z",
  "updated_at": "2026-01-02T00:00:05Z",
  "created_by": "user_123",
  "inactive_timeout": 3600,
  "expires_at": "2026-01-02T01:00:05Z"
}

Changes