/api/orgs/{org_id}/budgetsSet a monthly budget
Creates or replaces the cap for one scope. Provisioning key only; a key may set identity and key scopes only (422 otherwise), never on the default identity (403), and may replace only rows its own key authored (403). The response meters the current month for a recurring budget.
認証: AuthorizationヘッダーにBearer形式のAPIキー
パスパラメータ
org_idstring必須Your organization id (uuid).
GET /api/whoamireturns it.
リクエストボディ
periodstring必須YYYY-MM, or*for a recurring budget enforced every month against that month's spend.scope_kindenum必須API keys may set
identityandkeyonly.limit_nano_usdinteger必須Integer nano-USD (1 USD = 1,000,000,000). 0 refuses every request under the scope; remove a cap with DELETE.
api_key_idstring | nullidentity_idstring | nullalias_idstring | nullpool_idstring | nulldeployment_idstring | null
レスポンス
200The budget.
レスポンス
budget_idstring必須periodstring必須YYYY-MM, or*for recurring.scope_kindenum必須api_key_idstring | null必須identity_idstring | null必須alias_idstring | null必須pool_idstring | null必須deployment_idstring | null必須limit_nano_usdinteger必須The cap, integer nano-USD. 0 is a hard zero cap.
reserved_nano_usdinteger必須In flight, integer nano-USD.
settled_nano_usdinteger必須Spent this month, integer nano-USD.
remaining_nano_usdinteger必須Integer nano-USD.
created_by_kindenum必須created_by_api_key_idstring | null必須The authoring key; a key may change only its own rows.
401Missing, unknown or revoked API key.
レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
403Not a provisioning key, the default identity, or a row set by an admin or another key.
レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
404Unknown organization, identity, key or model.
レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
422Bad period or scope, wrong identifiers for the scope, a scope a key may not set, or body validation.
リクエスト
curl -X PUT https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/budgets \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"period": "*",
"scope_kind": "identity",
"identity_id": "acme-support",
"limit_nano_usd": 50000000000
}'レスポンス
{
"budget_id": "b7e1c0d2-5a4f-4c39-8e16-2d9f0a7b3c51",
"period": "*",
"scope_kind": "identity",
"api_key_id": null,
"identity_id": "acme-support",
"alias_id": null,
"pool_id": null,
"deployment_id": null,
"limit_nano_usd": 50000000000,
"reserved_nano_usd": 120000000,
"settled_nano_usd": 18400000000,
"remaining_nano_usd": 31480000000,
"created_by_kind": "api_key",
"created_by_api_key_id": "6b1d2f4e-3c8a-4f0e-9a21-7e5c0d9b4a33"
}https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/budgets