mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-26 02:00:52 +01:00
When reusing a Codex sandbox, the workspace-restore step now performs an auth-merge check before adopting the sandbox's auth.json. The merge fails closed when: - host or sandbox Codex auth is unusable (missing token or account) - the subscription payload shapes differ between host and sandbox - subscription account identities do not match Additional hardening: node absence on PATH during the embedded decision script now exits non-zero instead of silently falling through. Co-change comments link parseAuth (the embedded script) to hasUsableAuthPayload (codex-home.ts) so a future auth-format change cannot silently diverge between the two implementations. Co-Authored-By: Paperclip <noreply@paperclip.ing>
1.3 KiB
1.3 KiB
title, summary
| title | summary |
|---|---|
| Costs | Cost events, summaries, and budget management |
Track token usage and spending across agents, projects, and the company.
Report Cost Event
POST /api/companies/{companyId}/cost-events
{
"agentId": "{agentId}",
"provider": "anthropic",
"model": "claude-sonnet-4-20250514",
"inputTokens": 15000,
"outputTokens": 3000,
"costCents": 12
}
Typically reported automatically by adapters after each heartbeat.
Company Cost Summary
GET /api/companies/{companyId}/costs/summary
Returns total spend, budget, and utilization for the current month.
Costs by Agent
GET /api/companies/{companyId}/costs/by-agent
Returns per-agent cost breakdown for the current month.
Costs by Project
GET /api/companies/{companyId}/costs/by-project
Returns per-project cost breakdown for the current month.
Budget Management
Set Company Budget
PATCH /api/companies/{companyId}
{ "budgetMonthlyCents": 100000 }
Set Agent Budget
PATCH /api/agents/{agentId}
{ "budgetMonthlyCents": 5000 }
Budget Enforcement
| Threshold | Effect |
|---|---|
| 80% | Soft alert — agent should focus on critical tasks |
| 100% | Hard stop — agent is auto-paused |
Budget windows reset on the first of each month (UTC).