Skip to main content
An agent key (lcac_…) lets one agent runtime call Locus tools within limits you set. Use it for hosted agents and background services that run without you. The API and SDK call it an Agent Connection.

How it works

You create the key from the dashboard or your backend, and decide what it may do. The agent uses only that key. On every call, Locus checks the key’s tools and budget before anything runs or is charged.
  • An agent key can call tools. It can’t manage your workspace settings or keys.
  • It spends from your pooled balance, or from one customer’s balance.
  • If you use the agent yourself in a client with browser sign-in, OAuth is simpler.
Keep your lcr_… secret key on your server. Give the agent a scoped lcac_… agent key. Store keys in a secret manager, never in source control.

Create an agent key

To create a key, dashboard users must be an owner or admin and complete recent MFA or passkey verification. A server key needs both credentials:manage and credits:move.
1

Start a new key

Open Connect → API keys, select Create key, and choose An agent.
2

Choose what it can do

Pick a tool set, the account it spends from, its spending limits, and when it expires. One end user lets you pick an existing end-user ID or type a new one.
3

Save it securely

Locus shows the key and a ready-to-use MCP configuration. Store the key right away; it is shown only on creation and rotation.

What you choose

End-user agent keys can also carry their own pricing overrides.
Leaving out the tool list allows every tool your workspace has enabled. An empty list allows none. Creating a key never turns on custom APIs or the always-on Recipe routes; they keep their own settings.

What you can change later

The account is fixed when you create the key. The tool list can grow in two ways: approve a tool access request the agent sends, which adds that tool to the key, or move the key onto another tool set through the API. To change anything else, create a replacement key.

Agent key configuration

Set LOCUS_AGENT_CONNECTION to the saved lcac_… key, then add it to your client as a bearer token.
Add to ~/.codex/config.toml:
~/.codex/config.toml
Hosted model APIs have their own authorization fields. See Framework integrations. The Locus CLI also accepts an agent key.

Agent key scope and budgets

A per-call limit caps each charge. A per-run limit (maxCreditsPerLoop) caps a whole agent run. To use a run budget, give every paid call in the run the same loop ID. Calls that run at the same time share the budget. Start a new loop ID only for a new run.

Rotate or revoke an agent key

Manage agent keys in Connect → API keys, where their type shows as Agent. You can also use the SDK:
Rotate or revoke
  • Rotate issues a new key with the same scope. The old key stops working at once.
  • Revoke is immediate and permanent. A server key needs only credentials:manage to revoke.
For secret and publishable keys, see Key lifecycle.

Next steps

Framework integrations

Use the key from your model SDK or agent framework.

Paid tool calls

See how price caps, approvals, and retries work.

Node SDK

Create and manage agent keys from your server.

Troubleshoot a connection

Fix sign-in, scope, and budget errors.