rig CLI is the primary way to authenticate. Run rig login once and every subsequent command (including raw rig api calls) reuses your stored credentials — no headers to manage.
Log in with the CLI
rig login stops and names what works instead: set RIG_API_KEY for each command (it isn’t saved), or pipe the key to rig login --import-token, which validates and saves it. Only a key the server rejects is reported as invalid; if the server can’t be reached, the error says so.
Signing in also sets up SSH access from this machine. Inside a workspace you don’t sign in: the CLI there already acts as the workspace, and rig login and rig logout refuse.
Once logged in, any command works without further setup, for example:
API keys
For GitHub deployments, use GitHub Actions OIDC credentials. For other backend services or agents that need account API access, create an API key. API keys (rb_…) are full-account credentials, shown once at creation and stored hash-only. Create one from the dashboard under Settings → API Keys, or with the CLI:
rb_ prefix in a Bearer header:
Raw API access
To hit any endpoint directly without managing headers, userig api. It reuses your stored credentials and sends an authenticated request:
--body takes inline JSON, a path to a JSON file, or - to read standard input; a body that isn’t valid JSON fails before anything is sent. When the server returns an error, rig api prints the response body as the server sent it, reports the HTTP status, and exits non-zero. With --output json, the error event carries status and body alongside code and message. Inside a workspace, rig api sends requests through the workspace bridge, which serves only that workspace’s routes.
Bearer tokens (JWT)
If you authenticate through the dashboard login flow, you receive a short-lived JWT. The dashboard handles refresh automatically — for terminal use, preferrig login (which manages the token for you) or an API key for non-interactive clients.
CLI session approval (rig login)
When you run rig login on your local machine, the CLI walks you through a browser-approval device flow rather than asking for credentials at the prompt. The flow uses three endpoints:
The approval step rotates a single canonical
"CLI login" API key: any prior CLI-login key on your account is revoked before a fresh one is issued. The new key is returned to the polling CLI and written to ~/.config/rigbox/config.json.
If you want a long-lived key that survives re-logging in (e.g. for a CI runner or a second laptop), create it explicitly under Settings → API Keys instead of relying on the
rig login slot.Dashboard session tokens
The Rigbox frontends (rigbox.dev, clawd.rigbox.dev, sandbox.rigbox.dev) handle authentication automatically. Session tokens are managed by the dashboard - no extra setup needed for first-party UIs.
Choosing an auth method
Public endpoints
These endpoints do not require authentication:GET /capacity- check platform availabilityGET /templates- list available workspace templates
Private app authentication (X-Rigbox-Key)
When an app’s visibility is set to private or privileged, requests from outside the workspace must include anX-Rigbox-Key header. This is separate from the Authorization header used for the main API.
Use an API key authorized to access the target app; a valid key for another owner is not sufficient:
Requests made from inside the workspace (e.g. between services on
localhost) do not need this header. It is only required for requests arriving from the public internet.