put
https://api.aurorasendcloud.com/editor-plugin/resource/ai/end-user-quota-limit
Sets a periodic AI credit limit for an End User. The limit rule is stored in Redis;
actual consumption is sourced from ss_ai_message. After saving the rule, the endpoint
immediately aggregates the database consumption within the new period and returns the
quota status.
Semantics:
- The period is a left-closed, right-open interval
[startTime, endTime), i.e.
message_time >= startTime AND message_time < endTime. maximumLimitCreditsmust be a JSON integer >= 0. Decimals and strings are rejected.
When it is 0, the End User is not allowed to use AI regardless of historical usage.- One End User keeps only one active rule. A subsequent PUT overwrites the previous rule
and recomputes usage against the new period. - The rule is scoped by
applicationId + endUserIdand is independent of login tokens;
multiple sessions share the same rule and the same aggregated consumption. usedCreditsisROUND(SUM(ss_ai_message.total_credits))within the period. All quota
fields are integers.
Enforcement:
- The End User quota enforcement is gated by the
AI_END_USER_QUOTAcapability. When the
capability is notenabled, AI calls only check the Application shared pool and the
End User quota rule is ignored. - When enforcement is enabled, the quota rule is checked on every AI call. A missing,
not-yet-started, expired, or used-up rule blocks the AI call and returns the
correspondingendUserAiQuota*error below. Account users are not affected by End
User quota and never receive these errors. - The
endUserAiQuota*errors are returned only when an AI call is made under an
End User token after enforcement is enabled; the PUT endpoint itself does not return
them for rule validation failures (those returninvalidParameteror
aiQuotaEvaluationFailed).
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
