Ana içeriğe geç

Get Effective Limit

Endpoint

GET /apiops/projects/{projectName}/ai-budgets/hierarchy/{nodeType}/{nodeId}/effective-limit/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
nodeTypestringYesNode type: CREDENTIAL, CREDENTIAL_ORGANIZATION, API_PROXY or PROJECT
nodeIdstringYesEntity ID of the node (the nodeId / owner id from a hierarchy or scope-rules read)

The ownership chain resolved for each nodeType:

nodeTypeChain resolved (top-down)
CREDENTIALleaf binding → org chain → app cap → tenant cap
CREDENTIAL_ORGANIZATIONown budget → parent org chain → tenant cap
API_PROXYaiAppBudget → tenant cap
PROJECTaiTenantBudget only

Query Parameters

None

Response

Success Response (200 OK)

resultList contains a single effective-limit object. The effective*Tokens fields are the resolved min(...) across the applicable chain; a null field means no limit is configured across the chain.

{
"status": "SUCCESS",
"resultList": [
{
"credentialLeafTokensPerMonth": null,
"orgChain": [
{
"orgId": "665f1a2b3c4d5e6f7a8b9c1a",
"orgName": "engineering-team",
"tokensPerMonth": 2000000
}
],
"appCapTokensPerMonth": 3000000,
"tenantCapTokensPerMonth": 10000000,
"effectiveMonthlyTokens": 2000000,
"effectiveDailyTokens": 500000,
"effectiveMinuteTokens": null,
"status": "NORMAL"
}
],
"resultCount": 1
}

Response Fields

FieldTypeDescription
statusstringResponse status: SUCCESS or FAILURE
resultListarrayContains the single effective-limit object
resultCountintegerAlways 1 on success

Effective Limit Object Fields

FieldTypeDescription
credentialLeafTokensPerMonthintegerMonthly cap at the leaf credential binding (CREDENTIAL node only). null if not set
orgChainarrayOrg-chain entries (top-down). Empty for non-credential nodes
appCapTokensPerMonthintegerAI-proxy app cap (aiAppBudget.tokensPerMonth). null if not set / not applicable
tenantCapTokensPerMonthintegerProject tenant cap (aiTenantBudget.tokensPerMonth). null if not set
effectiveMonthlyTokensintegerResolved effective monthly limit = min(all non-null values above). null = no limit configured
effectiveDailyTokensintegerResolved effective daily limit. null if not configured
effectiveMinuteTokensintegerResolved effective per-minute limit. null if not configured
statusstringStatus derived from budget state: NORMAL, LOCKED or AT_CAPACITY

Org Chain Entry Fields

FieldTypeDescription
orgIdstringCredential-organization ID
orgNamestringCredential-organization name
tokensPerMonthintegerMonthly cap contributed by this org. null if not set

EnumStatus

  • SUCCESS - Operation successful
  • FAILURE - Operation failed

Error Response (400 Bad Request)

{
"status": "FAILURE",
"resultMessage": "Effective limit for node (CREDENTIAL/665f1a2b3c4d5e6f7a8b9c3c) was not found!"
}

Error Response (401 Unauthorized)

{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}

cURL Example

curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/ai-budgets/hierarchy/CREDENTIAL/665f1a2b3c4d5e6f7a8b9c3c/effective-limit/" \
-H "Authorization: Bearer YOUR_TOKEN"

Notes and Warnings

  • Manager-side preview only: This is a read-only preview that computes min(non-null tokensPerMonth) across the ownership chain. It does not replicate the worker-side Hazelcast reservation logic; the runtime gateway enforcement may differ under live concurrency.
  • nodeId is an entity ID: Take it from a hierarchy (nodeId) or scope-rules (id / scopeRef) read. A node that cannot be resolved returns 400 Bad Request with a was not found! message.
  • nodeType is case-sensitive: Use one of CREDENTIAL, CREDENTIAL_ORGANIZATION, API_PROXY, PROJECT.
  • orgChain only for credential nodes: For API_PROXY and PROJECT nodes the orgChain is empty.
  • null means unlimited: A null effectiveMonthlyTokens means no cap is configured anywhere in the chain, not zero.
  • No _class: The response DTO carries no MongoDB _class discriminator.
  • Permission: Requires AI_BUDGETS + VIEW in the project.