API7 Docs
API7 GatewayAPI7 Enterprise Admin APIsList AI API keys in a group

List AI API keys in a group

GET /aisix/admin/apikeys

GET /aisix/admin/apikeys

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Query Parameters

ai_gateway_group_id*string

AI Gateway group ID (filter resources by group).

Length1 <= length
direction?string

Order to list the resources by. The sorting index follows the configuration of order_by.

Default"desc"

Value in

  • "asc"
  • "desc"
page_size?integer

Number of resources listed per page. Used together with page. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.

Formatint32
Range1 <= value
page?integer

Page number of the listed resources. Used together with page_size. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.

Formatint32
Range1 <= value
order_by?string

Index to order AI API keys by.

Default"updated_at"

Value in

  • "name"
  • "created_at"
  • "updated_at"

Response Body

application/json

application/json

curl -X GET "$API_BASE_URL/aisix/admin/apikeys?ai_gateway_group_id=abc1234567890"

Successfully retrieved the paginated list of AI API keys.

{
  "total": 1,
  "list": [
    {
      "id": "apikey-abc123",
      "ai_gateway_group_id": "group-abc123",
      "name": "my-app-key",
      "key": "my-secret-key-value",
      "allowed_models": [
        "openai/gpt-4o"
      ],
      "rate_limit": {
        "tpm": 1,
        "tpd": 1,
        "rpm": 1,
        "rpd": 1,
        "concurrency": 1
      },
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ]
}
Complete operation details and schema variants

GET /aisix/admin/apikeys

List AI API keys in a group

IAM Action: ai_gateway:ListAIAPIKeys, Resource: arn:api7:ai_gateway:aigatewaygroup/%s Returns all AI API key configurations in the specified AI Gateway group.

Parameters

  • ai_gateway_group_id (query, string, required): AI Gateway group ID (filter resources by group).
  • direction (query, string, optional): Order to list the resources by. The sorting index follows the configuration of order_by.
  • page_size (query, integer, optional): Number of resources listed per page. Used together with page. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.
  • page (query, integer, optional): Page number of the listed resources. Used together with page_size. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.
  • order_by (query, string, optional): Index to order AI API keys by.

Responses

  • 200: Successfully retrieved the paginated list of AI API keys.
  • allOf variant 1
  • list (array, optional): An array of resources.
  • total (integer, optional): Total number of objects.
  • allOf variant 2
  • list (array, optional): An array of AI API keys.
  • list[].id (string, optional): Unique API key ID.
  • list[].ai_gateway_group_id (string, optional): ID of the AI Gateway group this API key belongs to (control-plane only).
  • list[].name (string, optional): Optional human-readable label for the API key (control-plane only, not written to etcd).
  • list[].key (string, optional): The secret key value used for authentication.
  • list[].allowed_models (array, optional): List of model names this key is permitted to access (strict whitelist). An empty array means the key cannot access any model.
  • list[].rate_limit (object, optional): Rate limit configuration for AI requests. Field names use the abbreviated forms that match aisix's internal representation (tpm/tpd/rpm/rpd/concurrency).
  • list[].rate_limit.tpm (integer, optional): Maximum tokens allowed per minute (token_per_minute).
  • list[].rate_limit.tpd (integer, optional): Maximum tokens allowed per day (token_per_day).
  • list[].rate_limit.rpm (integer, optional): Maximum requests allowed per minute (request_per_minute).
  • list[].rate_limit.rpd (integer, optional): Maximum requests allowed per day (request_per_day).
  • list[].rate_limit.concurrency (integer, optional): Maximum concurrent requests allowed.
  • list[].created_at (string, optional): Timestamp when the API key was created.
  • list[].updated_at (string, optional): Timestamp when the API key was last updated.
  • 400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.
  • value (object, optional): The specific resource.
  • error_msg (string, optional): The error message.

cURL

curl -X GET '$API_BASE_URL/aisix/admin/apikeys'