# List API keys

> Every key on the account, with its scopes and spending limit. Only the preview of each key is returned — the secret itself exists once, at creation.

`GET /api-key`

**Auth:** API key or OAuth token

## Response

### 200 — API keys returned

- `data` (required, object[])
  - `createdAt` (required, any)
  - `id` (required, string)
  - `keyPreview` (required, string)
  - `name` (required, string | null)
  - `scopes` (required, string[])
  - `spendingLimit` (required, string | null)
  - `spendingLimitPeriod` (required, string | null) — One of: `"day"`, `"month"`, `"week"`.
  - `updatedAt` (required, any)

```json
{
  "data": [
    {
      "id": "string",
      "keyPreview": "string",
      "name": "string",
      "scopes": [
        "generate"
      ],
      "spendingLimit": "string",
      "spendingLimitPeriod": "day"
    }
  ]
}
```

## Request samples

### cURL

```bash
curl https://api.mynth.io/api-key \
  -H "Authorization: Bearer $MYNTH_API_KEY"
```

### JavaScript

```ts
const response = await fetch("https://api.mynth.io/api-key", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.MYNTH_API_KEY}`,
  },
});

const { data } = await response.json();
```

The full schema for this endpoint is in the [OpenAPI document](https://api.mynth.io/openapi.json).
