Skip to content

Search guides, algorithms and the platform.

PlatformAPI tokens and the SDK

API tokens and the SDK

Scripts, agents and CI reach the platform with an API token. The Python SDK, platform_sdk, sends it for you.

Sign-in modes

The platform's PLATFORM_AUTH setting decides who can call it:

Mode Who can call Use it for
none Everyone, as the default team's admin One person's machine
token Holders of an API token, created by an admin A small team without an identity provider
oidc People signed in through your identity provider; API tokens keep working for scripts Teams with Okta or another OIDC provider

PLATFORM_ADMIN_TOKEN bootstraps the first admin in token mode. With oidc, set PLATFORM_OIDC_ISSUER, PLATFORM_OIDC_CLIENT_ID and PLATFORM_OIDC_AUDIENCE; the web app signs in with PKCE.

Roles

Roles, lowest to highest:

Role Can
viewer Read everything the team can see
member Start sessions and record episodes, run experiments and evals
admin Manage members, API tokens and quotas

A person's role comes from their membership, if an admin set one, else from the identity provider's groups through PLATFORM_OIDC_ROLE_MAP (for example platform-admins=admin), else member.

Create a token

Admins create tokens on the Team page, or through the API. Tokens start with spt_, belong to a team and carry a role. The secret is shown once, when the token is created: copy it then.

Terminal
curl -X POST "$PLATFORM_URL/v0/tokens" \
  -H "Authorization: Bearer $PLATFORM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "ci", "role": "member"}'

List them with GET /v0/tokens and revoke one with DELETE /v0/tokens/{token_id}.

Use a token from Python

Pass the token to connect, or set PLATFORM_TOKEN (and PLATFORM_TEAM in managed mode) and leave it out:

python
import platform_sdk

with platform_sdk.connect("cartpole", url="https://platform.example.com", token="spt_...") as env:
    obs, info = env.reset(seed=0)
    obs, reward, terminated, truncated, info = env.step(env.action_space.sample())

Every request then carries Authorization: Bearer spt_.... The same header works with curl and any HTTP client.

Usage and quotas

Admins see usage on the Usage page: instance-hours per environment, with a CSV export for invoicing. Quotas limit each team's concurrent sessions, GPU sessions and instance-hours a month, and are checked when a session starts.

Endpoint Returns
GET /v0/me Who you are, your team and role
GET /v0/usage Usage, as JSON or CSV
GET /v0/members The team's members
GET /v0/teams Teams, in managed mode
PUT /v0/teams/{team_id}/quotas Set a team's quotas