Prevents excessive API costs by blocking tool calls and model turns when a session's estimated usage exceeds a defined ceiling, ensuring predictable spending per session.
The agent configures the AgentBill MCP server as a ClawHub plugin within the OpenClaw environment. It sets a specific ceiling (in tokens or calls) for each session. Before every tool call or model turn, the agent checks the current running total plus an estimate of the next step against this ceiling. If the limit would be exceeded, the agent refuses the action, returning a refusal message to OpenClaw's gate hook. This ensures that no further resources are consumed in that session until the ceiling is raised or a new session is started.
- Category: Operations and infrastructure
- Effect: Read-only
- MCP servers: AgentBill MCP (https://koskamo.com/explore/agentbill-mcp)
- Source: OpenClaw spend limit: one ceiling per session, as a ClawHub plugin · AgentBill (https://agentbill.dev/integrations/openclaw)
- Source quote: "Before every tool call, and before every model turn on OpenClaw's embedded and CLI runners, the plugin asks AgentBill whether the session's running total plus an estimate of what comes next would pass it."
- Playbook page: https://koskamo.com/explore/use-cases/enforce-per-session-spend-limits-in-openclaw
Prompt: Configure the AgentBill plugin in OpenClaw to enforce a spend ceiling of 500,000 tokens per session. Ensure the 'allowConversationAccess' hook is enabled so that model turns are also checked against the limit, not just tool calls. Verify that the plugin correctly refuses calls with 'task_ceiling_exceeded' when the limit is reached.