For the complete documentation index, see llms.txt. This page is also available as Markdown.

Credit

The Credit category provides queries and quota allocation for organization Credits: balances, credits nearing expiration, credit entries, consumption details and totals, usage statistics, pricing rules and pricing items, as well as quota settings for members, roles, and inboxes (list, set, update, deactivate, and specify whether a quota is required), and batch allocation or deactivation of member quotas by role.

Prerequisites

Authentication and Path Parameters

All APIs except Pricing Rules and Pricing Items require an API Key in the HTTP header:

Authorization: Api-Key {API_KEY}

The system automatically identifies the organization and member associated with the API Key. APIs starting with /api/v1/credit/ do not require a separate organization identifier. Obtain the IDs required in paths as follows:

  • organizationPk: Call GET /api/v1/organizations/ and use the organization's id from the response.

  • Wallet id: Call GET /api/v1/organizations/{id}/ and use creditWallet.id from the response.

Rate Limits

For APIs that require an API Key, the rate limit is the number of requests per minute configured individually for each API Key. Organization administrators set this in the Requests per Minute (RPM) field under Organization Settings → API Keys. Calls to all APIs on the platform using the same key count toward a shared total. Keys without a configured limit are exempt. Requests exceeding the limit are rejected with HTTP 429; wait until the next minute before retrying.

Pricing Rules and Pricing Items do not require an API Key. Their rate limits are calculated separately by source IP; see the notes for each API.

How Quotas Work

Members, roles, and inboxes each have a quota layer, corresponding to the three tabs under Credits → Quota Allocation in the admin console. Each layer is tracked independently:

  • Member quota: The usage limit for an individual member.

  • Role quota: A shared limit for all members of a role, tracked separately from each member's individual quota. If a member belongs to multiple roles that require quotas, usage counts toward every role. Exhausting any one role's quota blocks further use.

  • Inbox quota: The usage limit for AI replies in that inbox. Quotas cannot be set for MaiGPT inboxes.

