---
agentTools:
  projectIndex: https://docs.basqet.com/llms.txt
---

# Authenticating Your Request

Access to Basqet’s API requires authentication using API keys. This guide will help you generate, use, and regenerate your keys securely.

### **1. Getting Your API Keys**

To generate API keys:

1. Log in to your **Basqet dashboard**.
2. Navigate to **API**.
3. Copy your **public** and **secret keys** for the selected environment.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/c53a9e61c85537d11719bb8f0fb703be89a0dad74ea930e65e4a4a48e806b041-Screenshot_2026-03-27_at_04.28.51.png",
        "",
        ""
      ],
      "align": "center"
    }
  ]
}
[/block]

<br />

⚠️ **Note:** Each environment (e.g., Test, Production) has its own set of API keys. Make sure you use the keys corresponding to the correct environment.

### **2. Using Your API Keys**

Include your **secret key** in the HTTP Authorization header for all API requests:

```json
GET /v1/accounts
Host: api.basqet.com
Authorization: Bearer <YOUR_SECRET_KEY>
```

**Important:** Never expose your secret key in client-side code, public repositories, or logs.

### **3. Regenerating API Keys**

If your keys are **exposed or compromised**, regenerate them immediately. When you regenerate:

* All existing keys are invalidated.
* New keys are generated.
* You must update your application configuration with the new keys.

Steps to regenerate keys:

1. Go to the **API** page on your dashboard.
2. Click **Regenerate API Keys**.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/49a7fa8264aca6ef4c09b3f58d718d2ceb7bbde664b187e3304ca5c2050d37a3-Screenshot_2026-03-27_at_04.30.41.png",
        "",
        ""
      ],
      "align": "center"
    }
  ]
}
[/block]

<br />

3. Replace the old keys in your application.

⚠️ **Warning:** Any requests using old keys will fail after regeneration.

### **4. Best Practices**

* Store keys securely using **environment variables**
* **Rotate keys** regularly for better security.
* Monitor API usage to detect unusual activity.