# API keys

Source: https://docs.askaniela.com/user/api-keys/

Keys belong to a **project**. Open the project - **API keys** tab.

1. Enter a **Name** (e.g. `crawler-prod`), choose **Expires** (30, 90, 180 days or 1 year) and optionally
   **Allowed IPs** (e.g. `203.0.113.0/24`; empty = any address).
2. Check the **Scopes** the key needs. The defaults are already checked.
3. Click **New key**. The full key (`gsj_...`) is shown **once** - copy it now. We store only a hash.

Use the key in the header `Authorization: Bearer gsj_...` on `https://api.askaniela.com`
(see [API quickstart](https://docs.askaniela.com/user/api-quickstart.md)).

The same form is in **Platform > API keys**, where you can also create personal and organization keys.

## Scopes

| Scope | What it allows | Default |
|---|---|---|
| `judge` | check single pages and small batches (`/v1/judge`, `/v1/judge/batch`), search intent (`/v1/intent`), rule catalog | yes |
| `jobs` | queued jobs (`/v1/jobs`, pause/resume/cancel), site audits (`/v1/audits/site`), refreshes | yes |
| `reports:write` | archive and restore reports and audits (not delete; deleting needs a signed-in owner/admin). Keys created before 2026-10-21 13:00 UTC with `jobs` keep this right until the end of the beta | no |
| `reports:read` | read reports, audits, intent reports, exports and fix plans | yes |
| `projects:read` | list the projects the key can see (`GET /v1/projects`); read only - renaming and deleting projects needs a signed-in user | no |
| `feedback:write` | send feedback on rules and reports | no |
| `labels:write` | label pages and texts with the Labeler (`/v1/labels`, `/v1/labels/batch`, `/v1/labels/estimate`) | yes |
| `labels:read` | read Labeler batches and their CSV (`/v1/labels/batch/{id}`) | yes |
| `context:write` | page context checks (`/v1/context`, `/v1/context/estimate`) | yes |

A key with the default scopes can do everything an agent needs: start a check, a job, a site audit, an intent
report, a Labeler or page context check, then read the results. `GET /v1/usage` (balance and limits) works with any key. A key never gets more than
its owner can do in the panel.

Scopes are fixed when the key is created. A call that needs another scope returns `403 insufficient_scope`; the
message names the missing scope and `error.details.required_scope` has it too. Create a new key with that scope
and revoke the old one. Older keys keep the scopes they were created with (earlier defaults were `judge`, `reports:read`, later also `jobs`; the Labeler and page context scopes came last).

- **Rotate** creates a new key; the old one keeps working during a grace period (7 days by default).
- **Revoke** stops a key immediately.
- The list shows status (grace period, expired, revoked) and when the key was last used.

API calls use the same monthly limit and balance as the panel. Next: [API quickstart](https://docs.askaniela.com/user/api-quickstart.md).
