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

# Sleuth Intel API Key Authentication and Error Codes

> Get your Sleuth Intel API key, pass it in the Authorization header, and handle 401, 403, and 429 errors across curl, JavaScript, and Python.

Every request to the Sleuth Intel API must include your API key in the `Authorization` header. Your key is tied to your account tier, so the endpoints and rate limits available to you reflect your current subscription.

## Get Your API Key

1. Sign in at [sleuthintel.io](https://www.sleuthintel.io).
2. Open **Account Settings**.
3. Copy your API key from the **API** section.

<Note>
  Your API key is scoped to your account tier. Endpoints and rate limits are determined by the plan associated with your key — not by any per-request parameter.
</Note>

## Pass the Key in Your Request

Include your key as a Bearer token in the `Authorization` header on every request:

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

<Warning>
  Never commit your API key to source control. Treat it like a password — if it is exposed, regenerate it immediately from Account Settings.
</Warning>

<Tip>
  Store your key in an environment variable such as `SLEUTH_API_KEY` and read it at runtime. This keeps it out of your codebase and makes key rotation straightforward.
</Tip>

## Code Examples

<CodeGroup>
  ```bash curl theme={null}
  curl https://api.sleuthintel.io/v1/signals \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript (fetch) theme={null}
  const response = await fetch("https://api.sleuthintel.io/v1/signals", {
    headers: {
      Authorization: `Bearer ${process.env.SLEUTH_API_KEY}`,
    },
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python (requests) theme={null}
  import os
  import requests

  headers = {
      "Authorization": f"Bearer {os.environ['SLEUTH_API_KEY']}"
  }

  response = requests.get("https://api.sleuthintel.io/v1/signals", headers=headers)
  data = response.json()
  print(data)
  ```
</CodeGroup>

## Error Reference

| Status Code                 | Meaning                                  | Resolution                                                            |
| --------------------------- | ---------------------------------------- | --------------------------------------------------------------------- |
| `401 Unauthorized`          | API key is missing or invalid            | Check that your key is correct and included in every request          |
| `403 Forbidden`             | Your tier does not include this endpoint | Upgrade your subscription to unlock higher-tier endpoints             |
| `429 Too Many Requests`     | You have exceeded your rate limit        | Back off and retry after the window resets; upgrade for higher limits |
| `500 Internal Server Error` | Unexpected server-side error             | Retry with exponential backoff; contact support if it persists        |

### 401 — Missing or Invalid Key

```json theme={null}
{
  "error": "unauthorized",
  "message": "Invalid or missing API key."
}
```

### 403 — Tier Restriction

```json theme={null}
{
  "error": "forbidden",
  "message": "This endpoint is not available on your current plan."
}
```

### 429 — Rate Limited

```json theme={null}
{
  "error": "rate_limit_exceeded",
  "message": "You have exceeded your request limit. Please wait before retrying."
}
```
