Skip to navigation

Create CreditLimit

Beta

Create a per-user monthly AI credit limit for the whole tenant, a team, or an organization.

A user’s effective limit is the maximum of the tenant-wide limit and the limits of every team and organization they belong to.

Fields by group type

groupTypeteamIdorganizationId
TENANTOmitOmit
TEAMRequired (team_XXXXXXXX)Omit
ORGANIZATIONOmitRequired (ent_XXXXXXXX)

Notes

  • Requires tenant admin permission.
  • monthlyLimit must be a positive integer.
  • Each group may have at most one limit. Creating a second limit for the same group returns a 400; update the existing limit instead.
  • The organization ID is the organization’s ent_ ID.
  • Returns 403 if credit limits are not enabled for the tenant. Team- and organization-scoped limits require group credit limits to be enabled as well.
  • The change is recorded in the audit log. Affected users’ effective limits are recomputed asynchronously, so the new limit may take a short time to apply.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Headers

EARLY-ACCESSstringOptional

Set to true to access beta operations via /api/v3.

Request

This endpoint expects an object.
groupTypeenumRequired

The group scope the limit applies to: the whole tenant, a single team, or a single organization.

Allowed values:
monthlyLimitintegerRequired
The maximum number of AI credits each user in the group may consume per month. Must be a positive integer.
organizationIdstringOptional
The ID of the organization the limit applies to. Required when groupType is ORGANIZATION and must be omitted otherwise.
teamIdstringOptional
The ID of the team the limit applies to. Required when groupType is TEAM and must be omitted otherwise.

Response

Created
__typenamestringOptional
createdAtstringOptionalformat: "datetime"
groupTypeenumOptional
Allowed values:
idstringOptional
modifiedAtstringOptionalformat: "datetime"
monthlyLimitintegerOptional
organizationobject or nullOptional
teamobject or nullOptional

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error