List Rate Limit Policies
GET /environments/{env_id}/rate_limits
GET /environments/{env_id}/rate_limitsInteractive request editor loads with JavaScript.
Authorization
BearerAdminToken Organization-scoped admin token. Read operations require a valid token, and write operations require a token with write permission.
In: header
Path Parameters
Environment ID that scopes the request.
uuidQuery Parameters
Return only classic-form policies with the given scope.
Accepts the same values as the policy scope field.
Return only policies involving the given dimension —
referenced by a condition leaf or group_by entry, or (for
classic-form policies) implied by the scope (team_member
involves team and member).
Case-insensitive substring search over the policy name.
1-based page number. Requires page_size on the same
request.
1 <= value <= 10000000Page size. Values above 200 are clamped to 200. Omit to return the full list.
1 <= valueResponse Body
application/json
application/json
application/json
application/json
curl -X GET "$AISIX_CP/environments/$ENV_ID/rate_limits" \ -H "Authorization: Bearer $AISIX_TOKEN"OK
{
"data": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"env_id": "3f917d0d-4dff-42f3-97c4-6a5455dfe8c2",
"name": "string",
"scope": "api_key",
"scope_ref": "fd2cd345-6167-46ad-9a1c-db888c907bfa",
"window": "second",
"max_requests": 0,
"max_tokens": 0,
"schedules": [
{
"timezone": "string",
"days_of_week": [
"mon"
],
"dates": [
"string"
],
"start_time": "string",
"end_time": "string"
}
],
"conditions": [
{
"dimension": "team",
"operator": "==",
"negate": true,
"value": "string",
"logic": "and",
"children": [
{}
]
}
],
"group_by": [
"team"
],
"limits": {
"rps": 1,
"rpm": 1,
"rph": 1,
"rpd": 1,
"tpm": 1,
"tpd": 1,
"concurrency": 1
},
"action": "reject",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"total": 0,
"page": 0,
"page_size": 0
}Request body or parameters failed validation.
{
"error": {
"code": "string",
"message": "string"
}
}Missing or invalid bearer.
{
"error": {
"code": "UNAUTHENTICATED",
"message": "no org context"
}
}Resource not found.
{
"error": {
"code": "NOT_FOUND",
"message": "provider key not found"
}
}Complete operation details and schema variants
GET /environments/{env_id}/rate_limits
List Rate Limit Policies
List rate limit policies in an environment. Pagination is
opt-in: omit page_size to get the full policy list in one
response. page is only meaningful together with page_size
and is rejected without it.
Parameters
-
env_id(path, string, required): Environment ID that scopes the request. -
scope(query, string, optional): Return only classic-form policies with the given scope. Accepts the same values as the policyscopefield. -
dimension(query, string, optional): Return only policies involving the given dimension — referenced by a condition leaf orgroup_byentry, or (for classic-form policies) implied by the scope (team_memberinvolvesteamandmember). -
q(query, string, optional): Case-insensitive substring search over the policy name. -
page(query, integer, optional): 1-based page number. Requirespage_sizeon the same request. -
page_size(query, integer, optional): Page size. Values above 200 are clamped to 200. Omit to return the full list.
Responses
-
200: OK -
data(array, required): Rate limit policies, oldest first. -
data[].id(string, required): Rate limit policy ID. -
data[].env_id(string, required): Environment ID that owns this policy. -
data[].name(string, required): Human-readable policy name. -
data[].scope(object, required): -
allOf variant 1
-
data[].scope_ref(string, required): ID of the resource the policy applies to, matchingscope: a caller API key ID, model ID, team ID, or member ID.team_memberpolicies reference a team ID. Fixed at creation.nullon conditional-form policies. -
data[].window(object, required): -
allOf variant 1
-
data[].max_requests(integer, required): Maximum number of requests allowed per window.nullwhen the policy has no request cap. -
data[].max_tokens(integer, required): Maximum total tokens consumed per window.nullwhen the policy has no token cap. -
data[].schedules(array, required): Recurring suspension windows: while the current time falls in any listed window the gateway skips this policy, and enforcement resumes automatically afterwards. Empty when the policy is always enforced. Present on both policy forms. -
data[].schedules[].timezone(string, required): IANA timezone the wall-clock fields are interpreted in (e.g.Asia/Shanghai). -
data[].schedules[].days_of_week(array, optional): Weekly selector: the window opens on each listed day. Mutually exclusive withdates. -
data[].schedules[].dates(array, optional): Explicit calendar dates (YYYY-MM-DD, intimezone) the window opens on — for holidays and other irregular days. Mutually exclusive withdays_of_week. -
data[].schedules[].start_time(string, required): Window start,HH:MMwall clock (inclusive). -
data[].schedules[].end_time(string, required): Window end,HH:MMwall clock (exclusive);24:00means end of day. Must differ fromstart_time; an end before the start crosses into the following day. -
oneOf variant 1
-
oneOf variant 2
-
data[].conditions(array, optional): Condition node tree the request must satisfy (top-level nodes combine as AND; an empty list matches every request in the environment). Conditional form only. -
data[].conditions[].dimension(string, optional): Request dimension a condition leaf matches on. Identity dimensions carry resource UUIDs (team,member,api_key,model) and admit the equality/set operators; the string dimensionsmodel_name(model display name) andprovideradditionally admit the regex operators.
model and model_name match the dispatched model and — when
the caller addressed a routing group, semantic router, or
ensemble — the addressed parent as well. Either identity
satisfies a positive operator (==/in/regex): a group's own
id selects every request routed through it, and a member's id
selects that member whether called directly or through a
group. ~= is true only when BOTH identities differ
(preserving a ~= b = !(a == b)), and negate inverts the
combined leaf result — so a negated in excludes a
request when either identity is listed, and negate + ~=
matches when either identity equals the value.
-
data[].conditions[].operator(string, optional): Condition operator, mirroring lua-resty-expr tokens.==/~=compare equal/not-equal,intests list membership,~~/~*are case-sensitive/insensitive regexes (string dimensions only).has, the numeric comparisons andipmatchare reserved for future dimensions and rejected on every current one. -
data[].conditions[].negate(boolean, optional): Invert the leaf (lua-resty-expr!, e.g.negate+in= "not in") or the group (!AND/!OR). A request missing the leaf's dimension matches neither the condition nor its negation. -
data[].conditions[].value(object, optional): Comparison value:intakes 1–64 strings, every other operator a single string. Identity dimensions take resource UUIDs;model_nametakes display-name strings or (for~~/~*) a regex of at most 256 characters;providertakes provider catalog ids. -
oneOf variant 1
-
oneOf variant 2
-
data[].conditions[].logic(string, optional): Group combinator — lua-resty-exprAND/OR. -
data[].conditions[].children(array, optional): Nested condition nodes (group shape only). -
data[].group_by(array, optional): Dimensions the counters split on; empty = one shared bucket for every matched request. Conditional form only. -
data[].limits(object, optional): Conditional-form limits — the same 7-field shape as the inline model / API-key rate limits. At least one field must be set. -
data[].limits.rps(integer, optional): Requests per second. -
data[].limits.rpm(integer, optional): Requests per minute. -
data[].limits.rph(integer, optional): Requests per hour. -
data[].limits.rpd(integer, optional): Requests per day. -
data[].limits.tpm(integer, optional): Total tokens per minute. -
data[].limits.tpd(integer, optional): Total tokens per day. -
data[].limits.concurrency(integer, optional): Maximum concurrent in-flight requests. Capped at the data plane's 32-bit counter range. -
data[].action(string, optional): What the policy does past its limits. Onlyreject(HTTP 429) is available; the field reserves the enum for future actions. -
data[].created_at(string, required): Time when the policy was created. -
data[].updated_at(string, required): Time when the policy was last updated. -
total(integer, optional): Total number of matching policies across all pages. -
page(integer, optional): Current 1-based page. -
page_size(integer, optional): Effective page size after clamping. -
400: Request body or parameters failed validation. -
error(object, required): Error details. -
error.code(string, required): Machine-readable identifier. Examples:UNAUTHENTICATED,INVALID_REQUEST,MASTER_KEY_UNSET,INTERNAL. -
error.message(string, required): Human-readable explanation; safe to surface to operators. -
401: Missing or invalid bearer. Response fields (application/json): identical toGET /environments/{env_id}/rate_limits, response 400 above. -
404: Resource not found. Response fields (application/json): identical toGET /environments/{env_id}/rate_limits, response 400 above.
cURL
curl -X GET '$AISIX_CP/environments/{env_id}/rate_limits' -H 'Authorization: Bearer $AISIX_TOKEN'