> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API 키 목록

> CometAPI GET /api/token/을 사용해 인증된 계정의 API 키를 페이지네이션과 함께 조회합니다.

이 엔드포인트를 사용해 인증된 CometAPI 계정에 속한 API 키를 조회할 수 있습니다. 가장 최근에 생성된 키가 먼저 반환됩니다.

<Note>
  [Console → Personal Settings](https://www.cometapi.com/console/personal)에서 personal access token을 생성한 다음, 이를 가공하지 않은 `Authorization` 헤더 값으로 전송하세요. `Bearer` 접두사는 붙이지 마세요.
</Note>

## 페이지네이션

| Query parameter | Description                                 |
| --------------- | ------------------------------------------- |
| `p`             | 페이지 번호입니다. 기본값은 `1`입니다.                     |
| `page_size`     | 페이지당 항목 수입니다. `100`을 초과하는 값은 `100`으로 제한됩니다. |

## API 키 상태

| Status | Meaning |
| ------ | ------- |
| `1`    | 활성화됨    |
| `2`    | 비활성화됨   |
| `3`    | 만료됨     |
| `4`    | 소진됨     |

## 반환 필드

| Field                  | Type           | Description                                                                                                                       |
| ---------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `id`                   | integer        | 숫자형 API 키 ID입니다. 이 값은 [단일 API 키 조회](./get-api-key), [API 키 업데이트](./update-api-key), [API 키 삭제](./delete-api-key)와 함께 사용합니다.       |
| `key`                  | string         | 관리 API에서 반환되는 API 키 값입니다. 비밀 값으로 취급하고, 모델 요청에는 `Authorization: Bearer $COMETAPI_KEY`로 사용하세요.                                      |
| `status`               | integer        | 운영 상태입니다. `1`인 경우에만 해당 키가 모델 요청에 대해 활성화되어 있음을 의미합니다.                                                                              |
| `name`                 | string         | 사용자가 읽을 수 있는 키의 표시 이름입니다.                                                                                                         |
| `created_time`         | integer        | 키가 생성된 시점의 초 단위 Unix timestamp입니다.                                                                                                |
| `accessed_time`        | integer        | 키가 마지막으로 사용된 시점의 초 단위 Unix timestamp입니다.                                                                                          |
| `expired_time`         | integer        | 키가 만료되는 시점의 초 단위 Unix timestamp입니다. `-1`은 만료되지 않음을 의미합니다.                                                                         |
| `remain_quota`         | integer        | CometAPI 내부 quota 단위 기준 남은 quota입니다.                                                                                              |
| `used_quota`           | integer        | 이 키가 이미 사용한 CometAPI 내부 quota 단위 기준 quota입니다.                                                                                     |
| `unlimited_quota`      | boolean        | 이 키가 남은 quota 검사 우회 여부입니다.                                                                                                        |
| `model_limits_enabled` | boolean        | 이 키에 대해 모델 제한이 활성화되어 있는지 여부입니다.                                                                                                   |
| `model_limits`         | string         | `model_limits_enabled`가 `true`일 때 이 키에 허용된 model ID의 쉼표로 구분된 목록입니다. 비어 있으면 구성된 모델 목록이 없음을 의미합니다.                                  |
| `allow_ips`            | string or null | IP 허용 목록으로, 줄바꿈으로 구분된 하나의 문자열입니다. 각 항목은 단일 IPv4 주소, 단일 IPv6 주소, IPv4 CIDR 또는 IPv6 CIDR일 수 있습니다. `null` 또는 `""`는 IP 제한이 없음을 의미합니다. |
| `group`                | string         | 계정 그룹 제한입니다. 비어 있으면 명시적인 그룹 제한이 없음을 의미합니다.                                                                                        |
| `cross_group_retry`    | boolean        | 자동 그룹 라우팅을 위한 cross-group retry 활성화 여부입니다.                                                                                        |


## OpenAPI

````yaml api/openapi/api-keys/list-api-keys.openapi.json GET /api/token/
openapi: 3.1.0
info:
  title: List API Keys
  version: 1.0.0
servers:
  - url: https://api.cometapi.com
security:
  - accessTokenAuth: []
paths:
  /api/token/:
    get:
      summary: List API keys
      description: >-
        List API keys for the authenticated account. The newest keys are
        returned first.
      operationId: listApiKeys
      parameters:
        - name: p
          in: query
          required: false
          description: Page number to return. Defaults to `1`.
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: page_size
          in: query
          required: false
          description: >-
            Number of keys per page. Values above `100` are capped at `100` by
            the backend.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
      responses:
        '200':
          description: Paginated API key list.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                  - data
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    required:
                      - page
                      - page_size
                      - total
                      - items
                    properties:
                      page:
                        type: integer
                      page_size:
                        type: integer
                      total:
                        type: integer
                      items:
                        type: array
                        items:
                          $ref: '#/components/schemas/ApiKey'
              examples:
                success:
                  summary: API key list
                  value:
                    success: true
                    message: ''
                    data:
                      page: 1
                      page_size: 20
                      total: 1
                      items:
                        - id: 1234
                          user_id: 5678
                          key: $COMETAPI_KEY
                          status: 1
                          name: production
                          created_time: 1766102400
                          accessed_time: 1766102400
                          expired_time: -1
                          remain_quota: 100000
                          unlimited_quota: false
                          model_limits_enabled: false
                          model_limits: ''
                          allow_ips: null
                          used_quota: 0
                          group: ''
                          cross_group_retry: false
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl "https://api.cometapi.com/api/token/?p=1&page_size=20" \
              -H "Authorization: your-access-token"
components:
  schemas:
    ApiKey:
      $ref: '#/components/schemas/ApiKeyObject'
    ApiKeyObject:
      type: object
      properties:
        id:
          type: integer
          description: >-
            Numeric API key ID. Use this value with the get, update, and delete
            endpoints.
          example: 1234
        user_id:
          type: integer
          description: Account user ID that owns the key.
          example: 5678
        key:
          type: string
          description: >-
            API key value returned by the management API. Treat it as a secret
            and use it as `Authorization: Bearer $COMETAPI_KEY` for model
            requests.
          example: $COMETAPI_KEY
        status:
          type: integer
          description: >-
            Operational status for the key. `1` means enabled, `2` disabled, `3`
            expired, and `4` exhausted. Only enabled keys are accepted by model
            endpoints.
          enum:
            - 1
            - 2
            - 3
            - 4
          example: 1
        name:
          type: string
          description: User-readable display name for the API key.
          example: production
          maxLength: 50
        created_time:
          type: integer
          description: Unix timestamp in seconds when the key was created.
          example: 1766102400
        accessed_time:
          type: integer
          description: >-
            Unix timestamp in seconds when the key was last used. Newly created
            keys may show the creation time until first use.
          example: 1766102400
        expired_time:
          type: integer
          description: >-
            Unix timestamp in seconds when the key expires. `-1` means no
            expiration.
          example: -1
        remain_quota:
          type: integer
          description: >-
            Remaining quota for this key in CometAPI internal quota units. When
            this reaches `0` and `unlimited_quota` is `false`, model requests
            are rejected as quota exhausted.
          example: 100000
        unlimited_quota:
          type: boolean
          description: Whether the key bypasses remaining-quota checks.
          example: false
        model_limits_enabled:
          type: boolean
          description: >-
            Whether model restrictions are active for this key. When `false`,
            `model_limits` is ignored.
          example: false
        model_limits:
          type: string
          description: >-
            Comma-separated model IDs allowed by this key when
            `model_limits_enabled` is `true`. Empty means no configured model
            list.
          example: ''
        allow_ips:
          type:
            - string
            - 'null'
          description: >-
            Optional IP allowlist stored as one newline-separated string. Each
            entry can be a single IPv4 address, single IPv6 address, IPv4 CIDR,
            or IPv6 CIDR. Example:
            `198.51.100.10\n203.0.113.0/24\n2001:db8::/32`. `null` or `""` means
            IP restrictions are disabled.
          example: |-
            198.51.100.10
            203.0.113.0/24
            2001:db8::/32
        used_quota:
          type: integer
          description: Quota already consumed by this key in CometAPI internal quota units.
          example: 0
        group:
          type: string
          description: >-
            Account group restriction for this key. Empty means no explicit
            group restriction.
          example: ''
        cross_group_retry:
          type: boolean
          description: >-
            Whether cross-group retry is enabled for automatic group routing.
            This is only meaningful when the key uses an auto-routed group such
            as `auto`.
          example: false
      additionalProperties: true
  securitySchemes:
    accessTokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Personal access token copied from CometAPI Console > Personal Settings.
        Send the raw token value; do not prefix it with `Bearer`.

````