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

# Authentication

> How to authenticate requests to the Pixy API.

## Base URL

The current public endpoint is:

```txt theme={null}
https://app.pixy.art/api/v1
```

## Header

Send your Automation key in the `Authorization` header.

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

[Get Automation key](https://app.pixy.art/automations)

## Test Your Automation Key

The fastest way to verify your Automation key is working is to call the `/me` endpoint.

<CodeGroup>
  ```ts SDK theme={null}
  import { Pixy } from '@pixy-art/sdk'

  const pixy = new Pixy({
    apiKey: 'YOUR_API_KEY',
  })

  const me = await pixy.me()

  console.log(me.user)
  ```

  ```bash cURL theme={null}
  curl -X GET "https://app.pixy.art/api/v1/me" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```
</CodeGroup>

If the key is valid, the API responds with your user context instead of `401 Unauthorized`.

## Automation Key vs Embed Key

Use an Automation key for server-side Automation API requests.

Use an embed key for client-side embedded editor sessions.

<Warning>
  Do not use your Automation key in browser-side embed code.
</Warning>

[Get Embed key](https://app.pixy.art/embed)

## Notes

<AccordionGroup>
  <Accordion title="Keep keys server-side" icon="server">
    Keep Automation keys server-side whenever possible.
  </Accordion>

  <Accordion title="Rotate exposed keys" icon="refresh-cw">
    Rotate keys if you believe they have been exposed.
  </Accordion>

  <Accordion title="Separate environments" icon="git-branch">
    Use separate keys for staging and production environments.
  </Accordion>
</AccordionGroup>
