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

# Authentication

> API keys, and how V1 keys work on V2.

## API keys

Send your API key as a bearer token on every request:

```http theme={null}
Authorization: Bearer <your API key>
```

`x-api-key: <your API key>`, as in V1, works too.

* **Create and revoke keys** in [**Workspace settings → API keys**](https://www.argil.ai/workspace-settings?tab=api-keys) of the Argil app. A key is yours, for one workspace. Revocation is immediate.
* **One workspace per key.** A key acts as the member who created it, in their workspace: what it creates belongs to that workspace, uses its credits, and appears in that workspace’s library.
* **Keys are secrets for your servers.** Never put one in a browser or a mobile app. Use one key per integration, so you can revoke one without breaking the others.
* **A key starts with `argil_sk_`**, so secret scanners can spot one pushed by mistake. Keys created before this prefix keep working.

A missing key is `401 authentication_required`, an unknown or revoked one `401 invalid_api_key`. After a failed authentication, the answer is delayed to slow down key guessing.

## Plans

Any key reads its workspace: models, generations, assets, elements, balance and webhook endpoints. Creating a generation needs an active Argil plan; without one, `POST /v2/generations` answers `403 plan_required`. A workspace admin's key also gets the link to buy one: see [Plans](https://docs.argil.ai/v2/account/plans.md).

## V1 keys

V1 and V2 share keys: the same key works on both, unchanged.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.