---
updatedAt: 2025-08-18T14:31:12.000Z
agentTools:
  projectIndex: https://docs.keycafe.com/llms.txt
---

# Authentication

The API supports Basic HTTP Authentication using your account email and password, or alternatively, an API key or API token.

<Cards columns={4}>
  <Card title="Basic Auth" icon="fa-home" target="_blank" />

  <Card title="API Keys" icon="fa-user" />

  <Card title="API Token" icon="fa-star" />
</Cards>

<br />

## Basic Authentication

To authenticate using Basic Auth:

1. Format your credentials as email:password.
2. Encode the string using Base64 and prepend the encoded string with Basic and include it in the Authorization header.

### Example Header:

```
Authorization: Basic ZW1haWw6cGFzc3dvcmRPckFwaUtleQ==
```

When using curl, the -u option automatically handles encoding:

```Text curl
curl -X GET -u 'email:password' https://www.keycafe.com/v0/key
```

> 📘 ⚠️ Note: If two-factor authentication (2FA) is enabled on your account, password-based authentication will not work. In this case, use an API key or token generated with 2FA enabled ([see the Authorization section for details](https://docs.keycafe.com/reference/create-authorization)).

<br />

## API Keys

API keys can be used as a substitute for passwords, but require appending <code>/key</code> to the username. When using a keys, append <code>/key</code> at the end of your email address in the username field (example: `user@mail/key`) where the email address is variable.

* **Username**: `{email}/key`
* **Password**: `key`

```Text curl
curl -X GET -u '{email}/key:{key}' https://www.keycafe.com/v0/key
```

Keys can be generated in your [account settings](https://support.keycafe.com/hc/en-us/articles/360043666032-API-Configuration#how-to-generate-an-api-key).

> 📘 🚧 Deprecation Notice:\
> API keys are now deprecated. To enhance security and streamline access management, we strongly recommend migrating to API tokens for all authentication purposes.

# API Token

For accounts with two-factor authentication enabled or client implementations desiring additional security, authorization tokens can be used in place of passwords and API keys. When using a token,  append <code>/token</code> to your email in the username field (example: `user@mail/token`) where the email address is variable.

* **Username**: `{email}/token`
* **Password**: `token`

```Text curl
curl -X GET -u '{email}/token:{token}' https://www.keycafe.com/v0/key
```

To manage authorization tokens via the RESTful endpoint, refer to [Authorization](https://docs.keycafe.com/reference/create-authorization)