API keys and service users
An API key lets the command-line tool, the SDKs or your own scripts use your organization. By default a key can do everything you can, in every sandbox, until you revoke it. Narrow it to what it needs.
Keys work only in the region that issued them, and are shown once.
Access
Section titled “Access”| Access | What the key can do |
|---|---|
| Read only | See sandboxes, their files, logs and conversations, and usage. Changes nothing, and opens no terminals. |
| Use sandboxes | Also run commands, open terminals, write files, take checkpoints, schedule tasks and talk to agents in existing sandboxes. |
| Create and use | Also create, copy and delete sandboxes, races and chat-app connections. |
| Full access | Everything, including organization settings: members, keys, models, single sign-on, webhooks. |
| Custom | Only the actions you choose. GET /v1/api-keys/actions lists them all. |
A key never does more than its holder. A member’s full-access key still can’t change organization settings, and an auditor’s key can’t change anything.
Limited to sandboxes
Section titled “Limited to sandboxes”A key limited to some sandboxes:
- sees only those sandboxes in the list;
- is refused for any other sandbox;
- can’t use organization-wide operations, such as creating a sandbox or reading usage.
That makes it a good fit for a CI job that only runs tests in one sandbox.
Expiry and rotation
Section titled “Expiry and rotation”Expiry. Set an expiry and the key stops working at that time.
Rotation. Rotating a key gives it a new secret and keeps everything else: its name, access and limits.
- The old secret stops at once, or keeps working for up to a day so your jobs can switch over.
- The key list shows when each key was last used, which helps you find keys that nothing uses any more.
Service users
Section titled “Service users”A service user is an account for automation, such as a deploy pipeline, that isn’t a person.
- Its keys keep working when people leave. A personal key stops when its owner leaves the organization.
- It has a role: member, or auditor for read-only jobs such as compliance exports.
- It doesn’t sign in or take a seat.
- Only owners create service users and their keys.
- Removing it stops its keys at once.
In the audit log, a service user’s actions show its key, with service:<id> as the account behind it.
In the console
Section titled “In the console”API keys:
- New key asks for the access level, the sandboxes and the expiry.
- Each key’s menu rotates or revokes it.
Service users are listed below the keys. Each one’s menu makes a key for it.
From the command line
Section titled “From the command line”stillbox keys create "CI tests" --access use --sandbox ws-abc123 --expires 90dstillbox keys create "Status page" --access custom --action listSandboxes --action agentStatusstillbox keys rotate tuuvhlm2a2zh --keep-old 1hstillbox service-users create "Deploy pipeline" --role memberstillbox keys create "Release job" --access create --service-user svc-…From the API
Section titled “From the API”curl -s -X POST https://api.global.stillbox.app/v1/api-keys \ -H "Authorization: Bearer $STILLBOX_API_KEY" -H "Content-Type: application/json" \ -d '{"name": "CI tests", "access": "use", "sandbox_ids": ["ws-abc123"], "expires_at": "2027-01-31T00:00:00Z"}'A request beyond a key’s access or sandboxes is refused with 403 and the code key_scope. The message says what
the key would need.