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

# Authentication

> API key authentication for the Vaquill API

The Vaquill API gives you programmatic access to US primary law: the US Code and CFR, statutes for all 50 states plus DC and Puerto Rico, administrative regulations for all 50 states plus DC and Puerto Rico, the US and state constitutions, court rules, the Federal Register, agency guidance, and executive orders. Use it to power statute lookup and search in your own product or internal tools.

## API Keys

All requests require an API key in the `Authorization` header:

```bash theme={"theme":"github-dark"}
Authorization: Bearer vq_key_your_api_key_here
```

Keys use the `vq_key_` prefix and are tied to your account.

## Get Your API Key

<Steps>
  <Step title="Sign in">
    Go to [app.vaquill.ai/settings](https://app.vaquill.ai/settings).
  </Step>

  <Step title="Create a key">
    Under **API Keys**, click **Create API Key**. Copy the key immediately. It won't be shown again.
  </Step>
</Steps>

## Example Requests

<CodeGroup>
  ```bash cURL theme={"theme":"github-dark"}
  curl -X POST https://api.vaquill.ai/api/v1/us/statutes/search \
    -H "Authorization: Bearer vq_key_your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{"query": "data breach notification"}'
  ```

  ```python Python theme={"theme":"github-dark"}
  import requests

  response = requests.post(
      "https://api.vaquill.ai/api/v1/us/statutes/search",
      headers={
          "Authorization": "Bearer vq_key_your_api_key_here",
          "Content-Type": "application/json"
      },
      json={"query": "data breach notification"}
  )
  ```

  ```javascript JavaScript theme={"theme":"github-dark"}
  const response = await fetch("https://api.vaquill.ai/api/v1/us/statutes/search", {
    method: "POST",
    headers: {
      "Authorization": "Bearer vq_key_your_api_key_here",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ query: "data breach notification" })
  });
  ```

  ```go Go theme={"theme":"github-dark"}
  req, _ := http.NewRequest("POST", "https://api.vaquill.ai/api/v1/us/statutes/search", body)
  req.Header.Set("Authorization", "Bearer vq_key_your_api_key_here")
  req.Header.Set("Content-Type", "application/json")
  ```
</CodeGroup>

## Error Codes

| Code | Meaning |
| - | - |
| `401` | Invalid or missing API key |
| `402` | Payment required. Check your account dashboard |
| `429` | Rate limit exceeded |

<Warning>
  Never expose your API key in client-side code or public repositories. If compromised, revoke it from your [dashboard](https://app.vaquill.ai/settings) and generate a new one immediately.
</Warning>

## How many keys you can hold

Active keys are capped per account, and the cap is enforced in the database, so creating one past it fails rather than silently succeeding.

| Plan | Active keys |
| - | -: |
| Vaquill API Business | 5 |
| Every other plan, including Vaquill API Pro | 2 |

The cap of 2 is smaller than it looks in practice, because the console's Playground mints a key of its own when it cannot reuse one.
An account running one integration key plus a Playground key is already at the cap.

Revoking a key frees its slot immediately.
The cap is only checked when a key is created or reactivated, so lowering a plan never revokes a key you already hold.

## Rotating a key

**On Business**, rotate without downtime: create the new key, deploy it, then revoke the old one.
Five slots leave room to overlap.

**On any other plan sitting at 2 keys**, you cannot create the replacement first.
Revoke the old key, then create the new one and deploy it, and accept a short window where the old key is dead and the new one is not yet live.
Do the revoke and the deploy close together, or upgrade if an overlap window matters to you.

<Warning>
  A revoked key stops working immediately. If you are at the cap, confirm your deploy pipeline is ready before you revoke, because there is no free slot to hold the old key open while you roll out.
</Warning>

## Related

<CardGroup cols={2}>
  <Card title="Data & Privacy" href="/docs/api-guide/data-privacy">
    How your API key is stored, and what we do and don't keep about your requests.
  </Card>

  <Card title="Errors" href="/docs/api-guide/errors">
    HTTP status codes and how to recover from each.
  </Card>

  <Card title="API Reference" href="/docs/api-reference/us-statutes/search-us-statutes-constitutions-court-rules-and-executive-actions">
    Every endpoint with parameters, examples, and an interactive playground.
  </Card>

  <Card title="Vaquill MCP" href="/docs/integrations/mcp/vaquill">
    Skip the API and call Vaquill AI from Claude, Cursor, or any MCP client.
  </Card>
</CardGroup>


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