Skip to main content
PUT
/
api
/
v1
/
llm
/
budgets
/
org
/
{orgId}
Python (SDK)
from meetkai_mka1 import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.llm.budgets.set_org(org_id="<id>", period="monthly", limit_kind="tokens", limit=1009.12, thresholds=[])

    # Handle response
    print(res)
{
  "id": "<string>",
  "scope_id": "<string>",
  "limit": 123,
  "thresholds": [
    {
      "pct": 50
    }
  ],
  "alert_webhook_url": "<string>",
  "spend": {
    "window": "<string>",
    "cost_spent_nano": "<string>",
    "cost_spent": 123,
    "tokens_spent": "<string>",
    "pct": 123
  }
}

Authorizations

Authorization
string
header
required

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

Path Parameters

orgId
string
required
Minimum string length: 1

Body

application/json
period
enum<string>
required
Available options:
daily,
weekly,
monthly
limit_kind
enum<string>
required
Available options:
cost,
tokens
limit
number
required

Limit in major units: currency amount for cost, token count for tokens

thresholds
object[]
required
Minimum array length: 1
owner
enum<string>
default:org

cluster = operator ceiling (org-admin read-only); org = self-budget

Available options:
cluster,
org
webhook_url
string<uri> | null
webhook_secret
string | null
Minimum string length: 1

Response

200 - application/json

OK

id
string
required
scope
enum<string>
required
Available options:
org,
apikey
scope_id
string
required
owner
enum<string>
required
Available options:
cluster,
org
period
enum<string>
required
Available options:
daily,
weekly,
monthly
limit_kind
enum<string>
required
Available options:
cost,
tokens
limit
number
required
thresholds
object[]
required
alert_webhook_url
string | null
required
spend
object
required