---
title: "API Keys & Bearer Tokens"
description: "Authentication mechanisms for backend services and frontend applications."
order: 2
category: "Backend API"
updated: "2026-10-13"
---

# API Keys & Bearer Tokens

AuthSetu uses two distinct authentication methods depending on whether a request originates from a backend server or a frontend client.

## 1. Backend Server Requests (`Secret Key`)

Use your Secret Key in the `Authorization` header with the `Bearer` scheme or `X-Secret-Key`:

```bash
curl https://api.authsetu.com/v1/users \
  -H "Authorization: Bearer sk_live_your_secret_key"
```

## 2. Frontend Client Requests (`Publishable Key`)

Use your Publishable Key (`pk_live_...` or `pk_test_...`) in the `X-Publishable-Key` header:

```bash
curl https://api.authsetu.com/v1/client/config \
  -H "X-Publishable-Key: pk_test_your_key"
```
