Authentication
Send your Baseten API key as a bearer token:Teams
Most routes use/v1/loops and run in your organization’s default team. Routes under /v1/teams/{team_id}/loops provision or list resources in a specified team.
A session isn’t scoped to a team. Creating one through a team route checks that you can train in that team, but a run’s trainer and sampler belong to the team of the route that creates the run. See Teams for how teams work.
In the Loops Python SDK, pass the team name as the team argument to ServiceClient. The SDK looks up the team’s ID for these requests.
Errors
For trainer provisioning failures, use the capacity and quota error table to distinguish unavailable GPUs (429) from an organization trainer limit (403). If you use the Python SDK, see SDK request errors for readiness and sampling retry behavior.
Resource model
A session owns runs and samplers. A run owns checkpoints, and checkpoints produce deployments. Both the HTTP API and the Python SDK identify a trainer by itsrun_id.
The same Loops endpoints manage runs in both availability modes. Serverless runs have a null deployment ID, and their samplers have null model and deployment IDs. A null value alone doesn’t identify the mode.
Create a trainer with POST /v1/loops/trainers, then create its paired sampler with POST /v1/loops/samplers and the run_id when sampling is needed. Deactivate the run to end both resources; standalone samplers are deactivated separately. See Availability modes for lifecycle and billing differences.