> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Loops API reference

> HTTP routes for Loops sessions, runs, samplers, checkpoints, and deployments.

Manage Loops sessions, runs, samplers, checkpoints, and deployments over HTTP.

## Authentication

Send your Baseten API key as a bearer token:

```http theme={"system"}
Authorization: Bearer $BASETEN_API_KEY
```

## 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.

In the Loops Python SDK, pass the team name as the `team` argument to [`ServiceClient`](/reference/sdk/loops/service-client). The SDK looks up the team's ID for these requests.

## 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 its `run_id`.

## Endpoints

### Sessions

| Method | Endpoint | Description |
| - | - | - |
| `GET` | [`/v1/loops/sessions/{session_id}`](/reference/loops-api/sessions/get-a-session) | Gets a session. |
| `POST` | [`/v1/loops/sessions`](/reference/loops-api/sessions/create-a-session) | Creates a session. |
| `POST` | [`/v1/teams/{team_id}/loops/sessions`](/reference/loops-api/sessions/create-a-team-session) | Creates a session in a team. |

### Runs and trainers

| Method | Endpoint | Description |
| - | - | - |
| `GET` | [`/v1/loops/runs`](/reference/loops-api/runs/list-runs) | Lists runs. |
| `GET` | [`/v1/teams/{team_id}/loops/runs`](/reference/loops-api/runs/list-team-runs) | Lists runs in a team. |
| `GET` | [`/v1/loops/runs/{run_id}`](/reference/loops-api/runs/get-a-run) | Gets a run. |
| `POST` | [`/v1/loops/runs`](/reference/loops-api/runs/create-a-run) | Creates a run. |
| `POST` | [`/v1/teams/{team_id}/loops/runs`](/reference/loops-api/runs/create-a-team-run) | Creates a run in a team. |
| `POST` | [`/v1/loops/trainers`](/reference/loops-api/runs/create-a-trainer) | Creates a trainer. |
| `POST` | [`/v1/teams/{team_id}/loops/trainers`](/reference/loops-api/runs/create-a-team-trainer) | Creates a trainer in a team. |
| `POST` | [`/v1/loops/runs/{run_id}/deactivate`](/reference/loops-api/runs/deactivate-a-run) | Deactivates a run. |

### Samplers

| Method | Endpoint | Description |
| - | - | - |
| `GET` | [`/v1/loops/samplers`](/reference/loops-api/samplers/list-samplers) | Lists samplers. |
| `GET` | [`/v1/teams/{team_id}/loops/samplers`](/reference/loops-api/samplers/list-team-samplers) | Lists samplers in a team. |
| `GET` | [`/v1/loops/samplers/{sampler_id}`](/reference/loops-api/samplers/get-a-sampler) | Gets a sampler. |
| `POST` | [`/v1/loops/samplers`](/reference/loops-api/samplers/create-a-sampler) | Creates a sampler. |
| `POST` | [`/v1/teams/{team_id}/loops/samplers`](/reference/loops-api/samplers/create-a-team-sampler) | Creates a sampler in a team. |
| `POST` | [`/v1/loops/samplers/{sampler_id}/deactivate`](/reference/loops-api/samplers/deactivate-a-sampler) | Deactivates a standalone sampler. |

### Checkpoints

| Method | Endpoint | Description |
| - | - | - |
| `GET` | [`/v1/loops/checkpoints`](/reference/loops-api/checkpoints/list-checkpoints) | Lists checkpoints. |
| `GET` | [`/v1/loops/checkpoints/{checkpoint_id}/source`](/reference/loops-api/checkpoints/get-checkpoint-source) | Identifies the checkpoint storage source. |
| `GET` | [`/v1/loops/checkpoints/{checkpoint_id}/files`](/reference/loops-api/checkpoints/get-checkpoint-files) | Gets checkpoint files. |
| `POST` | [`/v1/loops/checkpoints/validate`](/reference/loops-api/checkpoints/validate-a-checkpoint) | Validates a checkpoint URI. |
| `POST` | [`/v1/loops/checkpoints/deploy`](/reference/loops-api/checkpoints/deploy-checkpoints) | Deploys one or more sampler checkpoints to a new inference deployment. |

### Deployments

| Method | Endpoint | Description |
| - | - | - |
| `GET` | [`/v1/loops/deployments`](/reference/loops-api/deployments/list-deployments) | Lists deployments. |
| `GET` | [`/v1/loops/deployments/{deployment_id}`](/reference/loops-api/deployments/get-a-deployment) | Gets a deployment. |
| `GET` | [`/v1/loops/deployments/{deployment_id}/logs`](/reference/loops-api/deployments/get-deployment-logs) | Gets deployment logs. |
| `GET` | [`/v1/loops/deployments/{deployment_id}/debug_archive/files`](/reference/loops-api/deployments/get-deployment-debug-archive) | Gets deployment debug archive files. |
| `POST` | [`/v1/loops/deployments/{deployment_id}/metrics`](/reference/loops-api/deployments/get-deployment-metrics) | Gets deployment metrics. |
| `POST` | [`/v1/loops/deployments/{deployment_id}/deactivate`](/reference/loops-api/deployments/deactivate-a-deployment) | Deactivates a deployment. |

### Server

| Method | Endpoint | Description |
| - | - | - |
| `GET` | [`/v1/loops/capabilities`](/reference/loops-api/server/get-capabilities) | Gets server capabilities. |
| `GET` | [`/v1/loops/user_config`](/reference/loops-api/server/get-your-loops-user-config) | Gets your Loops user configuration. |
| `PATCH` | [`/v1/loops/user_config`](/reference/loops-api/server/update-your-loops-user-config) | Updates your Loops user configuration. |
