Skip to content

Set the cap each person has on the AI allowance

PUT
/api/billing/ai-caps
curl --request PUT \
--url https://forge.example.com/api/billing/ai-caps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "kind": "example", "microdollars": 1, "percent": 1, "version": 1 }'

Send kind: none to share the pool freely, dollars with microdollars a month, or share with percent (0 to 100) of the month’s allowance, rounded down; and version as GET /api/billing/ai-caps answered it (0 before any was set). 0 dollars or 0 percent switches the assistant off on the instance’s account for everyone without a cap of their own. A cap counts only calls on the instance’s own account. 409 with currentVersion when someone changed the caps first, or when the organization has no plan with an AI allowance. Recorded in the activity log. Answers the AI allowance by person. For administrators.

Media typeapplication/json
object
kind
required
string
microdollars
required
null | integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
percent
required
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
version
required
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/

Example generated

{
"kind": "example",
"microdollars": 1,
"percent": 1,
"version": 1
}

OK

Media typeapplication/json
object
applies
required
boolean
poolMicrodollars
required
integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
poolSpentMicrodollars
required
integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
default
required
object
kind
required
string
microdollars
required
null | integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
percent
required
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
defaultCapMicrodollars
required
null | integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
version
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
people
required
Array<object>
object
personId
required
string format: uuid
name
required
string
active
required
boolean
spentMicrodollars
required
integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
ownCapMicrodollars
required
null | integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
capMicrodollars
required
null | integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
stopped
required
boolean

Example generated

{
"applies": true,
"poolMicrodollars": 1,
"poolSpentMicrodollars": 1,
"default": {
"kind": "example",
"microdollars": 1,
"percent": 1
},
"defaultCapMicrodollars": 1,
"version": 1,
"people": [
{
"personId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"name": "example",
"active": true,
"spentMicrodollars": 1,
"ownCapMicrodollars": 1,
"capMicrodollars": 1,
"stopped": true
}
]
}

A refusal or an error, as a problem document. A model or draft you may not see answers 404, as one that does not exist.

Media typeapplication/problem+json
object
type
string
title
string
status
integer
detail
string
instance
string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}