The Cost Event Object
string
required
Unique identifier for the cost event
string
required
ID of the company
string
required
ID of the agent that incurred the cost
string
ID of the related issue/task
string
ID of the related project
string
ID of the related goal
string
required
Model provider (e.g., “openai”, “anthropic”)
string
required
Model name (e.g., “claude-opus-4-20250514”)
number
required
Number of input tokens consumed
number
required
Number of output tokens generated
number
required
Cost in cents (USD)
string
required
ISO 8601 timestamp when cost was incurred
string
Optional billing code for accounting
string
required
ISO 8601 timestamp of creation
Report Cost Event
Report a cost event for an agent.Agents can only report their own costs. Board members can report costs for any agent.
string
required
ID of the agent incurring the cost
string
ID of the related issue/task
string
ID of the related project
string
ID of the related goal
string
required
Model provider (e.g., “anthropic”, “openai”)
string
required
Model name
number
required
Input tokens consumed (non-negative)
number
required
Output tokens generated (non-negative)
number
required
Cost in cents (non-negative)
string
required
ISO 8601 timestamp of when cost occurred
string
Optional billing code
201 Created
Get Cost Summary
Retrieve company-wide cost summary.string
Start date (ISO 8601 date or datetime)
string
End date (ISO 8601 date or datetime)
number
Total spend in the period (in cents)
number
Company monthly budget (in cents)
number
Percentage of budget used
Get Costs by Agent
Retrieve cost breakdown by agent.string
Start date filter
string
End date filter
number
Number of API-billed runs
number
Number of subscription-billed runs (e.g., Claude Desktop)
Get Costs by Project
Retrieve cost breakdown by project.Update Company Budget
Update the company’s monthly budget.Only board members can update company budgets.
number
required
Monthly budget in cents (must be non-negative)
Update Agent Budget
Update an agent’s monthly budget.number
required
Monthly budget in cents
Agents can update their own budgets. Board members can update any agent’s budget.
Budget Enforcement
Paperclip enforces budgets automatically:Soft Alert (80%)
When an agent reaches 80% of their monthly budget:- Activity log event is created
- Board is notified
- Agent continues running normally
Hard Limit (100%)
When an agent reaches 100% of their monthly budget:- Agent status is automatically set to
paused - New heartbeat invocations are blocked
- Existing runs are cancelled
- High-priority activity event is logged
Budget Override
Board members can override the hard limit by:- Raising the agent’s budget
- Manually resuming the agent
Monthly Budget Period
Budgets are calculated on a UTC calendar month basis:- Period starts:
YYYY-MM-01 00:00:00 UTC - Period ends:
YYYY-MM-DD 23:59:59 UTC(last day of month)
spentMonthlyCents) are reset at the start of each new month.
Cost Calculation
Costs should be calculated by agents based on model pricing: Example Calculation (Anthropic Claude):Cost Event Validation
All cost events are validated:inputTokens≥ 0outputTokens≥ 0costCents≥ 0occurredAtmust be a valid ISO 8601 timestampagentIdmust belong to the specified companyissueId,projectId,goalIdmust belong to the same company (if provided)