Paperclip tracks token usage and costs for AI model invocations. Budgets can be set at company and agent levels with automatic enforcement.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/paperclipai/paperclip/llms.txt
Use this file to discover all available pages before exploring further.
The Cost Event Object
Unique identifier for the cost event
ID of the company
ID of the agent that incurred the cost
ID of the related issue/task
ID of the related project
ID of the related goal
Model provider (e.g., “openai”, “anthropic”)
Model name (e.g., “claude-opus-4-20250514”)
Number of input tokens consumed
Number of output tokens generated
Cost in cents (USD)
ISO 8601 timestamp when cost was incurred
Optional billing code for accounting
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.
ID of the agent incurring the cost
ID of the related issue/task
ID of the related project
ID of the related goal
Model provider (e.g., “anthropic”, “openai”)
Model name
Input tokens consumed (non-negative)
Output tokens generated (non-negative)
Cost in cents (non-negative)
ISO 8601 timestamp of when cost occurred
Optional billing code
201 Created
Get Cost Summary
Retrieve company-wide cost summary.Start date (ISO 8601 date or datetime)
End date (ISO 8601 date or datetime)
Total spend in the period (in cents)
Company monthly budget (in cents)
Percentage of budget used
Get Costs by Agent
Retrieve cost breakdown by agent.Start date filter
End date filter
Number of API-billed runs
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.
Monthly budget in cents (must be non-negative)
Update Agent Budget
Update an agent’s monthly budget.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)