> ## 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 Airtime API requests using HTTP Basic Authentication or an access token.

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

Use one method per request — not both.

***

## Authentication methods

<Tabs>
  <Tab title="API Key & Secret">
    Authenticate using HTTP Basic Authentication.

    | Header          | Value                              |
    | --------------- | ---------------------------------- |
    | `Authorization` | `Basic base64(api_key:secret_key)` |
    | `Content-Type`  | `application/json`                 |

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

    Generate credentials from **Airtime → API Setup** in the Beem dashboard.

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

    {
      "dest_addr": "255784825785",
      "amount": 500,
      "reference_id": "ref_id_215372"
    }
    ```
  </Tab>

  <Tab title="Access Token">
    Authenticate using a token in the `Authorization` header.

    | 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/transfer HTTP/1.1
    Host: apiairtime.beem.africa
    Authorization: <access-token>
    Content-Type: application/json

    {
      "dest_addr": "255784825785",
      "amount": 500,
      "reference_id": "ref_id_215372"
    }
    ```
  </Tab>
</Tabs>

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

***

## Authentication errors

| HTTP Status | Code  | Message                           |
| ----------- | ----- | --------------------------------- |
| `401`       | `120` | Invalid Authentication Parameters |
| `400`       | —     | No authorization headers          |

See [Response codes](/guides/airtime/response-codes) for the full list of error codes.
