budgets

Creates a budget and returns it. The server assigns the identifier and records the caller as created_by.

effect selects the kind of budget: a limit budget takes limit, window, and posture, and an exemption takes validity. A limit budget can split its limit with scope.each.

  • If the body is invalid, the request fails with 400.
  • For a caller whose access covers only particular principals or groups, a scope that doesn't lie within those principals and groups fails with 400, and invalid_parameters names scope.
post/v1/ai-cost-management/budgets

Request

  • Base URL
    https://global.api.konghq.com
  • Auth
    • HTTP bearer
    • or HTTP bearer
    • or HTTP bearer
    • or HTTP bearer

Request body

union required
AICostLimitBudgetInput required

The body of a request that creates or replaces a limit budget.

OR
AICostExemptBudgetInput required

The body of a request that creates or replaces an exemption.

Example request

{
  "labels": {
    "env": "test"
  },
  "managed_by": {
    "owner": "terraform"
  }
}

Response

The created budget.

union required

A budget sets a spending limit, or declares an exemption from limits, for part of the organization's AI usage. scope selects the usage it covers.

effect tells the two kinds apart. A limit budget carries its settings in limit, window, and posture, and an exemption carries the period it covers in validity. The fields of the other kind are null.

AICostLimitBudget required

A limit budget sets a spending limit on the usage in its scope for each budget window. It has a balance, and it can have a notification rule that alerts as spend reaches shares of the limit.

OR
AICostExemptBudget required

An exemption declares that the usage in its scope is exempt from limits for a limited time. It sets no limit. The service stores and lists exemptions, but they change no balance or notification.

Example response

{
  "id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
  "labels": {
    "env": "test"
  },
  "managed_by": {
    "owner": "terraform"
  },
  "created_at": "2022-11-04T20:10:06.927Z",
  "updated_at": "2022-11-04T20:10:06.927Z"
}

Changes

    • warning

      added the new cost_center enum value to the oneOf[#/components/schemas/AICostExemptBudget]/scope/filters/items/oneOf[#/components/schemas/AICostBudgetScopePredicate]/oneOf[#/components/schemas/AICostBudgetScopeExistsPredicate]/field/anyOf[#/components/schemas/AICostBudgetScopeField] response property for the response status

    • warning

      added the new cost_center enum value to the oneOf[#/components/schemas/AICostExemptBudget]/scope/filters/items/oneOf[#/components/schemas/AICostBudgetScopePredicate]/oneOf[#/components/schemas/AICostBudgetScopeNExistsPredicate]/field/anyOf[#/components/schemas/AICostBudgetScopeField] response property for the response status

    • warning

      added the new cost_center enum value to the oneOf[#/components/schemas/AICostExemptBudget]/scope/filters/items/oneOf[#/components/schemas/AICostBudgetScopePredicate]/oneOf[#/components/schemas/AICostBudgetScopeValueListPredicate]/field/anyOf[#/components/schemas/AICostBudgetScopeField] response property for the response status

    13 more changes in this revision