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

# POST /v1/generate

> Generate Bedrock accounts

Generate fresh Minecraft Bedrock Edition accounts on demand. Each account includes an Xbox gamertag, email, password, and a `bedrockToken`. Credits are the only limit — no hard cap on amount.

<Warning>
  Generation takes **\~1–2 minutes** per batch. Set appropriate timeouts.
</Warning>

<ParamField header="X-API-Key" type="string" required>
  Your API key
</ParamField>

<ParamField body="amount" type="integer" required>
  Number of accounts to generate. Must be a positive integer. Only limited by your credit balance.
</ParamField>

## Request

```json theme={null}
{
  "amount": 5
}
```

## Response

```json theme={null}
{
  "success": true,
  "data": {
    "formattedAccounts": "[FrostShark72]vcejpvwhj089@hotmail.com:Passw0rd! | bedrockToken: MCToken eyJ...",
    "finalAmount": 5,
    "finalCost": 35,
    "newBalance": 215,
    "transactionId": "ORDER-003726"
  }
}
```

Each line in `formattedAccounts` follows the format:

```
[Gamertag]email:password | bedrockToken: MCToken eyJ...
```

Accounts are separated by `\n\n==========\n\n`.

<Note>
  Accounts last **3–6 months**. Credits are deducted atomically — you are not charged if generation fails.
</Note>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://mogalts.win/v1/generate \
    -H "X-API-Key: mog_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{"amount":3}'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://mogalts.win/v1/generate",
      headers={"X-API-Key": "mog_your_key_here"},
      json={"amount": 3},
      timeout=300  # generation takes ~1-2 min
  )

  if response.json()["success"]:
      accounts = response.json()["data"]["formattedAccounts"]
      for line in accounts.split("\n\n" + "=" * 30 + "\n\n"):
          print(line)
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch("https://mogalts.win/v1/generate", {
    method: "POST",
    headers: {
      "X-API-Key": "mog_your_key_here",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ amount: 3 })
  });
  const data = await res.json();
  if (data.success) {
    const accounts = data.data.formattedAccounts.split("\n\n" + "=".repeat(30) + "\n\n");
    accounts.forEach(a => console.log(a));
  }
  ```
</CodeGroup>
