> ## 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

> Set up OTP credentials and authenticate requests using Basic Auth or an access token.

<Steps>
  <Step title="Create a Beem account">
    Create a free account at:

    **[https://login.beem.africa](https://login.beem.africa)**

    After registration, verify your email address and phone number. You'll receive a confirmation email — click the verification link to activate your account.
  </Step>

  <Step title="Log in">
    Sign in using your Beem username and password.
  </Step>

  <Step title="Create an application">
    Navigate to **Applications** under the OTP menu and create a new application.

    Choose the channel you want to use for OTP delivery.

    Available channels include:

    * **Tanzania SMS API** *(enabled by default)*
    * **Multi-country SMS**
    * **WhatsApp** *(WhatsApp setup required)*

    If you want to use international SMS:

    1. Open **Profile**
    2. Select **International API**
    3. Add your international SMS username and password
  </Step>

  <Step title="Generate API credentials">
    Navigate to:

    **OTP → API Setup**

    Click **Generate API Key & Secret**.

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

    If needed, you can return to **API Setup** later to disable your current credentials and generate a new API Key and Secret.
  </Step>
</Steps>

***

## Authentication methods

All OTP 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.

<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 /request HTTP/1.1
    Host: otp.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 /request HTTP/1.1
    Host: otp.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>
