Deployments.ai Docs
Budgets

Create a spend budget

POST /v1/budgets · SDK createBudget · CLI deployments budget create

POST
/v1/budgets

Requires budgets:write.

Authorization

platformBearer
headerAuthorizationBearer <token>

Platform bearer credential accepted as an opaque API key or JWT.

Header Parameters

x-deployments-organization*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
idempotency-key*string
Length1 <= length <= 512

Request Body

application/json
  1. body
amountUsdMicros*integer
Range1 <= value <= 9007199254740991
environmentId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
name*string
Match^\S[\s\S]*\S$|^\S$|^$
Length1 <= length <= 120
period*string
Value in"daily""monthly""quarterly""yearly"
projectId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
scope*string
Value in"organization""project""environment""workspace"
thresholds?array<>
Items1 <= items <= 10
workspaceId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$

Response Body

BudgetResponse

application/json
  1. response
amountUsdMicros*integer
Range1 <= value <= 9007199254740991
archivedAt?string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
createdAt*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
environmentId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
id*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
name*string
Match^\S[\s\S]*\S$|^\S$|^$
Length1 <= length <= 120
organizationId*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
period*string
Value in"daily""monthly""quarterly""yearly"
projectId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
scope*string
Value in"organization""project""environment""workspace"
status*string
Value in"active""paused""archived"
thresholds*array<>
Items1 <= items <= 10
updatedAt*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
version*integer
Range1 <= value
workspaceId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
curl -X POST "https://example.com/v1/budgets" \  -H "x-deployments-organization: string" \  -H "idempotency-key: string" \  -H "Content-Type: application/json" \  -d '{    "amountUsdMicros": 1,    "name": "string",    "period": "daily",    "scope": "organization"  }'
{  "amountUsdMicros": 1,  "archivedAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "environmentId": "string",  "id": "string",  "name": "string",  "organizationId": "string",  "period": "daily",  "projectId": "string",  "scope": "organization",  "status": "active",  "thresholds": [    1  ],  "updatedAt": "2019-08-24T14:15:22Z",  "version": 1,  "workspaceId": "string"}