---
title: "List API keys."
method: GET
path: "/admin/api_keys"
tags: ["API Keys"]
---

# List API keys.

`GET /admin/api_keys`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/admin/api_keys`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/admin/api_keys/get.ts> (a function with typed inputs; its response is checked against the schema)

Allows admins to list all existing API keys.

## Query parameters

- `offset` integer
- `limit` integer
- `filter` string

## Response `200`

Successful operation

- APIKeyInfo[]
  - `id` string, required: The unique identifier of the API key
  - `username` string, required: The username of the user this key belongs to
  - `name` string, required: The name of the API key
  - `hint` string, required: Hint for the secret key of the API key
  - `created_at` string, date-time, required: The date and time of when the API key was created
  - `expires_at` string, date-time: The date and time of the API key expiration
  - `last_used_at` string, date-time: The date and time of the most recent API call using this key
  - `inactivity_interval` integer: The number of days this API key can be inactive for before becoming invalid
  - `total_calls` integer, required: Number of times this API key has been used
  - `is_active` boolean, required: Status denoting if the API key is active or not
  - `collection_name` string: The name of the collection associated with the API key (if it has been configured to a collection)
  - `collection_id` string: The id of the collection associated with the API key (if it has been configured to a collection)
  - `is_global_key` boolean, required: Status denoting if the API key is global or collection specific

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
