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

# Authentication

> How to authenticate REST API requests

## Headers

All REST API requests require two headers that together identify the caller and the organization being accessed:

| Header       | Value             | Description                                                                       |
| ------------ | ----------------- | --------------------------------------------------------------------------------- |
| `x-api-key`  | Your API key      | Issued by Artanis. Treat it like a password.                                      |
| `x-org-slug` | Organization slug | The slug of the organization you want to read from. Visible in the dashboard URL. |

<Warning>
  Never commit your API key to version control or expose it in client-side code. Rotate it immediately if it leaks.
</Warning>

## Example

<CodeGroup>
  ```bash curl theme={null}
  curl https://app.artanis.ai/api/prompts?projectSlug=my-project \
    -H "x-api-key: $ARTANIS_API_KEY" \
    -H "x-org-slug: my-org"
  ```

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

  response = requests.get(
      "https://app.artanis.ai/api/prompts",
      params={"projectSlug": "my-project"},
      headers={
          "x-api-key": os.environ["ARTANIS_API_KEY"],
          "x-org-slug": "my-org",
      },
  )
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch("https://app.artanis.ai/api/prompts?projectSlug=my-project", {
    headers: {
      "x-api-key": process.env.ARTANIS_API_KEY!,
      "x-org-slug": "my-org",
    },
  });
  ```
</CodeGroup>

## Errors

| Status | Meaning                                                                                  |
| ------ | ---------------------------------------------------------------------------------------- |
| `401`  | Missing or invalid `x-api-key`, or no Clerk session if you're calling without an API key |
| `403`  | The requested project or resource does not belong to the organization in `x-org-slug`    |
| `404`  | Resource does not exist                                                                  |
