# Authentication

VerifEye REST APIs support two authentication methods.

---

## 1. API Key Authentication

VerifEye APIs use API Key authentication with the `Authorization` header.

### Format

**Header Format:**
```
Authorization: ApiKey <API-KEY-FROM-DEV-CONSOLE>
```

### Example

```bash
curl -X POST "https://demographic-estimation-api-eu.realeyes.ai/v1/demographic-estimation/get-age" \
  -H "Authorization: ApiKey <API-KEY-FROM-DEV-CONSOLE>" \
  -H "Content-Type: application/json" \
  -d '{
    "image": {
      "bytes": "/9j/4AAQSkZJRgABAQEAYABgAAD..."
    }
  }'
```

---

## 2. JWT Bearer Token Authentication

JWT tokens provide time-limited authentication for client-side applications. Tokens are generated using the Security API's `/token/get` endpoint.

### Format

**Header Format:**
```
Authorization: Bearer <jwt-token>
```

### How to Get a JWT Token

**Step 1: Generate Token**

```bash
curl -X GET "https://security-api-eu.realeyes.ai/v1/token/get" \
  -H "Authorization: ApiKey <API-KEY-FROM-DEV-CONSOLE>"
```

**Response:**
```json
{
  "token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9...",
  "expiresAt": "2026-01-27T12:00:00Z"
}
```

**Step 2: Use Token in API Requests**

```bash
curl -X POST "https://demographic-estimation-api-eu.realeyes.ai/v1/demographic-estimation/get-age" \
  -H "Authorization: Bearer eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "image": {
      "bytes": "/9j/4AAQSkZJRgABAQEAYABgAAD..."
    }
  }'
```

---

## Getting Your API Key

1. Sign up at the [VerifEye Developer Console](https://verifeye-console.realeyes.ai/)
2. Navigate to **Home → View API Keys** or **Profile image -> Api Key**

---

*Last updated: 2026-02-13*