The same rules apply to each layer:

  • Quota required: Members, roles, and inboxes each have a Quota Required setting (response field creditQuotaRequired). When disabled, this layer is neither checked nor tracked, and the organization wallet is used directly. When enabled, an active quota is required. Without an active quota, use is blocked: members and roles cannot use features that consume Credits, and AI replies are paused for inboxes.

  • Setting a quota automatically enables Quota Required. Each entity can have only one active quota at a time. Attempting to set another quota while an active one exists returns 400; deactivate the old quota first.

  • Deactivating a quota does not disable Quota Required: The entity remains blocked until a new quota is set or the quota requirement is removed. For roles and inboxes, use their respective Set Whether a Quota Is Required API. For members, ask an administrator to remove the requirement under Credits → Quota Allocation in the admin console, or use Batch Deactivate Quotas by Role with removeQuotaRequirement: true to remove it for all members of a role at once. Deactivation does not delete records. Deactivated quotas still appear in List Quota Settings with isActive set to false.

  • Request fields for setting a quota: quotaLimit (quota limit, required), validFrom (start time, required), validUntil (expiration time, optional; must be later than validFrom and no later than the latest expiration date among the organization's credit entries), resetPeriod (usage reset interval: none, daily, weekly, or monthly; defaults to none), and note (optional note).

  • Time format: Always use ISO 8601 strings for validFrom and validUntil in requests, such as 2026-12-31T23:59:59+08:00. A date alone (2026-12-31) is interpreted as 00:00 on that date in Taiwan time. Millisecond timestamps (such as 1798732799000) are not accepted and return 400. Time fields in responses use 13-digit millisecond timestamps.

  • Default quota for new members: Organizations can configure an individual quota to be assigned automatically to new members; see Get Default Quota Settings for New Members. A quota can also be specified for each invitee when sending invitations; see Invite Members to an Organization under Organizations and Members.

  • IDs in paths: Obtain memberPk from the id in the List Current Member Quotas response, groupPk from List Current Role Quotas, and inboxPk from List Current Inbox Quotas. Obtain the quota setting's own id from the corresponding List Quota Settings API.

Permissions and Billing Modes

The required permissions and billing mode prerequisites are listed below each API. An API Key acts as the member who created it, and permissions are determined by that member's roles. Requests are rejected with HTTP 403 in either of these cases:

  • Insufficient permissions: The roles of the member associated with the key do not have the permission specified by the API (Credit Management, Usage Statistics, or Organization Overview). Ask an organization administrator to enable the corresponding permission for the member's role under Organization Settings → Roles.

  • The organization does not use Credit billing: APIs marked as requiring Credit billing are available only to organizations using that billing mode. Call GET /api/v1/organizations/{id}/ to check: these APIs are available when organizationPlan.billingMode is credit, or when the organization has no plan yet and organizationPlan is empty. To switch to Credit billing, contact your MaiAgent representative.

Query Credit Balance

GET /api/v1/credit/wallets/

Required permission: Credit management permission. Billing mode: Any; organizations in any billing mode can call this API.

Parameters

Parameter Name
Required
Type
Description

page

❌

integer

A page number within the paginated result set.

pageSize

❌

integer

Number of results to return per page.

Code Examples

Response Body

Status Code: 200

Example Response Schema

Example Response Values


Get Wallet Details

GET /api/v1/credit/wallets/{id}/

Required permission: Credit management permission. Billing mode: Any; organizations in any billing mode can call this API.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

A UUID string identifying this Credit Wallet.

Code Examples

Response Body

Status Code: 200

Example Response Schema

Example Response Values


Get Wallet Balance

GET /api/v1/credit/wallets/{id}/balance/

Required permission: Credit management permission. Billing mode: Any; organizations in any billing mode can call this API.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

A UUID string identifying this Credit Wallet.

Code Examples

Response Body

Status Code: 200

Example Response Schema

Example Response Values


Query Expiring Credits

GET /api/v1/credit/wallets/{id}/expiring-credits/

Required permission: Credit management permission. Billing mode: Any; organizations in any billing mode can call this API. Only credits with an expiration date are listed; credits without an expiration date do not appear in the results and do not represent the organization's entire balance. The days parameter specifies how many days ahead to look for expiring credits (default 30; pass all to list all credits that have an expiration date).

Parameters

Parameter Name
Required
Type
Description

id

✅

string

A UUID string identifying this Credit Wallet.

Code Examples

Response Body

Status Code: 200

Example Response Schema

Example Response Values


Retrieve Top-up History

GET /api/v1/credit/wallets/{id}/topup-history/

Required permission: Credit management permission. Billing mode: Any; organizations in any billing mode can call this API.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

A UUID string identifying this Credit Wallet.

Code Examples

Response Body

Status Code: 200

Example Response Schema

Example Response Values


List Usage Transactions

GET /api/v1/credit/transactions/

Required permissions: Credit management permissions. Billing mode: No restrictions; organizations using any billing mode can call this endpoint.

Parameters

Parameter Name
Required
Type
Description

page

❌

integer

A page number within the paginated result set.

pageSize

❌

integer

Number of results to return per page.

Code Examples

Response Body

Status Code: 200

Example Response Schema

Example Response Values


Retrieve a Usage Transaction

GET /api/v1/credit/transactions/{id}/

Required permissions: Credit management permissions. Billing mode: No restrictions; organizations using any billing mode can call this endpoint.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

A UUID string identifying this Credit Transaction.

Code Examples

Response Body

Status Code: 200

Example Response Schema

Example Response Values


Query Consumption Records

GET /api/v1/credit/transactions/history/

Required permission: Credit management permission. Billing mode: Any; organizations in any billing mode can call this API. Looking up deductions from a single source: search matches each record's description field and metadata (partial match, case-insensitive). You can pass the message ID of an AI reply or the ID of a chat-platform analysis report directly, for example search=<AI reply message ID>&type=usage; type=usage lists consumption records only. For an AI reply's model usage (input, output, cache, embedding), AI Gateway fees, and Hook deductions, the description field carries the message ID. Deductions for tools called during a reply (for example image generation) or for knowledge base reranking do not carry the AI reply's message ID in the description field, so they do not appear in the results. For messages replied to in team mode, the description field of each member's model usage and AI Gateway fees carries the AI assistant name instead of the message ID, so they cannot be found either. The description field of a platform processing fee record reuses the description of the original deduction, so it appears in the results together with the original deduction. Deductions for an AI reply are posted in the background after the reply completes, so wait a moment before querying a reply that just finished. targetObject.objectId in the response is the ID of the AI assistant record, not a message ID, and cannot be used as the value of search.

Parameters

Parameter Name
Required
Type
Description

category

❌

string

Credit item category (e.g. llm_token, platform_fee); agent_memory selects the AI memory lines, which llm_token then leaves out

endDate

❌

string

End date (inclusive, whole day in the platform timezone Asia/Taipei), format: YYYY-MM-DD

limit

❌

integer

Rows per page, capped at 100

page

❌

integer

1-based page number

search

❌

string

Case-insensitive match against transaction description and metadata

startDate

❌

string

Start date (inclusive, whole day in the platform timezone Asia/Taipei), format: YYYY-MM-DD

type

❌

string

Which rows to include: all ledger entries, consumption only, or credited only

Code Examples

Response Body

Status Code: 200

Example Response Schema

Example Response Values


Query Consumption Totals

GET /api/v1/credit/transactions/history-summary/

Required permission: Credit management permission. Billing mode: Any; organizations in any billing mode can call this API. The filter parameters are the same as Query Consumption Records. When you pass search=<AI reply message ID>&type=usage or search=<analysis report ID>&type=usage, consumedTotal in the response is the total deduction for that reply or report, including platform processing fees; for which deductions are counted, see the description of Query Consumption Records.

Parameters

Parameter Name
Required
Type
Description

category

❌

string

Credit item category (e.g. llm_token, platform_fee); agent_memory selects the AI memory lines, which llm_token then leaves out

endDate

❌

string

End date (inclusive, whole day in the platform timezone Asia/Taipei), format: YYYY-MM-DD

search

❌

string

Case-insensitive match against transaction description and metadata

startDate

❌

string

Start date (inclusive, whole day in the platform timezone Asia/Taipei), format: YYYY-MM-DD

type

❌

string

Which rows to include: all ledger entries, consumption only, or credited only

Code Examples

Response Body

Status Code: 200

Example Response Schema

Example Response Values


Query Credit Usage by Category

GET /api/v1/organizations/{organizationPk}/usage-statistics/credit-categories/

Required permissions: Usage statistics permission. Billing mode: The organization must use Credit billing.

Parameters

Parameter Name
Required
Type
Description

organizationPk

✅

string

A UUID string identifying this organization ID

endDate

❌

string

End date, format: YYYY-MM-DD

page

❌

integer

A page number within the paginated result set.

pageSize

❌

integer

Number of results to return per page.

startDate

✅

string

Start date, format: YYYY-MM-DD

timeGranularity

❌

string

Time granularity (hour/day/month)

Code Examples

Response

Status Code: 200

Example Response Schema

Example Response Values


Retrieve Credit Usage for a Single Category

GET /api/v1/organizations/{organizationPk}/usage-statistics/credit-categories/{id}/

Required permissions: Usage statistics permission. Billing mode: The organization must use Credit billing.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

organizationPk

✅

string

A UUID string identifying this organization ID

endDate

❌

string

End date, format: YYYY-MM-DD

startDate

✅

string

Start date, format: YYYY-MM-DD

timeGranularity

❌

string

Time granularity (hour/day/month)

Code Examples

Response

Status Code: 200

Example Response Schema

Example Response Values


Retrieve Member Usage for a Billable Item

GET /api/v1/organizations/{organizationPk}/usage-statistics/credit-categories/{itemPk}/members/

Required permissions: Usage statistics permission. Billing mode: The organization must use Credit billing.

Parameters

Parameter Name
Required
Type
Description

itemPk

✅

string

organizationPk

✅

string

A UUID string identifying this organization ID

endDate

❌

string

End date, format: YYYY-MM-DD

page

❌

integer

A page number within the paginated result set.

pageSize

❌

integer

Number of results to return per page.

startDate

✅

string

Start date, format: YYYY-MM-DD

timeGranularity

❌

string

Time granularity (hour/day/month)

Code Examples

Response

Status Code: 200

Example Response Schema

Example Response Values


Retrieve Billable Item Usage for a Single Member

GET /api/v1/organizations/{organizationPk}/usage-statistics/credit-categories/{itemPk}/members/{id}/

Required permissions: Usage statistics permission. Billing mode: The organization must use Credit billing.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

itemPk

✅

string

organizationPk

✅

string

A UUID string identifying this organization ID

endDate

❌

string

End date, format: YYYY-MM-DD

startDate

✅

string

Start date, format: YYYY-MM-DD

timeGranularity

❌

string

Time granularity (hour/day/month)

Code Examples

Response

Status Code: 200

Example Response Schema

Example Response Values


Retrieve Default Quota Settings for New Members

GET /api/v1/credit/wallets/{id}/new-member-quota-policy/

Required permissions: Credit management permissions. Billing mode: Any. The path parameter id is the wallet ID (creditWallet.id in the GET /api/v1/organizations/{id}/ response). Response fields: newMemberQuotaEnabled (whether to allocate quotas automatically), newMemberQuotaLimit (quota limit), newMemberQuotaValidDays (number of days the quota is valid from the date the member joins; null means no expiration), newMemberQuotaResetPeriod (usage reset interval), newMemberQuotaNote (note), and requireQuotaBeforeConsumption (whether to block usage when a new member has no quota).

Parameters

Parameter Name
Required
Type
Description

id

✅

string

A UUID string identifying this Credit Wallet.

Code Examples

Response Body

Status Code: 200

Example Response Schema

Example Response Values


Update Default Quota Settings for New Members

PATCH /api/v1/credit/wallets/{id}/new-member-quota-policy/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing; otherwise, the API returns 400. Send only the fields to update. The fields are the same as those returned when retrieving the settings: newMemberQuotaLimit must not be negative and must have a value when newMemberQuotaEnabled is enabled; newMemberQuotaValidDays must be between 1 and 3650, or null. Once enabled, members who subsequently join through invitations, directory synchronization, SSO, or import automatically receive a personal quota that takes effect when they join. When a validity period is set, the expiration time cannot be later than the expiration date of the organization’s most recently credited quota (null means no expiration). If an invitation includes creditQuota, the quota specified in the invitation takes precedence (these defaults apply if the specified quota has expired or allocation fails). When requireQuotaBeforeConsumption is enabled, new members who have not received a quota cannot use features that consume Credit until a quota is allocated to them. Changing these settings does not affect previously allocated quotas or existing members. Response: message and config (the updated settings).

Parameters

Parameter Name
Required
Type
Description

id

✅

string

A UUID string identifying this Credit Wallet.

Request Body

Request Parameters

Field
Type
Required
Description

newMemberQuotaEnabled

boolean

No

newMemberQuotaLimit

string (decimal)

No

newMemberQuotaValidDays

integer

No

newMemberQuotaResetPeriod

string (enum: none, daily, weekly, monthly)

No

none: No Reset ; daily: Daily ; weekly: Weekly ; monthly: Monthly;

newMemberQuotaNote

string

No

requireQuotaBeforeConsumption

boolean

No

Example Request Schema

Example Request Values

Code Examples

Response Body

Status Code: 200

Example Response Schema

Example Response Values

Status Code: 400 - Validation failed, or the organization is not on credit billing.


List Current Member Quotas

GET /api/v1/organizations/{organizationPk}/credit-quota-members/

Required permissions: Credit management permission. Billing mode: The organization must use Credit billing.

Parameters

Parameter Name
Required
Type
Description

organizationPk

✅

string

A UUID string identifying this organization ID

ordering

❌

string

Sort field (default '-created_at')

page

❌

integer

Page number

pageSize

❌

integer

Rows per page (max 100)

quotaStatus

❌

string

Filter by quota status

search

❌

string

Filter by member name, email, or member ID (case-insensitive substring)

Code Examples

Response

Status Code: 200

Example Response Schema

Example Response Values


List Current Role Quotas

GET /api/v1/organizations/{organizationPk}/credit-quota-groups/

Required permissions: Credit management permission. Billing mode: The organization must use Credit billing.

Parameters

Parameter Name
Required
Type
Description

organizationPk

✅

string

A UUID string identifying this organization ID

ordering

❌

string

Sort field (default '-created_at')

page

❌

integer

Page number

pageSize

❌

integer

Rows per page (max 100)

quotaStatus

❌

string

Filter by quota status

search

❌

string

Filter by group name or group ID (case-insensitive substring)

Code Examples

Response Body

Status Code: 200

Example Response Structure

Example Response Values


List Current Conversation Platform Quotas

GET /api/v1/organizations/{organizationPk}/credit-quota-inboxes/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing.

Parameters

Parameter Name
Required
Type
Description

organizationPk

✅

string

A UUID string identifying this organization ID

excludeBuiltIn

❌

boolean

When true, excludes data for official built-in Agents (locked instances created by renting from the Agent Marketplace), leaving only assistants created by the organization. Copies created with “Copy as Custom” count as organization-created assistants. Omitting this parameter or setting it to false leaves the results unfiltered by this condition.

ordering

❌

string

Which field to use when ordering the results.

page

❌

integer

A page number within the paginated result set.

pageSize

❌

integer

Number of results to return per page.

search

❌

string

A search term.

Code Examples

Response

Status Code: 200

Example Response Schema

Example Response Values


List Member Quota Settings

GET /api/v1/organizations/{organizationPk}/members/{memberPk}/credit-quotas/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing.

Parameters

Parameter Name
Required
Type
Description

memberPk

✅

string

organizationPk

✅

string

A UUID string identifying this organization ID

page

❌

integer

A page number within the paginated result set.

pageSize

❌

integer

Number of results to return per page.

Code Examples

Response Body

Status Code: 200

Example Response Structure

Example Response Values


Retrieve a Member Quota Setting

GET /api/v1/organizations/{organizationPk}/members/{memberPk}/credit-quotas/{id}/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

memberPk

✅

string

organizationPk

✅

string

A UUID string identifying this organization ID

Code Examples

Response Body

Status Code: 200

Example Response Structure

Example Response Values


Set a quota for a member

POST /api/v1/organizations/{organizationPk}/members/{memberPk}/credit-quotas/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing. See How quotas work for the request body and rules. If the member already has an active quota, the API returns 400; deactivate it first.

Parameters

Parameter name
Required
Type
Description

memberPk

✅

string

organizationPk

✅

string

A UUID string identifying this organization ID

Request body

Request parameters

Field
Type
Required
Description

quotaLimit

string (decimal)

Yes

validFrom

string (date-time)

Yes

validUntil

string (date-time)

No

note

string

No

resetPeriod

object

No

Example request schema

Example request values

Code examples

Response body

Status code: 201

Example response schema

Example response values


Update a member's quota settings

PATCH /api/v1/organizations/{organizationPk}/members/{memberPk}/credit-quotas/{id}/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing. Send only the fields to update: quotaLimit, validUntil, resetPeriod, and note (the start time cannot be changed). quotaLimit cannot be lower than the amount already consumed. Deactivated quotas cannot be updated; the API returns 400.

Parameters

Parameter name
Required
Type
Description

id

✅

string

memberPk

✅

string

organizationPk

✅

string

A UUID string identifying this organization ID

Request body

Request parameters

Field
Type
Required
Description

quotaLimit

string (decimal)

No

validUntil

string (date-time)

No

note

string

No

resetPeriod

string (enum: none, daily, weekly, monthly)

No

none: No Reset ; daily: Daily ; weekly: Weekly ; monthly: Monthly;

Example request schema

Example request values

Code examples

Response body

Status code: 200

Example response schema

Example response values


Deactivate a Member's Quota

DELETE /api/v1/organizations/{organizationPk}/members/{memberPk}/credit-quotas/{id}/

Required permission: Credit management permission. Billing mode: The organization must use the Credit billing mode. Returns 204 on success. After deactivation, the member's "Quota required" setting remains on, so the member cannot use Credit-consuming features until a new quota is set or the quota restriction is removed; deactivating an already deactivated quota returns 400.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

memberPk

✅

string

organizationPk

✅

string

A UUID string identifying this Organization ID

Code Examples

Response

Status Code
Description

204

No response body


List Role Quota Settings

GET /api/v1/organizations/{organizationPk}/groups/{groupPk}/credit-quotas/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing.

Parameters

Parameter Name
Required
Type
Description

groupPk

✅

string

organizationPk

✅

string

A UUID string identifying this organization ID

page

❌

integer

A page number within the paginated result set.

pageSize

❌

integer

Number of results to return per page.

Code Examples

Response Body

Status Code: 200

Response Schema Example

Example Response Values


Retrieve a Role Quota Setting

GET /api/v1/organizations/{organizationPk}/groups/{groupPk}/credit-quotas/{id}/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing.

Parameters

Parameter Name
Required
Type
Description

groupPk

✅

string

id

✅

string

organizationPk

✅

string

A UUID string identifying this organization ID

Code Examples

Response Body

Status Code: 200

Response Schema Example

Example Response Values


Set a quota for a role

POST /api/v1/organizations/{organizationPk}/groups/{groupPk}/credit-quotas/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing. This sets a quota shared by all members of the role; it does not allocate quotas to individual members. To assign a separate quota to each member, use Batch allocate quotas by role. See How quotas work for the request body and rules. If the role already has an active quota, the API returns 400; deactivate it first.

Parameters

Parameter name
Required
Type
Description

groupPk

✅

string

organizationPk

✅

string

A UUID string identifying this organization ID

Request body

Request parameters

Field
Type
Required
Description

quotaLimit

string (decimal)

Yes

validFrom

string (date-time)

Yes

validUntil

string (date-time)

No

note

string

No

resetPeriod

object

No

Request schema example

Example request values

Code examples

Response body

Status code: 201

Response schema example

Example response values


Update quota settings for a role

PATCH /api/v1/organizations/{organizationPk}/groups/{groupPk}/credit-quotas/{id}/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing. Send only the fields you want to change: quotaLimit, validUntil, resetPeriod, and note (the start time cannot be changed). quotaLimit cannot be lower than the amount already consumed. Deactivated quotas cannot be updated; the API returns 400.

Parameters

Parameter name
Required
Type
Description

groupPk

✅

string

id

✅

string

organizationPk

✅

string

A UUID string identifying this organization ID

Request body

Request parameters

Field
Type
Required
Description

quotaLimit

string (decimal)

No

validUntil

string (date-time)

No

note

string

No

resetPeriod

string (enum: none, daily, weekly, monthly)

No

none: No Reset ; daily: Daily ; weekly: Weekly ; monthly: Monthly;

Request schema example

Example request values

Code examples

Response body

Status code: 200

Response schema example

Example response values


Deactivate a Role's Quota Settings

DELETE /api/v1/organizations/{organizationPk}/groups/{groupPk}/credit-quotas/{id}/

Required permission: Credit Management. Billing mode: The organization must use the Credit billing mode. Returns 204 on success. After deactivation, the role's "quota required" setting stays on, so members of the role cannot use features that consume Credits until a new quota is set or the quota restriction is lifted. Deactivating an already deactivated quota returns 400.

Parameters

Parameter Name
Required
Type
Description

groupPk

✅

string

id

✅

string

organizationPk

✅

string

A UUID string identifying this Organization ID

Code Examples

Response Content

Status Code
Description

204

No response body


Set Whether a Role Requires a Quota

PATCH /api/v1/organizations/{organizationPk}/credit-quota-groups/{id}/credit-quota-required/

Required permission: Credit Management. Billing mode: The organization must use the Credit billing mode. The request body is {"creditQuotaRequired": true} or false, and the id in the path is the role ID. When set to false (lifting the quota restriction), the role's active quota is deactivated as well, and members use the organization wallet instead. When set to true, members of the role are blocked from using the service until a quota is set. The response shows the role's current quota status.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

A UUID string identifying this Group.

organizationPk

✅

string

A UUID string identifying this Organization ID

Code Examples

Response Content

Status code: 200

Example Response Structure

Example Response Values


Retrieve Role Member Quota Statistics

GET /api/v1/organizations/{organizationPk}/groups/{id}/credit-quota-stats/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

A UUID string identifying this Group.

organizationPk

✅

string

A UUID string identifying this organization ID

Code Examples

Response Body

Status Code: 200

Response Schema Example

Example Response Values


Batch allocate quotas by role

POST /api/v1/organizations/{organizationPk}/groups/{id}/batch-distribute-credit-quota/

Required permissions: Credit management and organization overview permissions. Billing mode: The organization must use Credit billing. Set a member quota for each member of the role, using the same request body as Set a quota for a member. Members who already have an active quota are skipped and remain unchanged. Response: successCount, skippedCount, skippedMemberIds, failedCount, failedMembers.

Parameters

Parameter name
Required
Type
Description

id

✅

string

A UUID string identifying this Group.

organizationPk

✅

string

A UUID string identifying this organization ID

Request body

Request parameters

Field
Type
Required
Description

name

string

Yes

canCreateChatbot

boolean

No

canCreateKnowledgeBase

boolean

No

canCreateInbox

boolean

No

canCreateDatabase

boolean

No

canCreateTool

boolean

No

canCreateAgentUiTool

boolean

No

canCreateSkill

boolean

No

canCreateTeam

boolean

No

Whether members of this role may create Agent Teams; the Team permission is still required.

canCreatePersonalSkill

boolean

No

Whether members of this role may create personal skills (skills only they can see and use). A member in several roles may if any of them allows it. Turning it off keeps existing personal skills but no...

canCreateVoiceAgent

boolean

No

Whether members of this role may create voice agents; the Voice Agent permission is still required.

maigptCanCodeInterpreter

boolean

No

Whether members of this role may use the code interpreter built-in tool in MaiGPT.

maigptCanRag

boolean

No

Whether members of this role may use the knowledge base RAG built-in tool in MaiGPT.

maigptCanDeepResearch

boolean

No

Whether members of this role may use Deep Research in MaiGPT. Deep Research reaches the public internet through its own built-in search, so a role that revokes the official web-search tools needs this...

maigptCanBrowserTool

boolean

No

Whether members of this role may use the browser built-in tool in MaiGPT.

maigptCanCloudDesktop

boolean

No

Whether members of this role may use the cloud desktop in MaiGPT.

maigptAllLlms

boolean

No

Whether members of this role may use every organization-available LLM in MaiGPT. Off = only the bound LLMs; an empty binding then means none.

maigptAllTools

boolean

No

Whether members of this role may call every official (global) tool in MaiGPT. Off = only the bound tools; an empty binding then means none.

maigptAllConnectors

boolean

No

Whether members of this role may call every official (global) MCP connector in MaiGPT. Off = only the bound connectors; an empty binding then means none.

maigptAllSkills

boolean

No

Whether members of this role may use every official (global) skill in MaiGPT. Off = only the bound skills; an empty binding then means none.

usageStatisticsScope

object

No

What this role's usage statistics permission shows: the whole organization, or only the AI assistants granted to the member's roles. A member with any organization-wide granting role sees the whole or...

Request structure example

Request example values

Code examples

Response content

Status code: 200

Response structure example

Response example values


Batch deactivate quotas by role

POST /api/v1/organizations/{organizationPk}/groups/{id}/batch-deactivate-credit-quota/

Required permissions: Credit management and organization overview permissions. Billing mode: The organization must use Credit billing. Deactivate active member quotas for all members of the role (these are member quotas, rather than a quota for the role itself). Members without an active quota are counted as skipped. The optional request field removeQuotaRequirement defaults to false: only quotas are deactivated, and members still have “Quota required” enabled, so they cannot use the service until quotas are allocated again. When set to true, quota restrictions are also removed for all members of the role, and they use the organization wallet instead. Response: successCount, skippedCount, skippedMemberIds, failedCount, failedMembers, requirementRemovedCount. Before running this operation, use Get role member quota statistics to check how many members will be affected.

Parameters

Parameter name
Required
Type
Description

id

✅

string

A UUID string identifying this Group.

organizationPk

✅

string

A UUID string identifying this organization ID

Request body

Request parameters

Field
Type
Required
Description

name

string

Yes

canCreateChatbot

boolean

No

canCreateKnowledgeBase

boolean

No

canCreateInbox

boolean

No

canCreateDatabase

boolean

No

canCreateTool

boolean

No

canCreateAgentUiTool

boolean

No

canCreateSkill

boolean

No

canCreateTeam

boolean

No

Whether members of this role may create Agent Teams; the Team permission is still required.

canCreatePersonalSkill

boolean

No

Whether members of this role may create personal skills (skills only they can see and use). A member in several roles may if any of them allows it. Turning it off keeps existing personal skills but no...

canCreateVoiceAgent

boolean

No

Whether members of this role may create voice agents; the Voice Agent permission is still required.

maigptCanCodeInterpreter

boolean

No

Whether members of this role may use the code interpreter built-in tool in MaiGPT.

maigptCanRag

boolean

No

Whether members of this role may use the knowledge base RAG built-in tool in MaiGPT.

maigptCanDeepResearch

boolean

No

Whether members of this role may use Deep Research in MaiGPT. Deep Research reaches the public internet through its own built-in search, so a role that revokes the official web-search tools needs this...

maigptCanBrowserTool

boolean

No

Whether members of this role may use the browser built-in tool in MaiGPT.

maigptCanCloudDesktop

boolean

No

Whether members of this role may use the cloud desktop in MaiGPT.

maigptAllLlms

boolean

No

Whether members of this role may use every organization-available LLM in MaiGPT. Off = only the bound LLMs; an empty binding then means none.

maigptAllTools

boolean

No

Whether members of this role may call every official (global) tool in MaiGPT. Off = only the bound tools; an empty binding then means none.

maigptAllConnectors

boolean

No

Whether members of this role may call every official (global) MCP connector in MaiGPT. Off = only the bound connectors; an empty binding then means none.

maigptAllSkills

boolean

No

Whether members of this role may use every official (global) skill in MaiGPT. Off = only the bound skills; an empty binding then means none.

usageStatisticsScope

object

No

What this role's usage statistics permission shows: the whole organization, or only the AI assistants granted to the member's roles. A member with any organization-wide granting role sees the whole or...

Request structure example

Example Request Values

Code Examples

Response

Status Code: 200

Example Response Structure

Example Response Values


List credit quotas for an inbox

GET /api/v1/inboxes/{inboxPk}/credit-quotas/

Required permission: Credit management permission. Billing mode: The organization must use Credit billing. Includes deactivated quotas, ordered from newest to oldest.

Parameters

Parameter name
Required
Type
Description

inboxPk

✅

string

page

❌

integer

A page number within the paginated result set.

pageSize

❌

integer

Number of results to return per page.

Code examples

Response body

Status code: 200

Example response schema

Example response values

Status code: 4XX - Error response; X-Error-Code carries its code (see "Error codes").


Retrieve a credit quota for an inbox

GET /api/v1/inboxes/{inboxPk}/credit-quotas/{id}/

Required permission: Credit management permission. Billing mode: The organization must use Credit billing.

Parameters

Parameter name
Required
Type
Description

id

✅

string

inboxPk

✅

string

Code examples

Response body

Status code: 200

Example response schema

Example response values

Status code: 4XX - Error response; X-Error-Code carries its code (see "Error codes").


Set a credit quota for an inbox

POST /api/v1/inboxes/{inboxPk}/credit-quotas/

Required permission: Credit management permission. Billing mode: The organization must use Credit billing. See How credit quotas work for the request body and rules. If the inbox already has an active quota, the API returns 400; deactivate it first. Quotas cannot be set for MaiGPT inboxes; the API returns 400.

Parameters

Parameter name
Required
Type
Description

inboxPk

✅

string

Request body

Request parameters

Field
Type
Required
Description

quotaLimit

string (decimal)

Yes

validFrom

string (date-time)

Yes

validUntil

string (date-time)

No

note

string

No

resetPeriod

object

No

Example request schema

Example request values

Code examples

Response Body

Status Code: 201

Example Response Schema

Example Response Values

Status Code: 4XX - Error response; X-Error-Code carries its code (see "Error codes").


Update Inbox Quota Settings

PATCH /api/v1/inboxes/{inboxPk}/credit-quotas/{id}/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing. Send only the fields to update: quotaLimit, validUntil, resetPeriod, and note (the effective start time cannot be changed). quotaLimit cannot be lower than the amount already consumed. Updating a deactivated quota returns 400.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

inboxPk

✅

string

Request Body

Request Parameters

Field
Type
Required
Description

quotaLimit

string (decimal)

No

validUntil

string (date-time)

No

note

string

No

resetPeriod

string (enum: none, daily, weekly, monthly)

No

none: No Reset ; daily: Daily ; weekly: Weekly ; monthly: Monthly;

Example Request Schema

Example Request Values

Code Examples

Response Body

Status Code: 200

Example Response Schema

Example Response Values

Status Code: 4XX - Error response; X-Error-Code carries its code (see "Error codes").


Deactivate Inbox Quota Settings

DELETE /api/v1/inboxes/{inboxPk}/credit-quotas/{id}/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing. Returns 204 on success. After deactivation, the inbox still requires a quota, so AI replies are paused until a new quota is configured or the quota requirement is removed. Deactivating an already deactivated quota returns 400.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

inboxPk

✅

string

Code Examples

Response Body

Status Code
Description

204

No response body

4XX

Error response; X-Error-Code carries its code (see "Error codes").


Set Whether an Inbox Requires a Quota

PATCH /api/v1/organizations/{organizationPk}/credit-quota-inboxes/{id}/credit-quota-required/

Required permissions: Credit management permissions. Billing mode: The organization must use Credit billing. Set creditQuotaRequired to true or false in the request body, for example {"creditQuotaRequired": true}. The path parameter id is the inbox ID. Setting it to false removes the quota requirement and deactivates any active quota; AI replies then use the organization wallet. Setting it to true pauses AI replies in the inbox until a quota is configured. The response contains the current quota status of the inbox.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

organizationPk

✅

string

A UUID string identifying this organization ID

Code Examples

Response Body

Status Code: 200

Example Response Schema

Example Response Values


Query your own quota

GET /api/v1/organizations/{organizationPk}/me/credit-quota/

Required permissions: No additional permissions are required. Any organization member can query their own quota. Billing mode: The organization must use Credit billing.

Parameters

Parameter name
Required
Type
Description

organizationPk

✅

string

A UUID string identifying this organization ID

Code examples

Response body

Status code
Description

200

No response body


Query the quotas of your roles

GET /api/v1/organizations/{organizationPk}/me/group-credit-quotas/

Required permissions: No additional permissions are required. Any organization member can query their own quota. Billing mode: The organization must use Credit billing.

Parameters

Parameter name
Required
Type
Description

organizationPk

✅

string

A UUID string identifying this organization ID

Code examples

Response body

Status code
Description

200

No response body


List pricing rules

GET /api/v1/credit/pricing-rules/

No authentication required: This endpoint can be called without an API Key. Rate limit: 60 requests per minute per source IP. Exceeding the limit returns HTTP 429.

Code examples

Response body

Status code: 200

Example response structure

Example response values


Retrieve a pricing rule

GET /api/v1/credit/pricing-rules/{id}/

No authentication required: This endpoint can be called without an API Key. Rate limit: 60 requests per minute per source IP. Exceeding the limit returns HTTP 429.

Parameters

Parameter name
Required
Type
Description

id

✅

string

A UUID string identifying this Credit Pricing Rule.

Code examples

Response Content

Status Code: 200

Example Response Schema

Example Response Values


List Credit Items

GET /api/v1/credit/items/

No login required: Call this endpoint without an API Key. Rate limit: 60 requests per minute per source IP. Exceeding this limit returns HTTP 429.

Code Examples

Response Content

Status Code: 200

Example Response Schema

Example Response Values


Retrieve a Credit Item

GET /api/v1/credit/items/{id}/

No login required: Call this endpoint without an API Key. Rate limit: 60 requests per minute per source IP. Exceeding this limit returns HTTP 429.

Parameters

Parameter Name
Required
Type
Description

id

✅

string

A UUID string identifying this Credit Item.

Code Examples

Response Content

Status Code: 200

Example Response Schema

Example Response Values


Last updated

Was this helpful?