# Key Generator

## /keygen

This endpoint generates random keys based on the specified style provided in the query parameters. Supported styles include 'codeigniter encryption keys', '256-bit wep keys', '160-bit wpa key', '504-bit wpa key', '64-bit wep keys', '128-bit wep keys', '152-bit wep keys', 'serial', 'serial2', and 'serial3'. If the style is not provided or invalid, it returns a 400 error with a corresponding message.

### Query Parameters

| Parameter | Type   | Description                            |
| --------- | ------ | -------------------------------------- |
| `style`   | String | The format type for the generated key. |

### Responses

**Content-Type:** application/json

**Body:**

```json
{
    "key": "ABCD-EFGH-IJKL-MNOP"
}
```

### Serial Style

Formats the raw key to resemble a serial key based on the specified format type. Supports three format types:

* `'serial'`: Formats to `XXXX-XXXX-XXXX` where `X` represents a character.
* `'serial2'`: Formats to `XXXXX-XXXXX-XXXXX`.
* `'serial3'`: Formats to `XXXXX-XXX-XXXXX-XXX`. If no format type matches, it returns the raw key without any formatting.

### Other Styles

```javascript
256-bit wep keys
```

```javascript
160-bit wpa key
```

```javascript
504-bit wpa key
```

```javascript
64-bit wep keys
```

```javascript
128-bit wep keys
```

```javascript
152-bit wep keys
```

#### Note

* This API is intended for generating random keys for various purposes such as software licenses, access tokens, etc.


---

# 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.ziomark.xyz/get-endpoints/key-generator.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.
