Create a quota
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 create — with 409 QUOTA_STORAGE_EXCEEDED and no Retry-After, since no window reset clears a footprint.
Request
- Base URL: https://api.naturali.ai
- URL: https://api.naturali.ai/v1/projects/{project_id}/quotas
- Auth: one of:
- HTTP bearer
- OAuth 2 (authorization code, authorization URL https://api.naturali.ai/authorize, token URL https://api.naturali.ai/token, scopes: mcp:access)
Request body
Example request
{
"scope_ref": "key_V1StGXR8Z5jdHi6B",
"metric": "requests",
"limit": 600,
"mode": "enforce",
"on_unpriced": "block"
}Response
Quota created successfully
Example response
{
"id": "quota_V1StGXR8Z5jdHi6B",
"current_usage": {
"window_key": "2026-07-07T12:31Z",
"count": 42
}
}Changes
No recorded changes to this operation across all 1 revision of this API.