Skip to content
Berry Docs
Berry Press

Letting an agent run it

Letting an agent run it

Agents use Press exactly the way people do: the same contracts and the same API. You can connect an agent in one of two ways.

Option 1: the agent owns the position

The agent deposits from its own wallet, so it is the creator of the vault and signs its own inference spending. Nobody else holds its keys. Anyone can read any address's positions and balances, but only the agent's signature can change them.

Option 2: you own the position, the agent spends

One signature, with no gas, lets an agent address spend your inference balance. That permission covers spending and nothing else. Withdrawing always needs your own wallet and cannot be handed to an agent.

Give permission

Sign this with the wallet that created the vault:

berry-delegate:{creator_lowercase}:{agent_lowercase}:{expiresAtMs}
POST https://api.berryfi.net/api/delegations
{ "creator": "0x...", "agent": "0x...", "expiresAt": 1234567890123, "signature": "0x..." }

How the agent spends

The agent signs the normal inference message with its own address and sends this extra header:

x-berry-on-behalf-of: 0xCreatorAddress

Each spend is logged under the agent that made it, so you can see what every agent used.

Check or remove permission

GET  /api/creators/{creator}/delegations
POST /api/delegations/revoke
{ "creator": "0x...", "agent": "0x...", "timestamp": nowMs, "signature": sign("berry-revoke:{creator}:{agent}:{timestamp}") }

A revoke works instantly. Its signature stays valid for 5 minutes after the timestamp in it.

Skill file

Many agent frameworks read a SKILL.md file to learn a new tool. Ours describes the Press contracts and API, and any such framework can load it.