---
title: "Record Haiku Spend"
method: POST
path: "/api/system/haiku-spend"
tags: ["system"]
---

# Record Haiku Spend

`POST /api/system/haiku-spend`

## Request

- Base URL: `https://api.pigeonly.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pigeonly.com/api/system/haiku-spend`
- Auth: none declared

Record one UTC day's Haiku spend (kind `haiku_spend.day_reported`, business_events ledger).

Refuses a day that has not started yet (UTC): the figure for a day is only final once that day has ended, and the
poster reports the previous day. A later post for the same day is a new event; the read takes the latest per day,
so a corrected figure replaces the old one and the history stays. Read by `rooster/ai_accounts.py` (`haiku_api`).

## Request body

- RecordHaikuSpendRequest: One UTC day's Haiku API spend, posted by the Mac that runs the build swarm (open item CSB-OPEN-5). Whose rule: the owner's "yes" (sweep-6 CSB-OPEN, 2026-11-16): the Mac posts one figure a day. The figure is the gatekeeper's settled spend for that UTC day (`~/damien/state/haiku-proxy/spend.json`), in US dollars as a decimal string (never a float: rounding must not be taken for the company's own figure). Not integer cents: this is API spend the Mac measured, not money moved, so `business_events.amount_cents` stays None.
  - `day` string, date, required
  - `total_usd` union, required
    - number
    - string
  - `requests` integer, required

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

## Changes

- **2026-11-20** `03a3c6737898`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/changes/api/system/haiku-spend/post.md)

---

[API](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os.md) - [All operations](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/llms.txt) - [OpenAPI document](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/revisions/14571c4b7007?raw)
