Baseten
Connect
Connect Baseten from the terminal. Pass --help for the flags Baseten accepts, plus --no-browser for headless environments.
polylane cloud connect --provider basetenOne Baseten API key that reaches every team you want Polylane to watch, from Organization settings, API keys.
Connect one Baseten organization with an API key. Polylane encrypts the key before it stores it, and the agent never sees it.
One connection covers one Baseten organization. Use a key that reaches every team that you want Polylane to watch.
If your organization has one team:
- In Baseten, open Organization settings → API keys and choose Create API key.
- Select Team, set Expiration to Never if your organization allows it, and choose Next.
- Under Permissions, select Full access to all team models.
- Copy the key and paste it in Polylane.
If your organization has more than one team: a team API key reaches only its own team. Use the personal API key of an organization admin, which reaches every team. A personal key has an expiration date, so set a reminder and choose Reconnect in Polylane with a new key before it expires.
Polylane checks the key, records the teams that it reaches, and starts the first sync. When you change the key later, Polylane refuses a key that reaches fewer of those teams.
Connect Baseten from a CI job or any other environment without a browser.
You can connect Baseten without a browser. A CI job can call the same endpoint that the console calls. One authenticated POST creates the connection and starts the first sync.
Prerequisites
- A Polylane API key with the
cloud_accounts:writeandcloud_accounts:readscopes. See API keys and OAuth. - Your workspace ID, which starts with
ws_. Read it fromGET /v1/workspaceswith the same key. - A Baseten team API key with Full access to all team models, created under Organization settings → API keys in Baseten.
Create the connection
curl -X POST https://api.polylane.com/v1/cloud_accounts \
-H "x-api-key: $POLYLANE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "baseten",
"workspaceId": "ws_0abc123",
"token": "<baseten-api-key>"
}'
One call connects one Baseten organization.
The response lists the connected accounts, and the first sync is already running. This example shows only the two fields that the next steps read:
{
"success": true,
"result": {
"provider": "baseten",
"accounts": [{ "id": "acc_34gky74ibc92h8t2efn8csrh", "status": "syncing" }],
"failures": []
}
}
An organization that is already connected goes into failures, not accounts. A repeated call never makes a second connection.
Wait for the first sync
Poll each returned account by its id until status is ready. The status is new at registration and syncing while resources arrive:
until [ "$(curl -s "https://api.polylane.com/v1/cloud_accounts/$WORKSPACE_ID/$ACCOUNT_ID" \
-H "x-api-key: $POLYLANE_API_KEY" | jq -r '.result.status')" = "ready" ]; do
sleep 15
done
Give the loop a deadline, so that a failed connection fails the job and does not stop it indefinitely. When the account is ready, its resources are in the topology and Polylane has started its first check.
Disconnect from the API
Deleting the connection stops every sync and check and deletes the credentials that Polylane held. The call needs the cloud_accounts:delete scope:
curl -X DELETE "https://api.polylane.com/v1/cloud_accounts/$WORKSPACE_ID/$ACCOUNT_ID" \
-H "x-api-key: $POLYLANE_API_KEY"
Then revoke the Baseten API key, as the Disconnecting section tells.
How it works
Access
Polylane only reads from Baseten. Baseten has no read-only key for its Management API, so the key must have Full access to all team models. Sandbox reads need a short-lived sandbox token. Polylane gets this token from the API key when a read needs it, keeps it in memory for at most two hours, and does not store it. Polylane never reads the values of sandbox environment variables.
Infrastructure graph
Polylane syncs the organization every 15 minutes. It maps:
- The serverless inference API (
inference.baseten.co) and each Model API that your organization added, such as a DeepSeek or GLM model. - Each dedicated model, with its environments and the deployments that they serve, and the development deployment.
- Each chain, with its environments and the chainlets of its production deployment.
- Each sandbox, sandbox image and sandbox volume.
A service elsewhere in your stack that calls Baseten links to the resource that it calls. A model-<id>.api.baseten.co URL links to that model, and a chain-<id>.api.baseten.co URL links to that chain. A service that sets only BASETEN_API_KEY links to the serverless inference API.
A model shows the traffic of its production environment. Other environments and the development deployment are not production. Polylane maps them, and checks them only when you turn on non-production monitoring in the account settings.
Metrics and logs
Each model, environment and deployment charts requests, server and client errors, p50, p95 and p99 latency, time to first byte, active and starting replicas, concurrent requests, CPU, memory, GPU utilization, GPU memory, container restarts and the async queue. Each Model API charts requests, server errors, rate-limited requests, client errors and tokens. The serverless inference API charts requests and tokens across every Model API. Each sandbox charts requests, CPU and memory.
Models, environments, deployments, chainlets and sandboxes show their logs. Sandbox images show their build logs. Baseten has no log API for Model APIs or the serverless inference API, so those resources show metrics only.
Checks
By default, Polylane runs these checks:
- The share of 5xx responses on each production model, compared with its history.
- The p95 latency of each production model, compared with its history.
- Replica startups that are slower than usual for the model, or that fail.
- A deployment that an environment serves and that is in a failed or unhealthy state.
- The share of error responses on each Model API.
- A spike or a drop in requests on each Model API.
- The share of error responses on each sandbox.
Investigations
During an investigation, agents use read-only tools for Baseten. The section "What agents read" lists each tool.
What agents read
| Tool | What it reads |
|---|---|
basetenApi | GET requests to the Baseten Management API, such as models, deployments, environments, chains, Model APIs and sandboxes. Polylane refuses requests for secret values, preview tokens and model source downloads. |
basetenLogs | Logs of a model, environment, deployment, chainlet or sandbox, and the build logs of a sandbox image, with level, text, replica and request ID filters. |
basetenMetrics | Metrics of a model, environment, deployment, Model API or sandbox, as a series or as one summary for a time window. |
basetenStartups | Replica startups of a model, environment or deployment, with the time of each startup phase, and a summary of startup durations. |
basetenModelApiUsage | Model API requests and tokens in time buckets, by model, team, user or API key prefix. |
cloudGetAuditLogs | The Baseten audit log. The key must have permission to read the audit log. |
Troubleshooting
"Baseten does not recognize this API key" error
- Make sure that you copied the full key and that it is not revoked or expired under Organization settings → API keys.
"This Baseten API key cannot read the organization" error
- Use a key with Full access to all team models, or the personal API key of an organization admin.
"This API key reaches fewer Baseten teams than the connected key" error
- The new key would stop Polylane from reading some teams. Use a key that reaches every team that the connection reads, such as the personal API key of an organization admin.
"This Baseten organization is already connected" error
- One connection covers the whole organization. Open the connection, choose Reconnect, and paste a key that reaches every team that you want Polylane to watch.
Missing resources
- A team API key reads only its team. To watch more teams, choose Reconnect and paste a key that reaches every team, such as the personal API key of an organization admin.
- The first sync can take a few minutes.
- Click Sync in the account header to start a sync immediately.
Disconnecting
Disconnecting stops every sync and check, and deletes the key that Polylane stored. The API key stays valid in Baseten. Revoke it under Organization settings → API keys in Baseten.
Disconnect
Disconnecting stops every sync and check and deletes the credentials Polylane held. Polylane removes what Baseten's API lets it remove. The following stays until you remove it yourself:
- Baseten API key
polylane cloud disconnect <id>Tools
5Operations agents can perform in threads.
Supported resources
11Resource types that show up in your infrastructure graph.