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

# API keys

> List your API keys, or create a new one. The secret is shown once.

Manage the API keys for the calling account. These endpoints are used by the
**Developers** screen and are available to your authenticated session.

## List keys

`GET /keys` returns safe fields only — never the secret.

<ResponseField name="ok" type="boolean" />

<ResponseField name="keys" type="array">
  Each key's id, label, masked prefix and metadata (no secret).
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://pesarc.xyz/api/keys \
    -H "Authorization: Bearer sk_live_xxx"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "ok": true,
    "keys": [
      { "id": "key_1", "label": "Production", "prefix": "sk_live_…c3f9", "createdAt": "2026-09-01T10:00:00.000Z" }
    ]
  }
  ```
</ResponseExample>

## Create a key

`POST /keys` creates a key. The **full secret is returned once here and never
again** — store it immediately.

<ParamField body="label" type="string" required>
  A human label for the key, 1–60 characters (e.g. `"Production"`).
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://pesarc.xyz/api/keys \
    -H "Authorization: Bearer sk_live_xxx" \
    -H "Content-Type: application/json" \
    -d '{ "label": "Production" }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "ok": true,
    "key": {
      "id": "key_2",
      "label": "Production",
      "secret": "sk_live_xxxxxxxxxxxxxxxxxxxxxxxx"
    }
  }
  ```
</ResponseExample>

<Warning>
  The `secret` is shown only in this create response. If you lose it, revoke the
  key and create a new one — you cannot retrieve it again.
</Warning>
