Create a quota
POST/api/v1/quotas
Creates a project-scoped quota. requests is valid for scope: project/api_key; tokens and cost_usd are valid for scope: project/agent/actor; storage_bytes is valid for scope: project only. Any other scope/metric pair is rejected with 400 (no attribution exists to enforce it). An actor quota caps one end user's spend, matched from the generation's session; a null scope_ref means one budget per actor rather than a pooled project total. A cost_usd quota may name one meter_type to cap; omitting it caps every priced meter. A duplicate quota (same project, scope, scope_ref, metric, window, meter_type) is rejected with 409.
storage_bytes caps a stored total rather than a windowed one, so it takes window: current and every other metric refuses that value (400 either way). It is enforced at the corpus write paths — file upload and create, document create, document ingest and re-ingest, memory-entry create — with 409 QUOTA_STORAGE_EXCEEDED and no Retry-After, since no window reset clears a footprint.
Request
Responses
- 201
- 400
- 401
- 403
- 409
- 500
Quota created successfully
Bad request (invalid scope/metric/window/mode/limit)
Unauthorized
Forbidden
A matching quota already exists
Internal server error