Skip to content

Optional preflight policy decision (no reservation created)

POST
/v1/decide

Returns ALLOW / DENY, optionally with Caps for soft landing. This endpoint does not reserve budget. Clients that require concurrency safety MUST use /v1/reservations.
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.
DEBT/OVERDRAFT STATE (NORMATIVE): - If the subject scope has debt > 0 or is_over_limit=true, server SHOULD return decision=DENY with reason_code=DEBT_OUTSTANDING or reason_code=OVERDRAFT_LIMIT_EXCEEDED respectively. Server MUST NOT return 409 for these conditions on /decide.
Idempotency on /decide is for request deduplication only. A replayed ALLOW response reflects budget state at the time of the original call; clients MUST NOT treat a replayed decision as current budget authorization.

Authorizations

ApiKeyAuth
Type
API Key (header: X-Cycles-API-Key)

Parameters

Header Parameters

X-Idempotency-Key

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 payload (including any server-generated identifiers such as reservation_id).

Type
string
Min Length
1
Max Length
256

Request Body

application/json
JSON
{
  
"idempotency_key": "string",
  
"subject": "string",
  
"action": {
  
  
"kind": "string",
  
  
"name": "string",
  
  
"tags": [
  
  
  
"string"
  
  
]
  
},
  
"estimate": {
  
  
"unit": "string",
  
  
"amount": 0
  
},
  
"metadata": {
  
  
"additionalProperties": "string"
  
}
}

Responses

Decision result

application/json
JSON
{
  
"decision": "string",
  
"caps": {
  
  
"max_tokens": 0,
  
  
"max_steps_remaining": 0,
  
  
"tool_allowlist": [
  
  
  
"string"
  
  
],
  
  
"tool_denylist": [
  
  
  
"string"
  
  
],
  
  
"cooldown_ms": 0
  
},
  
"reason_code": "string",
  
"retry_after_ms": 0,
  
"affected_scopes": [
  
  
"string"
  
]
}

Playground

Authorization
Headers
Body

Samples

Powered by VitePress OpenAPI