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

# Authorization

> How to authenticate API requests

### Overview

To securely access Roark's API endpoints, you need to authenticate your requests using your unique API key. This ensures that only authorized users can interact with our services.

<Warning>
  Never expose your API key in client-side code, public repositories, or share it with unauthorized users. If you believe your key has been compromised, regenerate it immediately in the [dashboard](/documentation/getting-started/api-keys).
</Warning>

### Authentication Header

<CodeGroup>
  ```bash Headers theme={null}
  Authorization: Bearer YOUR_API_KEY
  ```

  ```json Response theme={null}
  {
    "authenticated": true,
    "account": "your-account-name"
  }
  ```
</CodeGroup>

### Example Requests

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.roark.ai/health" \
       -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  headers = {
      "Authorization": "Bearer YOUR_API_KEY"
  }

  response = requests.get("https://api.roark.ai/health", headers=headers)
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch("https://api.roark.ai/health", {
    headers: {
      "Authorization": `Bearer YOUR_API_KEY`
    }
  });
  ```
</CodeGroup>

### Security Best Practices

<CardGroup cols={2}>
  <Card title="Secure Storage" icon="lock">
    Store API keys securely in environment variables or a secure key management system
  </Card>

  <Card title="Regular Rotation" icon="refresh-cw">
    Periodically rotate your API keys to maintain security
  </Card>
</CardGroup>

### Need an API Key?

<Card title="Generate API Key" icon="key" href="/documentation/getting-started/api-keys">
  Follow our guide to generate your API key and start making authenticated requests
</Card>
