Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.

Body

application/json
session_id
string
required

ID of the Loops session this sampler belongs to.

availability_model
enum<string> | null

Capacity the sampler runs on. 'spot' allows preemption when its GPUs are reclaimed. Defaults to 'standard' for standalone samplers. Paired samplers inherit their run's availability model; an explicit value must match it.

Available options:
standard,
spot
base_model
string | null

Base model ID for a standalone sampler (for example, a baseline).

run_id
string | null

ID of an existing run to attach this sampler to. When set, the sampler is paired to the run and weight-syncs from its trainer, and base_model is inherited from the run. Omit to create a standalone sampler.

max_seq_length
integer | null

Maximum prompt length (in tokens) the sampler must handle. Set this to the longest prompt you plan to send.

model_path
string | null

bt:// URI of an existing sampler checkpoint to serve. Form: bt://loops:<run_id>/sampler_weights/<checkpoint_name>.

Example:

"bt://loops:k4q95w5/sampler_weights/step-100"

reuse_from_session_id
string | null

Optional ID of a prior Loops session to reuse a trainer and/or sampler from. Deprecated.

num_replicas
integer | null

Number of replicas the sampler runs, applied as both its minimum and maximum. Must be at least 1. If omitted, a new sampler uses the platform defaults and a paired sampler reused from an earlier run keeps its settings. A run that already has a sampler keeps it unchanged, and when a run ends, its sampler is scaled down.

Required range: x >= 1
scope
enum<string>
default:default

Choose where this runs. 'default' lets Baseten choose. 'serverless' runs on Baseten's shared capacity, and fails instead of falling back when shared capacity can't serve the request. 'dedicated' gives it its own deployment, which you size and pay for. Standalone samplers only: a run's sampler runs where its run does.

Available options:
default,
serverless,
dedicated

Response

200 - application/json
sampler
LoopsSamplerV1 · object
required