API keys
API keys authenticate calls to the Inspect API and Inspect MCP. Inspect has two kinds.
Personal keys start with riu_.
- Act as you, with your roles and repository access.
- Open pull requests under your GitHub account.
- Any member can create them.
- Each person can have any number of named keys.
- The only option is a name.
- Revoked automatically when unused for 21 days.
Manage keys at Settings → API keys. People with Manage API keys also see everyone's personal keys under User keys and the organization's system keys under System keys.
Create a personal key
- Open Settings → API keys and choose Create API key.
- Enter a Key name that says where the key is used, then choose Generate key.
- Copy the key. Inspect shows it once and stores only a hash.
Send it as a bearer token:
Authorization: Bearer riu_...A personal key can do what you can. If you haven't linked a GitHub account, your keys are read-only too. Keep keys in a secret manager, and never put them in browser code, logs, or source control.
Create a system key
Use a system key for an integration that shouldn't depend on one person's account. Under System keys, create a key and set:
- Read-only: sessions can read data but not make changes. Write requests fail with
403 read_only_api_key. - Allowed repositories: the key can only work in these repositories. Requests for others fail with
403 repository_not_allowed. Leave it empty to allow every repository. - Tags: labels you can filter system keys by.
Scopes
When API key scopes are available for your organization, you can limit what a personal or system key can call. Under Permissions, choose Selected resources, then add a row for each resource the key needs with Read or Write access. Write also grants Read. Each endpoint in the API reference lists the scope it requires, such as sessions:read or previews:write. Keys set to All endpoints can call every endpoint.
Rotate and revoke
Rotate replaces a key's secret and keeps its name and settings. The old value stops working immediately, so update the integration right after rotating. Rotating a personal key also resets its last-used time.
Revoke deletes a key permanently. People with Manage API keys can revoke anyone's personal key and delete system keys.
Deactivating a person stops all of their keys, because Inspect only authenticates keys whose owner is active.
Every create, rotate, and revoke is recorded in the audit log with the key's prefix.
Automatic revocation
Once a day, Inspect revokes personal keys that haven't been used for 21 days, or were never used and are older than 21 days. Inspect updates a key's last-used time at most every 5 minutes. System keys are never revoked this way. People with Manage API keys can run the same cleanup on demand.
IP allowlist
When the API key IP allowlist is available for your organization, people with Manage security can restrict where keys work from under API key IP allowlist at Settings → Security. Each entry has a Name, the IP addresses or CIDR ranges it allows, and Applies to: All API keys, Personal keys, or System keys.
- A key type that no entry applies to works from any address.
- A key type that one or more entries apply to works only from addresses in those entries.
- Changes reach every request within about 30 seconds and are recorded as
api_key_ip_allowlist.updated.
Requests from other addresses fail with 403 api_key_ip_not_allowed. Add the address to the allowlist, or call from an allowed network.
Troubleshooting
The header doesn't contain a complete key. Check for truncation or a missing Bearer prefix.
The key was revoked, rotated, or automatically revoked after 21 days unused. Create or rotate a key.