列出 API 密钥

OpenAPI 契约

方法
GET
路径
/api/v1/api-keys
认证
jwtBearer (bearer)
响应状态
200 400 401 403 404 429 500
请求与响应 Schema
JSON
{
  "requestBody": {},
  "responses": {
    "200": {
      "description": "API keys",
      "content": {
        "application/json": {
          "items": {
            "$ref": "#/components/schemas/ApiKeyResponse"
          },
          "type": "array"
        }
      }
    },
    "400": {
      "description": "Invalid request",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/RequestError"
        }
      }
    },
    "401": {
      "description": "Authentication required or invalid",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "403": {
      "description": "Authenticated but not permitted",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "404": {
      "description": "Requested API key was not found",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    },
    "429": {
      "description": "Rate limit exceeded",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "500": {
      "description": "Unexpected server error",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}

GET /api/v1/api-keys 仅限 JWT。它返回当前认证用户的密钥 metadata:标识和 scope;有效 status、停用、expiry 与 revoke 状态;usage limit、计数器和周期;规范化后的允许 CIDR;以及请求次数、最后使用时间和 IP。它绝不返回 API 密钥 secret。

响应标记为 Cache-Control: no-store。包括密钥自身在内,nfy_ 自动化密钥均不能列出密钥。缺少或无效的 JWT 认证会被拒绝。

http
GET /api/v1/api-keys
Authorization: Bearer <access token>