---
title: "List Keys"
method: GET
path: "/v1/keys"
tags: ["keys"]
---

# List Keys

`GET /v1/keys`

## Request

- Base URL: `https://api.craterview.ai`
- URL: `https://api.craterview.ai/v1/keys`
- Auth: HTTP bearer

The keys on your account, newest first, a page at a time — revoked ones included.

No usable key is ever in this response — only the prefix, which tells one from another
without authorizing anything. A key is returned in full exactly once, by the call that
created it.

Revoked keys stay listed on purpose: when a client starts getting 401s, the useful thing
to see is that its key was revoked and when. For the key you are calling with, ask
`GET /v1/keys/current` rather than paging for it.

## Query parameters

- `limit` integer
- `before` string, nullable: Return keys older than this key id.

## Response `200`

Successful Response

- KeyList: A page of the account's keys, in the shape every listing here takes.
  - `data` KeyInfo[], required: This page of keys, newest first, revoked ones included.
    - `id` string, required: Identifies this key, for revoking it. Not the key itself.
    - `prefix` string, required: The first few characters, which identify a key without authorizing anything. It is what a listing can show and what to match against your own records.
    - `name` string, required: The label given when it was created.
    - `created_at` string, nullable: When the key was issued. ISO-8601, UTC.
    - `revoked_at` string, nullable: When this key stopped working; absent while it still works. A revoked key is kept so a listing can explain a client that started failing.
    - `rate_limit_per_minute` integer, required: Requests a minute this key may make before it is throttled.
    - `current` boolean, required: Whether this is the key that authenticated this request. It cannot be revoked by id while it is the one you are calling with; `DELETE /v1/keys/current` ends it on request, unless it is the account's only way back in.
  - `has_more` boolean, required: Whether more keys remain past this page.
  - `next_before` string, nullable: Pass as `before` to fetch the next page. Absent on the last one.

## Other responses

- `400`: the path, query or a JSON string in the body contains a NUL character or an unpaired surrogate; the body is not JSON encoded as UTF-8, or carries a number JSON cannot represent (NaN, Infinity, or one too large) or nesting too deep to read; or an Idempotency-Key header is longer than 255 characters or not printable ASCII. The request was not read
- `401`: missing, malformed or unrecognised API key
- `413`: the request body is larger than 1 MiB. The request was not read
- `422`: Validation Error

---

[API](https://skmtc.dev/craterview/apis/craterview-ai-api.md) · [All operations](https://skmtc.dev/craterview/apis/craterview-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/craterview/apis/craterview-ai-api/revisions/9419a5cd27cd?raw)
