Monitor Paperclip costs and budgets — view spending summaries and breakdowns, set budget policies with hard stops, and resolve budget incidents.
name paperclip-manage-costs description Monitor Paperclip costs and budgets — view spending summaries and breakdowns, set budget policies with hard stops, and resolve budget incidents. Paperclip Cost and Budget Management This skill covers monitoring LLM spend across agents, projects, and providers, setting budget policies with hard stops or warnings, and resolving budget incidents when limits are hit. Prerequisites Board operator access with local_trusted mode COMPANY_ID env var set (or pass -C $COMPANY_ID to CLI commands) BASE defaults to http://localhost:3100 — override via PAPERCLIP_API_URL export BASE= ${PAPERCLIP_API_URL:-http://localhost:3100} export CID= $COMPANY_ID Cost Summaries Total Spend
curl -s " $BASE /api/companies/ $CID /costs/summary" | jq '.'
curl -s " $BASE /api/companies/ $CID /costs/summary?from=2024-01-01&to=2024-01-31" | jq '.' Breakdowns
curl -s " $BASE /api/companies/ $CID /costs/by-agent" | jq '.'
curl -s " $BASE /api/companies/ $CID /costs/by-agent-model" | jq '.'
curl -s " $BASE /api/companies/ $CID /costs/by-provider" | jq '.'
curl -s " $BASE /api/companies/ $CID /costs/by-biller" | jq '.'
curl -s " $BASE /api/companies/ $CID /costs/by-project" | jq '.' Budget Tracking Windows
curl -s " $BASE /api/companies/ $CID /costs/window-spend" | jq '.'
curl -s " $BASE /api/companies/ $CID /costs/quota-windows" | jq '.' Finance Summary
curl -s " $BASE /api/companies/ $CID /costs/finance-summary" | jq '.'
curl -s " $BASE /api/companies/ $CID /costs/finance-by-biller" | jq '.'
curl -s " $BASE /api/companies/ $CID /costs/finance-by-kind" | jq '.'
curl -s " $BASE /api/companies/ $CID /costs/finance-events" | jq '.'
curl -s " $BASE /api/companies/ $CID /costs/finance-events?from=2024-01-01&to=2024-01-31&limit=50" | jq '.'
curl -s -X POST
"
$BASE
/api/companies/
$CID
/finance-events"
-H
"Content-Type: application/json"
-d
'{
"kind": "credit",
"amountCents": 10000,
"description": "Manual credit adjustment",
"occurredAt": "2024-01-15T00:00:00Z"
}'
| jq
'.'
Recording Cost Events
curl -s -X POST
"
$BASE
/api/companies/
$CID
/cost-events"
-H
"Content-Type: application/json"
-d
'{
"agentId": "agent-uuid-here",
"provider": "anthropic",
"model": "claude-opus-4-5",
"inputTokens": 1500,
"outputTokens": 300,
"costCents": 12,
"occurredAt": "2024-01-15T10:30:00Z"
}'
| jq
'.'
Budget Policies
View Budget Overview
curl -s " $BASE /api/companies/ $CID /budgets/overview" | jq '.' Update Company and Agent Monthly Budgets
curl -s -X PATCH
"
$BASE
/api/companies/
$CID
/budgets"
-H
"Content-Type: application/json"
-d
'{"budgetMonthlyCents": 50000}'
| jq
'.'
curl -s -X PATCH
"
$BASE
/api/agents/
$AGENT_ID
/budgets"
-H
"Content-Type: application/json"
-d
'{"budgetMonthlyCents": 10000}'
| jq
'.'
Create or Update a Budget Policy
curl -s -X POST
"
$BASE
/api/companies/
$CID
/budgets/policies"
-H
"Content-Type: application/json"
-d
'{
"scopeType": "company",
"scopeId": null,
"metric": "cost_cents",
"windowKind": "calendar_month_utc",
"amount": 50000,
"warnPercent": 80,
"hardStopEnabled": true,
"notifyEnabled": true,
"isActive": true
}'
| jq
'.'
curl -s -X POST
"
$BASE
/api/companies/
$CID
/budgets/policies"
-H
"Content-Type: application/json"
-d
'{
"scopeType": "agent",
"scopeId": "'
$AGENT_ID
'",
"metric": "cost_cents",
"windowKind": "calendar_month_utc",
"amount": 10000,
"warnPercent": 75,
"hardStopEnabled": true,
"notifyEnabled": true,
"isActive": true
}'
| jq
'.'
curl -s -X POST
"
$BASE
/api/companies/
$CID
/budgets/policies"
-H
"Content-Type: application/json"
-d
'{
"scopeType": "project",
"scopeId": "'
$PROJECT_ID
'",
"metric": "cost_cents",
"windowKind": "lifetime",
"amount": 200000,
"warnPercent": 90,
"hardStopEnabled": false,
"notifyEnabled": true,
"isActive": true
}'
| jq
'.'
Valid
scopeType
values:
company
,
agent
,
project
Valid
windowKind
values:
calendar_month_utc
,
lifetime
Resolving Budget Incidents
When a hard stop fires, affected agents are paused and an incident is created.
curl -s " $BASE /api/companies/ $CID /budgets/overview" | jq '.incidents'
curl -s -X POST
"
$BASE
/api/companies/
$CID
/budget-incidents/
$INCIDENT_ID
/resolve"
-H
"Content-Type: application/json"
-d
'{"action": "acknowledge", "decisionNote": "Noted — reviewing spend"}'
| jq
'.'
curl -s -X POST
"
$BASE
/api/companies/
$CID
/budget-incidents/
$INCIDENT_ID
/resolve"
-H
"Content-Type: application/json"
-d
'{
"action": "raise_budget_and_resume",
"amount": 75000,
"decisionNote": "Approved extra $250 for sprint completion"
}'
| jq
'.'
curl -s -X POST
"
$BASE
/api/companies/
$CID
/budget-incidents/
$INCIDENT_ID
/resolve"
-H
"Content-Type: application/json"
-d
'{"action": "dismiss", "decisionNote": "Agent work is done — no resume needed"}'
| jq
'.'
Workflow: Check Monthly Spending
Get the overall summary for this month
FROM=$(
date
-u +%Y-%m-01T00:00:00Z)
TO=$(
date
-u +%Y-%m-%dT%H:%M:%SZ)
curl -s
"
$BASE
/api/companies/
$CID
/costs/summary?from=
$FROM
&to=
$TO
"
| jq
'{totalCostCents, totalInputTokens, totalOutputTokens}'
Break down by agent to find top spenders
curl -s
"
$BASE
/api/companies/
$CID
/costs/by-agent?from=
$FROM
&to=
$TO
"
|
jq
'sort_by(-.costCents) | .[0:5] | [.[] | {agentId, costCents}]'
Break down by provider to see where tokens are going
curl -s
"
$BASE
/api/companies/
$CID
/costs/by-provider?from=
$FROM
&to=
$TO
"
| jq
'.'
Workflow: Set Up Budget Hard Stop
Check current budget overview
curl -s
"
$BASE
/api/companies/
$CID
/budgets/overview"
| jq
'{policies: (.policies | length), activeIncidents: (.incidents | length)}'
Create a company-level hard stop policy
curl -s -X POST
"
$BASE
/api/companies/
$CID
/budgets/policies"
-H
"Content-Type: application/json"
-d
'{
"scopeType": "company",
"scopeId": null,
"metric": "cost_cents",
"windowKind": "calendar_month_utc",
"amount": 50000,
"warnPercent": 80,
"hardStopEnabled": true,
"notifyEnabled": true,
"isActive": true
}'
| jq
'{id, scopeType, amount, hardStopEnabled, isActive}'
Verify the policy appears in the overview
curl -s
"
$BASE
/api/companies/
$CID
/budgets/overview"
| jq
'.policies'
Check current-window spend against the new limit
curl -s
"
$BASE
/api/companies/
$CID
/costs/window-spend"
| jq
'.'