> ## 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 statutes: the US Code, the CFR, all 50 state statute codes, the U.S. Constitution, the Federal Rules, 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/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/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/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/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>

<Tip>
  **Rotate keys on a schedule.** Generate a new key, deploy it to your application, then revoke the old one. Vaquill supports multiple live keys per workspace so you can rotate without downtime.
</Tip>

## Related

<CardGroup cols={2}>
  <Card title="Errors" icon="triangle-exclamation" href="/docs/api-guide/errors">
    HTTP status codes and how to recover from each.
  </Card>

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

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