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

# Introduction

## 🛠 External API Documentation (v1)

Welcome to the **SESSION GENERATOR** API. This API allows you to check your account balance and retrieve ready-to-use X (Twitter) sessions to automate your registration workflows.

## 🔑 Authentication

To interact with the API, you must include your unique API key in the headers of every request. You can find your key in the **Dashboard** section of your personal account.

| Header                  | Value                   |
| ----------------------- | ----------------------- |
| **SESSION-GEN-API-Key** | your\_private\_api\_key |
| **Accept**              | application/json        |

## 📈 Endpoints

### 1. Check Balance

Returns your current account balance and the associated email address.

* **Method:** `GET`
* **Path:** `/api/v1/balance`

**Success Response (200 OK):**

```json theme={null}
{
  "status": "success",
  "balance": 150.50,
  "email": "user@example.com"
}
```

### 2. Get Sessions

Deducts funds from your balance and provides a list of fresh sessions. Each session is unique and delivered to one customer only.

* **Method:** `GET`
* **Path:** `/api/v1/get-sessions`
* **Query Parameters:**
  * `count` (integer, optional): Number of sessions to purchase. Min: 1, Max: 100. Default: 1.

**Success Response (200 OK):**

```json theme={null}
{
  "status": "success",
  "count": 2,
  "total_spent": 0.010,
  "balance_remaining": 150.49,
  "data": [
    {
      "castle_token": "ct...",
      "cookie": "guest...",
      "guest_token": "1882...",
      "flow_token": "s_...",
      "funcaptcha_blob": "blob...",
      "js_fingerprint": "{\"vendor\":\"Go...\"}"
    }
  ]
}
```

## ❌ Response Statuses & Errors

The API uses standard HTTP status codes to indicate the success or failure of a request.

| **Code** | **Status**           | **Reason**                                      |
| :------- | :------------------- | :---------------------------------------------- |
| **200**  | OK                   | Request successful.                             |
| **401**  | Unauthorized         | Invalid or missing `API-Key`.                   |
| **402**  | Payment Required     | Insufficient balance to complete the purchase.  |
| **404**  | Not Found            | No fresh sessions currently in stock.           |
| **422**  | Unprocessable Entity | Invalid parameters (e.g., `count` exceeds 100). |
| **500**  | Server Error         | Internal server error.                          |

## 💡 Session Data Fields

When receiving data in the `data` array, you will get the following fields required for X registration:

* **guest\_token**: Temporary guest identifier.
* **flow\_token**: Current registration step (Flow) token.
* **cookie**: Prepared cookie string required to pass security checks.
* **js\_fingerprint**: JSON string containing browser parameters (User-Agent, Canvas, etc.) that the session was warmed up with.
* **funcaptcha\_blob**: Data to be sent to your captcha solving provider (Arkose Labs).
