Service keys
A service key is for your own application, server to server. A person using the CLI or an assistant through MCP logs in with Keycloak, not with a key.
curl -s https://api.prudai.com/v1/account \ -H "Authorization: Bearer prudai_sk_live_..."Environments
Section titled “Environments”| Prefix | Works on | Data |
|---|---|---|
prudai_sk_live_ | https://api.prudai.com/v1 | production |
prudai_sk_test_ | https://api.staging.prudai.com/v1 | staging, test data |
A key on the wrong environment gets 401 key_environment_mismatch.
Properties
Section titled “Properties”- One organisation. The organisation comes from the key, never from the request.
- Scopes. A key can only do what is on the key. Compose it per product, object and verb. See Scopes and permissions.
- Expiry. Optional expiry date; afterwards
401 api_key_expired. - IP list. Optional; other addresses get
403 ip_not_allowed. - Writing waits for a person. A write scope on a key does not skip the approval.
Creating, rotating, revoking
Section titled “Creating, rotating, revoking”You do that in the Prudai Console, under Keys. Through the API and the CLI (prudai keys) it is coming soon.
- You see the full key once. Prudai stores only a hash.
- Rotating gives a new key; you see the new value once.
- Revoking works immediately; afterwards
401 api_key_revoked.
Never put a key in frontend code or in a repository.