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

> ## Agent Instructions
> BlitzAPI is the B2B Data API for GTM Builders: company and people search, enrichment, verified emails, US phone numbers and job postings behind one API key.
> Its data infrastructure holds 1B+ records: 550M+ professional profiles, 65M+ companies, 65M+ verified emails, 100M+ job postings and 45M+ US phone numbers.
> Pricing: Start $99, Scale $499, Build Your Infra from $999; every endpoint on every plan; fair use policy in records per month; rate limits per endpoint. Details: https://docs.blitz-api.ai/guide/concepts/pricing
> Company and product facts: https://www.blitz-api.ai/llms.txt

# Authentication: API Keys and Headers

> Authenticate every BlitzAPI request with the x-api-key header, check your key's plan, limits and remaining records, and handle 401, 402 and 404 errors.

> How to securely authenticate your requests with BlitzAPI.

> **Agents & LLMs**: a Markdown version of this page is available by appending `.md` to the URL, and the full documentation index is at [llms.txt](https://docs.blitz-api.ai/llms.txt).

BlitzAPI uses API Keys to authenticate requests. You can view and manage your API keys in the [BlitzAPI Dashboard](https://app.blitz-api.ai).

## The `x-api-key` Header

Authentication to the API is handled via an HTTP header. Include your API key in every request using the `x-api-key` header.

> [!WARNING]
>
> **Security Warning**: Your API keys carry many privileges. **Do not** use your API keys in client-side code (browsers, mobile apps).
>
> Always route requests through your own backend server to keep your keys secret.

### Example Request

Here is how to set the header in various environments:

```bash cURL theme={null} theme={null}
curl "https://api.blitz-api.ai/v2/account/key-info" \
 -H "x-api-key: YOUR_API_KEY"
```

```python Python theme={null} theme={null}
from blitz_api import BlitzAPI

# Pass the key explicitly, or set BLITZ_API_KEY and call BlitzAPI().
# The SDK sends it in the x-api-key header on every request.
client = BlitzAPI(api_key="YOUR_API_KEY")
```

```ts TypeScript theme={null} theme={null}
import { BlitzAPI } from "blitz-api-js";

// Pass the key explicitly, or set BLITZ_API_KEY and call new BlitzAPI().
// The SDK sends it in the x-api-key header on every request.
const client = new BlitzAPI({ api_key: "YOUR_API_KEY" });
```

> [!TIP]
>
> **Using an AI tool?** The [MCP Server](https://docs.blitz-api.ai/guide/integrations/MCP.md) can sign you in with your BlitzAPI account via OAuth, so there's no key to copy. It also accepts your API key in the same `x-api-key` header.

## Verifying your Key

To check if your key is active, use the `GET /v2/account/key-info` endpoint. This is a great way to "health check" your integration before running batch jobs.

```python Python theme={null} theme={null}
info = client.account.key_info()
print(info.valid, info.records_remaining, info.max_requests_per_seconds)
```

```ts TypeScript theme={null} theme={null}
const info = await client.account.key_info();
console.log(info.valid, info.records_remaining, info.max_requests_per_seconds);
```

**Response:**

```json theme={null} theme={null}
{
  "valid": true,
  "id": "019bae09-0055-7441-b2ea-16086e499219",
  "records_remaining": 198500,
  "next_reset_at": "2026-11-14T17:48:25.199Z",
  "max_requests_per_seconds": 10,
  "allowed_apis": [
    "/search/people",
    "/search/employee-finder",
    "/search/waterfall-icp-keyword",
    "/search/companies",
    "/company/tam-by-jobs",
    "/company/tam-by-people",
    "/jobs/search",
    "/jobs/company",
    "/enrichment/person",
    "/enrichment/email",
    "/enrichment/phone",
    "/enrichment/email-to-person",
    "/enrichment/phone-to-person",
    "/enrichment/company",
    "/enrichment/domain-to-linkedin",
    "/enrichment/linkedin-to-domain",
    "/enrichment/company-distribution-by-country",
    "/enrichment/company-distribution-by-department",
    "/utils/current-date",
    "/account/key-info"
  ],
  "active_plans": [
    {
      "name": "Start",
      "status": "active",
      "started_at": "2026-10-14T17:48:25.200Z"
    }
  ],
  "fair_usage": {
    "records_used": 0,
    "records_remaining": 198500,
    "next_reset_at": "2026-11-14T17:48:25.199Z",
    "request_id": "019a2b3c-4d5e-7f60-8a1b-2c3d4e5f6a7b"
  }
}
```

**Response Fields:**

| Field | Type | Description |
| :- | :- | :- |
| `valid` | `boolean` | `true` if the key is active and can make requests. |
| `id` | `string` | Identifier of your account, the same for every API key of the account. |
| `records_remaining` | `number` or `"unlimited"` | Records left on your plan until the next reset. The string `"unlimited"` when your plan has no record limit. |
| `next_reset_at` | `string` or `null` | ISO 8601 timestamp of when your allowance resets. `null` when your plan has no reset date. |
| `max_requests_per_seconds` | `integer` or `"unlimited"` | Your plan's rate limit, applied independently per endpoint and shared by all API keys of your account. Use this value to configure your rate limiter client-side. The string `"unlimited"` when your plan has no rate limit. |
| `allowed_apis` | `array` | Endpoint paths your key can call, without the `/v2` prefix. The list can also include older aliases of the same endpoints. |
| `active_plans` | `array` | Your active subscription(s) with name, status, and start date. |
| `fair_usage` | `object` | `records_used` (always `0`: this call uses no records), `records_remaining` (a number or `"unlimited"`), `next_reset_at` and `request_id`. No `rate_limit`: this endpoint is not rate limited. |

## Errors

If authentication fails, the API will return a `401 Unauthorized` error.

| **Code** | **Meaning** | **Solution** |
| - | - | - |
| `401` | **Unauthorized** | Missing or invalid API key. Check that the `x-api-key` header is present and correct. A valid key also gets a `401` (`You do not have access to this route`) on an endpoint your plan does not include: check `allowed_apis` above. |
| `402` | **Payment Required** | Your key is valid, but your account has reached its limit. Upgrade your plan. |
| `404` | **Not Found** | The path does not exist, or `GET /v2/account/key-info` found no billing account for your key (`Customer not found`). An unknown API key gets a `401`, not a `404`. |

For every other status code, including `422` validation errors, see [Errors](https://docs.blitz-api.ai/guide/reference/errors.md).


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