Budgets
Overview
Available Operations
- list - List budgets
- getOrg - List org budgets
- setOrg - Set an org budget
- deleteOrg - Delete an org budget
- orgEvents - List org budget events
- getApiKey - List apikey budgets
- setApiKey - Set an apikey budget
- deleteApiKey - Delete an apikey budget
- apiKeyEvents - List apikey budget events
- getUser - List user budgets
- setUser - Set a user budget
- deleteUser - Delete a user budget
- userEvents - List user budget events
- getTeam - List team budgets
- setTeam - Set a team budget
- deleteTeam - Delete a team budget
- teamEvents - List team budget events
- getExternalUser - List external user budgets
- setExternalUser - Set a external user budget
- deleteExternalUser - Delete a external user budget
- externalUserEvents - List external user budget events
- getUserDefault - List per-user default budgets
- setUserDefault - Set a per-user default budget
- deleteUserDefault - Delete a per-user default budget
- userDefaultEvents - List per-user default budget events
- getTeamDefault - List per-team default budgets
- setTeamDefault - Set a per-team default budget
- deleteTeamDefault - Delete a per-team default budget
- teamDefaultEvents - List per-team default budget events
- getExternalUserDefault - List per-external user default budgets
- setExternalUserDefault - Set a per-external user default budget
- deleteExternalUserDefault - Delete a per-external user default budget
- externalUserDefaultEvents - List per-external user default budget events
- getCurrency - Get display currency
- setCurrency - Set display currency
list
Cluster admins see all budgets; org admins see their org's budgets (including member budgets and per-member default budgets) plus budgets on API keys in their org.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.list();
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsList } from "@meetkai/mka1/funcs/budgetsList.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsList(sdk);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsList failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsList,
useBudgetsListSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsList,
// Utility to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateAllBudgetsList,
} from "@meetkai/mka1/react-query/budgetsList.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListBudgetsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getOrg
Returns the org's budgets (self-budget and/or ceiling) with each one's live spend gauge. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.getOrg({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsGetOrg } from "@meetkai/mka1/funcs/budgetsGetOrg.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsGetOrg(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsGetOrg failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsGetOrg,
useBudgetsGetOrgSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsGetOrg,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsGetOrg,
invalidateAllBudgetsGetOrg,
} from "@meetkai/mka1/react-query/budgetsGetOrg.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetOrgBudgetsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetOrgBudgetsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
setOrg
Creates or updates a budget for the org. One budget per (scope, owner); editing re-evaluates against live spend. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.setOrg({
requestBody: {
period: "monthly",
limit: 1009.12,
thresholds: [],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsSetOrg } from "@meetkai/mka1/funcs/budgetsSetOrg.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsSetOrg(sdk, {
requestBody: {
period: "monthly",
limit: 1009.12,
thresholds: [],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsSetOrg failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsSetOrgMutation
} from "@meetkai/mka1/react-query/budgetsSetOrg.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.SetOrgBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.SetOrgBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
deleteOrg
Removes the org's budget for the given owner; enforcement and alerts stop. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.deleteOrg({
owner: "cluster",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsDeleteOrg } from "@meetkai/mka1/funcs/budgetsDeleteOrg.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsDeleteOrg(sdk, {
owner: "cluster",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsDeleteOrg failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsDeleteOrgMutation
} from "@meetkai/mka1/react-query/budgetsDeleteOrg.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteOrgBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.DeleteOrgBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
orgEvents
Returns recent threshold-alert and block events for the org's budgets. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.orgEvents({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsOrgEvents } from "@meetkai/mka1/funcs/budgetsOrgEvents.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsOrgEvents(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsOrgEvents failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsOrgEvents,
useBudgetsOrgEventsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsOrgEvents,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsOrgEvents,
invalidateAllBudgetsOrgEvents,
} from "@meetkai/mka1/react-query/budgetsOrgEvents.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListOrgBudgetEventsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListOrgBudgetEventsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getApiKey
Returns the apikey's budgets (self-budget and/or ceiling) with each one's live spend gauge. Callable by cluster admins, or org admins for API keys in their own organization.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.getApiKey({
apiKeyId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsGetApiKey } from "@meetkai/mka1/funcs/budgetsGetApiKey.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsGetApiKey(sdk, {
apiKeyId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsGetApiKey failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsGetApiKey,
useBudgetsGetApiKeySuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsGetApiKey,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsGetApiKey,
invalidateAllBudgetsGetApiKey,
} from "@meetkai/mka1/react-query/budgetsGetApiKey.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetApiKeyBudgetsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetApiKeyBudgetsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
setApiKey
Creates or updates a budget for the apikey. One budget per (scope, owner); editing re-evaluates against live spend. Callable by cluster admins, or org admins for API keys in their own organization.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.setApiKey({
apiKeyId: "<id>",
requestBody: {
period: "weekly",
limit: 3281.35,
thresholds: [
{
pct: 793338,
action: "alert",
},
],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsSetApiKey } from "@meetkai/mka1/funcs/budgetsSetApiKey.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsSetApiKey(sdk, {
apiKeyId: "<id>",
requestBody: {
period: "weekly",
limit: 3281.35,
thresholds: [
{
pct: 793338,
action: "alert",
},
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsSetApiKey failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsSetApiKeyMutation
} from "@meetkai/mka1/react-query/budgetsSetApiKey.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.SetApiKeyBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.SetApiKeyBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
deleteApiKey
Removes the apikey's budget for the given owner; enforcement and alerts stop. Callable by cluster admins, or org admins for API keys in their own organization.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.deleteApiKey({
apiKeyId: "<id>",
owner: "org",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsDeleteApiKey } from "@meetkai/mka1/funcs/budgetsDeleteApiKey.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsDeleteApiKey(sdk, {
apiKeyId: "<id>",
owner: "org",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsDeleteApiKey failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsDeleteApiKeyMutation
} from "@meetkai/mka1/react-query/budgetsDeleteApiKey.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteApiKeyBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.DeleteApiKeyBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
apiKeyEvents
Returns recent threshold-alert and block events for the apikey's budgets. Callable by cluster admins, or org admins for API keys in their own organization.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.apiKeyEvents({
apiKeyId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsApiKeyEvents } from "@meetkai/mka1/funcs/budgetsApiKeyEvents.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsApiKeyEvents(sdk, {
apiKeyId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsApiKeyEvents failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsApiKeyEvents,
useBudgetsApiKeyEventsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsApiKeyEvents,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsApiKeyEvents,
invalidateAllBudgetsApiKeyEvents,
} from "@meetkai/mka1/react-query/budgetsApiKeyEvents.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListApiKeyBudgetEventsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListApiKeyBudgetEventsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getUser
Returns the user's budgets in the target org (self-budget and/or ceiling) with each one's live spend gauge. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for users in their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.getUser({
id: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsGetUser } from "@meetkai/mka1/funcs/budgetsGetUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsGetUser(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsGetUser failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsGetUser,
useBudgetsGetUserSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsGetUser,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsGetUser,
invalidateAllBudgetsGetUser,
} from "@meetkai/mka1/react-query/budgetsGetUser.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetUserBudgetsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetUserBudgetsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
setUser
Creates or updates a budget for the user in the target org. One budget per (scope, owner); editing re-evaluates against live spend. An explicit user budget replaces the org's per-user default budget of the same owner and period for this user (exemption-by-override — it may raise or tighten it); different-period defaults, org budgets, and API-key budgets still apply. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for users in their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.setUser({
id: "<id>",
requestBody: {
period: "weekly",
limit: 6011.89,
thresholds: [],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsSetUser } from "@meetkai/mka1/funcs/budgetsSetUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsSetUser(sdk, {
id: "<id>",
requestBody: {
period: "weekly",
limit: 6011.89,
thresholds: [],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsSetUser failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsSetUserMutation
} from "@meetkai/mka1/react-query/budgetsSetUser.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.SetUserBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.SetUserBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
deleteUser
Removes the user's budget for the given owner; the org's per-user default budget (if any) applies to them again. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for users in their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.deleteUser({
id: "<id>",
owner: "org",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsDeleteUser } from "@meetkai/mka1/funcs/budgetsDeleteUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsDeleteUser(sdk, {
id: "<id>",
owner: "org",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsDeleteUser failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsDeleteUserMutation
} from "@meetkai/mka1/react-query/budgetsDeleteUser.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteUserBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.DeleteUserBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
userEvents
Returns recent threshold-alert and block events for the user's budgets in the target org. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for users in their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.userEvents({
id: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsUserEvents } from "@meetkai/mka1/funcs/budgetsUserEvents.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsUserEvents(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsUserEvents failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsUserEvents,
useBudgetsUserEventsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsUserEvents,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsUserEvents,
invalidateAllBudgetsUserEvents,
} from "@meetkai/mka1/react-query/budgetsUserEvents.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListUserBudgetEventsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListUserBudgetEventsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getTeam
Returns the team's budgets in the target org (self-budget and/or ceiling) with each one's live spend gauge. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for teams in their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.getTeam({
id: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsGetTeam } from "@meetkai/mka1/funcs/budgetsGetTeam.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsGetTeam(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsGetTeam failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsGetTeam,
useBudgetsGetTeamSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsGetTeam,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsGetTeam,
invalidateAllBudgetsGetTeam,
} from "@meetkai/mka1/react-query/budgetsGetTeam.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetTeamBudgetsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetTeamBudgetsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
setTeam
Creates or updates a budget for the team in the target org. One budget per (scope, owner); editing re-evaluates against live spend. An explicit team budget replaces the org's per-team default budget of the same owner and period for this team (exemption-by-override — it may raise or tighten it); different-period defaults, org budgets, and API-key budgets still apply. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for teams in their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.setTeam({
id: "<id>",
requestBody: {
period: "daily",
limit: 3256.74,
thresholds: [],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsSetTeam } from "@meetkai/mka1/funcs/budgetsSetTeam.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsSetTeam(sdk, {
id: "<id>",
requestBody: {
period: "daily",
limit: 3256.74,
thresholds: [],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsSetTeam failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsSetTeamMutation
} from "@meetkai/mka1/react-query/budgetsSetTeam.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.SetTeamBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.SetTeamBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
deleteTeam
Removes the team's budget for the given owner; the org's per-team default budget (if any) applies to them again. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for teams in their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.deleteTeam({
id: "<id>",
owner: "cluster",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsDeleteTeam } from "@meetkai/mka1/funcs/budgetsDeleteTeam.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsDeleteTeam(sdk, {
id: "<id>",
owner: "cluster",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsDeleteTeam failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsDeleteTeamMutation
} from "@meetkai/mka1/react-query/budgetsDeleteTeam.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteTeamBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.DeleteTeamBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
teamEvents
Returns recent threshold-alert and block events for the team's budgets in the target org. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for teams in their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.teamEvents({
id: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsTeamEvents } from "@meetkai/mka1/funcs/budgetsTeamEvents.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsTeamEvents(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsTeamEvents failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsTeamEvents,
useBudgetsTeamEventsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsTeamEvents,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsTeamEvents,
invalidateAllBudgetsTeamEvents,
} from "@meetkai/mka1/react-query/budgetsTeamEvents.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListTeamBudgetEventsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListTeamBudgetEventsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getExternalUser
Returns the external user's budgets in the target org (self-budget and/or ceiling) with each one's live spend gauge. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for external users in their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.getExternalUser({
id: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsGetExternalUser } from "@meetkai/mka1/funcs/budgetsGetExternalUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsGetExternalUser(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsGetExternalUser failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsGetExternalUser,
useBudgetsGetExternalUserSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsGetExternalUser,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsGetExternalUser,
invalidateAllBudgetsGetExternalUser,
} from "@meetkai/mka1/react-query/budgetsGetExternalUser.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetExternalUserBudgetsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetExternalUserBudgetsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
setExternalUser
Creates or updates a budget for the external user in the target org. One budget per (scope, owner); editing re-evaluates against live spend. An explicit external user budget replaces the org's per-external user default budget of the same owner and period for this external user (exemption-by-override — it may raise or tighten it); different-period defaults, org budgets, and API-key budgets still apply. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for external users in their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.setExternalUser({
id: "<id>",
requestBody: {
period: "monthly",
limit: 9414.34,
thresholds: [
{
pct: 649006,
action: "block",
},
],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsSetExternalUser } from "@meetkai/mka1/funcs/budgetsSetExternalUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsSetExternalUser(sdk, {
id: "<id>",
requestBody: {
period: "monthly",
limit: 9414.34,
thresholds: [
{
pct: 649006,
action: "block",
},
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsSetExternalUser failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsSetExternalUserMutation
} from "@meetkai/mka1/react-query/budgetsSetExternalUser.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.SetExternalUserBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.SetExternalUserBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
deleteExternalUser
Removes the external user's budget for the given owner; the org's per-external user default budget (if any) applies to them again. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for external users in their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.deleteExternalUser({
id: "<id>",
owner: "cluster",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsDeleteExternalUser } from "@meetkai/mka1/funcs/budgetsDeleteExternalUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsDeleteExternalUser(sdk, {
id: "<id>",
owner: "cluster",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsDeleteExternalUser failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsDeleteExternalUserMutation
} from "@meetkai/mka1/react-query/budgetsDeleteExternalUser.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteExternalUserBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.DeleteExternalUserBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
externalUserEvents
Returns recent threshold-alert and block events for the external user's budgets in the target org. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for external users in their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.externalUserEvents({
id: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsExternalUserEvents } from "@meetkai/mka1/funcs/budgetsExternalUserEvents.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsExternalUserEvents(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsExternalUserEvents failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsExternalUserEvents,
useBudgetsExternalUserEventsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsExternalUserEvents,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsExternalUserEvents,
invalidateAllBudgetsExternalUserEvents,
} from "@meetkai/mka1/react-query/budgetsExternalUserEvents.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListExternalUserBudgetEventsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListExternalUserBudgetEventsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getUserDefault
Returns the org's per-user default budgets (self-set and/or operator ceiling). A default budget applies to every user in the org against that user's own spend counter, unless an explicit user budget of the same owner and period exists for them. It has no spend gauge of its own. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.getUserDefault({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsGetUserDefault } from "@meetkai/mka1/funcs/budgetsGetUserDefault.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsGetUserDefault(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsGetUserDefault failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsGetUserDefault,
useBudgetsGetUserDefaultSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsGetUserDefault,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsGetUserDefault,
invalidateAllBudgetsGetUserDefault,
} from "@meetkai/mka1/react-query/budgetsGetUserDefault.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetUserDefaultBudgetsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetUserDefaultBudgetsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
setUserDefault
Creates or updates the org's per-user default budget: a cap applying to EACH user in the org individually (not in aggregate), unless an explicit user budget of the same owner and period exists for them. Threshold alerts and blocks fire per user. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.setUserDefault({
requestBody: {
period: "weekly",
limit: 6669.11,
thresholds: [],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsSetUserDefault } from "@meetkai/mka1/funcs/budgetsSetUserDefault.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsSetUserDefault(sdk, {
requestBody: {
period: "weekly",
limit: 6669.11,
thresholds: [],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsSetUserDefault failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsSetUserDefaultMutation
} from "@meetkai/mka1/react-query/budgetsSetUserDefault.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.SetUserDefaultBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.SetUserDefaultBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
deleteUserDefault
Removes the org's per-user default budget for the given owner; only explicit user budgets remain. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.deleteUserDefault({
owner: "cluster",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsDeleteUserDefault } from "@meetkai/mka1/funcs/budgetsDeleteUserDefault.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsDeleteUserDefault(sdk, {
owner: "cluster",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsDeleteUserDefault failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsDeleteUserDefaultMutation
} from "@meetkai/mka1/react-query/budgetsDeleteUserDefault.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteUserDefaultBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.DeleteUserDefaultBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
userDefaultEvents
Returns recent threshold-alert and block events for the org's per-user default budgets. Each event's target_id names the user it fired for. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.userDefaultEvents({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsUserDefaultEvents } from "@meetkai/mka1/funcs/budgetsUserDefaultEvents.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsUserDefaultEvents(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsUserDefaultEvents failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsUserDefaultEvents,
useBudgetsUserDefaultEventsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsUserDefaultEvents,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsUserDefaultEvents,
invalidateAllBudgetsUserDefaultEvents,
} from "@meetkai/mka1/react-query/budgetsUserDefaultEvents.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListUserDefaultBudgetEventsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListUserDefaultBudgetEventsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getTeamDefault
Returns the org's per-team default budgets (self-set and/or operator ceiling). A default budget applies to every team in the org against that team's own spend counter, unless an explicit team budget of the same owner and period exists for them. It has no spend gauge of its own. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.getTeamDefault({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsGetTeamDefault } from "@meetkai/mka1/funcs/budgetsGetTeamDefault.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsGetTeamDefault(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsGetTeamDefault failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsGetTeamDefault,
useBudgetsGetTeamDefaultSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsGetTeamDefault,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsGetTeamDefault,
invalidateAllBudgetsGetTeamDefault,
} from "@meetkai/mka1/react-query/budgetsGetTeamDefault.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetTeamDefaultBudgetsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetTeamDefaultBudgetsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
setTeamDefault
Creates or updates the org's per-team default budget: a cap applying to EACH team in the org individually (not in aggregate), unless an explicit team budget of the same owner and period exists for them. Threshold alerts and blocks fire per team. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.setTeamDefault({
requestBody: {
period: "daily",
limit: 1351.42,
thresholds: [],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsSetTeamDefault } from "@meetkai/mka1/funcs/budgetsSetTeamDefault.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsSetTeamDefault(sdk, {
requestBody: {
period: "daily",
limit: 1351.42,
thresholds: [],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsSetTeamDefault failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsSetTeamDefaultMutation
} from "@meetkai/mka1/react-query/budgetsSetTeamDefault.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.SetTeamDefaultBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.SetTeamDefaultBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
deleteTeamDefault
Removes the org's per-team default budget for the given owner; only explicit team budgets remain. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.deleteTeamDefault({
owner: "org",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsDeleteTeamDefault } from "@meetkai/mka1/funcs/budgetsDeleteTeamDefault.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsDeleteTeamDefault(sdk, {
owner: "org",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsDeleteTeamDefault failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsDeleteTeamDefaultMutation
} from "@meetkai/mka1/react-query/budgetsDeleteTeamDefault.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteTeamDefaultBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.DeleteTeamDefaultBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
teamDefaultEvents
Returns recent threshold-alert and block events for the org's per-team default budgets. Each event's target_id names the team it fired for. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.teamDefaultEvents({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsTeamDefaultEvents } from "@meetkai/mka1/funcs/budgetsTeamDefaultEvents.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsTeamDefaultEvents(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsTeamDefaultEvents failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsTeamDefaultEvents,
useBudgetsTeamDefaultEventsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsTeamDefaultEvents,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsTeamDefaultEvents,
invalidateAllBudgetsTeamDefaultEvents,
} from "@meetkai/mka1/react-query/budgetsTeamDefaultEvents.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListTeamDefaultBudgetEventsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListTeamDefaultBudgetEventsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getExternalUserDefault
Returns the org's per-external user default budgets (self-set and/or operator ceiling). A default budget applies to every external user in the org against that external user's own spend counter, unless an explicit external user budget of the same owner and period exists for them. It has no spend gauge of its own. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.getExternalUserDefault({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsGetExternalUserDefault } from "@meetkai/mka1/funcs/budgetsGetExternalUserDefault.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsGetExternalUserDefault(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsGetExternalUserDefault failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsGetExternalUserDefault,
useBudgetsGetExternalUserDefaultSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsGetExternalUserDefault,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsGetExternalUserDefault,
invalidateAllBudgetsGetExternalUserDefault,
} from "@meetkai/mka1/react-query/budgetsGetExternalUserDefault.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetExternalUserDefaultBudgetsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetExternalUserDefaultBudgetsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
setExternalUserDefault
Creates or updates the org's per-external user default budget: a cap applying to EACH external user in the org individually (not in aggregate), unless an explicit external user budget of the same owner and period exists for them. Threshold alerts and blocks fire per external user. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.setExternalUserDefault({
requestBody: {
period: "monthly",
limit: 7392.64,
thresholds: [],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsSetExternalUserDefault } from "@meetkai/mka1/funcs/budgetsSetExternalUserDefault.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsSetExternalUserDefault(sdk, {
requestBody: {
period: "monthly",
limit: 7392.64,
thresholds: [],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsSetExternalUserDefault failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsSetExternalUserDefaultMutation
} from "@meetkai/mka1/react-query/budgetsSetExternalUserDefault.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.SetExternalUserDefaultBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.SetExternalUserDefaultBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
deleteExternalUserDefault
Removes the org's per-external user default budget for the given owner; only explicit external user budgets remain. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.deleteExternalUserDefault({
owner: "cluster",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsDeleteExternalUserDefault } from "@meetkai/mka1/funcs/budgetsDeleteExternalUserDefault.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsDeleteExternalUserDefault(sdk, {
owner: "cluster",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsDeleteExternalUserDefault failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsDeleteExternalUserDefaultMutation
} from "@meetkai/mka1/react-query/budgetsDeleteExternalUserDefault.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteExternalUserDefaultBudgetRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.DeleteExternalUserDefaultBudgetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
externalUserDefaultEvents
Returns recent threshold-alert and block events for the org's per-external user default budgets. Each event's target_id names the external user it fired for. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for their own organization (owner=org).
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.externalUserDefaultEvents({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsExternalUserDefaultEvents } from "@meetkai/mka1/funcs/budgetsExternalUserDefaultEvents.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsExternalUserDefaultEvents(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsExternalUserDefaultEvents failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsExternalUserDefaultEvents,
useBudgetsExternalUserDefaultEventsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsExternalUserDefaultEvents,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateBudgetsExternalUserDefaultEvents,
invalidateAllBudgetsExternalUserDefaultEvents,
} from "@meetkai/mka1/react-query/budgetsExternalUserDefaultEvents.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListExternalUserDefaultBudgetEventsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListExternalUserDefaultBudgetEventsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getCurrency
Get display currency
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.getCurrency();
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsGetCurrency } from "@meetkai/mka1/funcs/budgetsGetCurrency.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsGetCurrency(sdk);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsGetCurrency failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useBudgetsGetCurrency,
useBudgetsGetCurrencySuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchBudgetsGetCurrency,
// Utility to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateAllBudgetsGetCurrency,
} from "@meetkai/mka1/react-query/budgetsGetCurrency.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetCurrencyResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
setCurrency
ISO 4217 code used for display on budgets and cost reports. No conversion is performed anywhere.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.budgets.setCurrency({
currency: "Kwacha",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { budgetsSetCurrency } from "@meetkai/mka1/funcs/budgetsSetCurrency.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await budgetsSetCurrency(sdk, {
currency: "Kwacha",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("budgetsSetCurrency failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useBudgetsSetCurrencyMutation
} from "@meetkai/mka1/react-query/budgetsSetCurrency.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.SetCurrencyRequestBody | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.SetCurrencyResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |