Optional post-only accounting when pre-estimation is not available
Records an accounting event without a reservation. This endpoint is optional in v0 deployments. The event MUST be applied atomically across all derived scopes before the server returns 201. IDEMPOTENCY (NORMATIVE): - On replay with the same idempotency_key, the server MUST return the original successful response payload. TENANCY (NORMATIVE): - subject.tenant MUST match the effective tenant derived from auth; otherwise the server MUST return 403 FORBIDDEN.
Request
- Base URL: https://api.cycles.local
- URL: https://api.cycles.local/v1/events
- Auth: API key in header X-Cycles-API-Key
Headers
Optional idempotency key header. If both header and body idempotency_key are provided, they MUST match. Server MUST enforce idempotency per endpoint by (effective tenant, endpoint, idempotency_key). On replay of an idempotent request that previously succeeded, server MUST return the original successful response outcome and payload (including any server-generated identifiers such as reservation_id), except that remaining_ttl_ms on a replayed createReservation or extendReservation success is a volatile response observation and is not part of the attested CyclesEvidence payload. When emitted, it MUST be recomputed from the original expires_at_ms and the current authoritative server time, never copied from the stored response; it MUST be 0 if the reservation is no longer ACTIVE. All other fields replay verbatim.
Request body
Example request
{
"actual": {
"unit": "USD_MICROCENTS",
"amount": 500000
}
}Response
Event created and atomically applied to balances
Example response
{
"charged": {
"unit": "USD_MICROCENTS",
"amount": 500000
},
"balances": [
{
"scope": "tenant:acme-corp/workspace:prod",
"scope_path": "tenant:acme-corp/workspace:prod",
"remaining": {
"unit": "USD_MICROCENTS",
"amount": 4577000
},
"reserved": {
"unit": "USD_MICROCENTS",
"amount": 500000
},
"spent": {
"unit": "USD_MICROCENTS",
"amount": 423000
},
"allocated": {
"unit": "USD_MICROCENTS",
"amount": 5500000
}
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.