API referenceSpend policies
POST /spend-policies
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://example.com/spend-policies" \ -H "Content-Type: application/json" \ -d '{ "limitUsd": 0.1, "name": "string", "rungs": [ { "action": "string", "at_percent": 0 } ], "windowType": "daily" }'{ "$schema": "https://example.com/schemas/Policy.json", "apiKeyId": "string", "appId": "string", "cooldownMins": 0, "createdAt": "string", "currentSpendUsd": 0.1, "destination": "string", "destinationType": "string", "enabled": true, "environmentId": "string", "limitUsd": 0.1, "model": "string", "name": "string", "policyId": "string", "provider": "string", "rungs": [ { "action": "string", "at_percent": 0, "block_mode": "string", "fallback_model": "string" } ], "tagKey": "string", "tagValue": "string", "updatedAt": "string", "userId": "string", "windowType": "string"}apiKeyId?string
appId?string
cooldownMins?integer
Format
int32destination?string
destinationType?string
Value in
- "email"
- "webhook"
- ""
enabled?boolean
environmentId?string
limitUsd*number
the 100% amount in USD
Format
doublemodel?string
model prefix; empty = all models
name*string
Length
1 <= length <= 120provider?string
rungs*array<>|
ordered ladder: each rung is {atPercent, action, blockMode?, fallbackModel?}
tagKey?string
tagValue?string
userId?string
windowType*string
Value in
- "daily"
- "weekly"
- "monthly"
- "cumulative"