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

# Authentication

> API key authentication for the Cuprice API

The Cuprice API v1 uses API keys for authentication. Public endpoints (Share, Receipt, Checkout) don't require authentication.

## Getting an API Key

<Steps>
  <Step title="Go to Settings">
    Open **Dashboard → Settings → API Keys**
  </Step>

  <Step title="Create a key">
    Click **Create API key**, give it a name and choose permissions:

    * **Read** — list projects, features, plans
    * **Read & Write** — create, update, delete projects, features, plans
  </Step>

  <Step title="Copy the key">
    The key is shown **only once**. Copy it immediately.
  </Step>
</Steps>

<Warning>
  API keys are shown only once at creation time. Store them securely. If you lose a key, revoke it and create a new one.
</Warning>

## Using Your API Key

Pass the key in the `Authorization` header:

```bash theme={null}
curl https://cuprice.io/api/v1/projects \
  -H "Authorization: Bearer cpk_your_key_here"
```

## Key Format

All Cuprice API keys start with `cpk_` followed by a random string:

```
cpk_qdC2ul3mn-j0ywEvn9QznOoBhtJ4_e8Y1rv6JRUPa6U
```

## Permissions

| Permission   | Can do                                    |
| ------------ | ----------------------------------------- |
| `read`       | List and read projects, features, plans   |
| `read_write` | Everything above + create, update, delete |

## Rate Limits

| Scope    | Limit               |
| -------- | ------------------- |
| Per key  | 100 requests/minute |
| Per user | 500 requests/minute |

## Error Responses

| Status | Meaning                                        |
| ------ | ---------------------------------------------- |
| `401`  | Invalid or missing API key                     |
| `403`  | Key doesn't have write permission              |
| `404`  | Resource not found                             |
| `400`  | Bad request (missing fields, validation error) |
