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

# Authentication

> Authenticate MOJA API requests using Basic Auth or an access token.

All MOJA API requests require authentication. Use **HTTP Basic Authentication** (API Key and Secret) or pass an **access token** in the `Authorization` header.

Use one method per request — not both.

***

## Generate credentials

Navigate to **MOJA → API Setup** in the Beem dashboard and generate your API Key and Secret.

<Warning>
  Your API Secret is displayed **only once**. Store it securely, as it cannot be viewed again.
</Warning>

***

## Authentication methods

<Tabs>
  <Tab title="API Key & Secret">
    | Header          | Value                              |
    | --------------- | ---------------------------------- |
    | `Authorization` | `Basic base64(api_key:secret_key)` |
    | `Content-Type`  | `application/json`                 |

    * **Username:** API Key
    * **Password:** API Secret

    ```http theme={null}
    POST /v1/chatapi HTTP/1.1
    Host: apichatcore.beem.africa
    Authorization: Basic <base64-encoded-api_key:secret_key>
    Content-Type: application/json
    ```
  </Tab>

  <Tab title="Access Token">
    | Header          | Value              |
    | --------------- | ------------------ |
    | `Authorization` | `<access-token>`   |
    | `Content-Type`  | `application/json` |

    Pass your access token directly — **do not** use a `Bearer` prefix.

    ```http theme={null}
    POST /v1/chatapi HTTP/1.1
    Host: apichatcore.beem.africa
    Authorization: <access-token>
    Content-Type: application/json
    ```
  </Tab>
</Tabs>

<Warning>
  Never expose your API Key, API Secret, or access token in frontend applications or public repositories.
</Warning>
