# API Authentication

***

Check how to authenticate the APIs.

## Api Authentication

All GlobalTopUp APIs are authenticated using `Api Keys`. Basic auth requires the following:

* `[YOUR_KEY_SECRET]`

API keys auth expects an `x-auth-token` header for each request in the such as `x-auth-token: secret token`.The token can be obtained from the vendor panel on the website once you have been registered and verified

{% hint style="warning" %}
Watch Out

***

The `x-auth-token` header value should strictly adhere to the format mentioned above. Invalid formats will result in authentication failures with error code `401`.&#x20;
{% endhint %}

## Generate API Keys

Follow these steps to generate API keys:

1. Log in to your Dashboard with the appropriate credentials.
2. Select the Add New Token option from the sidebar of your dashboard. You can generate tokens for both the modes
   * **Test Mode**: The test mode is a simulation mode that you can use to test your integration flow. **Your recharge will not be passed in real in this mode.**
   * **Live Mode**: When your integration is complete, and generate live mode token. In the integration, **replace test token keys with live token keys to process the recharge in real.**
3. Navigate to **Tokens** → **Token List** (under **Website and app settings**) → to view all the token which has been generated. <br>

Note: Each token is authenticated against a valid IP Address such that only the request coming from that IP address will be processed further, and others will result in authentication failure with an error code `401`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.globaltopup.in/introduction/api-authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
