Keys and spending limits
Give each agent its own key, limit what it reaches and spends, and see everything it did.
Agents work fast. Keys are how you stay in charge: one per agent or script, each with only the reach and budget it needs.
Kinds of key
| Key | Reaches | Make it on |
|---|---|---|
Workspace key (ocp_…) | Everything in the workspace. | API keys page → Create an API key |
App key (ocps_…) | One app, or one database, bucket or email service in it. | The app's Settings tab → Create key |
An app key can also be read-only: it can look at everything it reaches, but change nothing. Good for an agent that writes reports.
A key is shown once, when it's made. Treat it like a password: keep it in your agent's settings or an environment variable, never in shared code. Owners and admins manage keys.
Spending limits
Any key can have a spending limit in US dollars. What counts is what the key itself caused: sandboxes it started and email it sent.
At the limit:
- Changes are refused with
402 key_spend_limit_reached, and the key's sandboxes are stopped. - Reading still works, so the agent can still tell you what happened.
- Raise or remove the limit and it carries on.
Set a limit when you make a key, or later with Limit on the API keys page. The page shows what each key has spent, like "$3.10 spent of $5.00".
Activity log
Every change a key makes is written down in plain words: "Deployed code", "Started a sandbox", "Ran SQL on a database". Each entry shows when, which app, whether it worked, failed or was refused, and whether an AI agent did it over MCP. What was sent is never recorded.
Open it with Activity next to a key on the API keys page, or next to an app key on the app's Settings tab.
Revoking
Revoke a key from the same places and it stops working at once. When you remove someone from the workspace, the Members page offers to revoke the keys they made too.
For agents
Over MCP, deleting tools are marked as such, so agents like Claude Code ask you before running them. And the server tells every agent that when its key reaches a limit, it should stop and tell you. See Connect an AI agent.
opencloudport