Skip to main content
An RL run is a model kept on a node of GPUs until you stop it. Your loop samples from it and trains it step by step. It is billed by its tokens (the model’s token_prices); starting holds credits that are returned when it stops. How to write the loop is in Serverless RL.
A run costs money from the moment it is ready until it is stopped, whether or not anything trains. Stop it when your loop ends, and when it fails.

Estimate

POST /v1/training/sessions/estimate with model and max_hours.
credits is what is held for max_hours, in US cents. You pay for the seconds the run was ready, on all its GPUs; the rest of the hold is released.

Start a run

POST /v1/training/sessions.

The run object

GET /v1/training/sessions/{id} returns one run; GET /v1/training/sessions returns a list.
state goes queued → starting (the model loads; not billed) → ready → closing (not billed) → closed, or failed. A failed run is not charged. billable_seconds is what has been billed so far.

Stop a run

POST /v1/training/sessions/{id}/close. Billing stops; the model is saved if it trained at least one step, and is then downloaded like a job’s checkpoint, with the run’s id in place of the job’s.

Sample and train

A ready run serves its own calls under /v1/training/sessions/{id}/nextron/v1/: sample, batches/{id}, train, steps/{id}, info, heartbeat, images/missing and finish. Drive them with the SDK’s client.rl.connect(id), which also tells the run every 20 seconds that your loop is alive:
Every argument of sample and train is in Python SDK and CLI.

Other calls

In the SDK: client.rl.rollouts(id, step=None), client.rl.metrics(id); on the command line nextron-cloud rl rollouts ID, nextron-cloud rl metrics ID.