# Random generator

Make secure random integers, decimals, bytes and dice rolls, or pick from and shuffle a list.

- Endpoint: `POST https://setget.net/v1/tools/random` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `random`
- Page: https://setget.net/tools/random

## Inputs

- `kind` (optional, string, one of `integer`, `float`, `bytes`, `dice`, `pick`, `shuffle`, default `"integer"`): What to make: integer, float, bytes (as hex), dice rolls, a pick from a list, or a shuffled list.
- `minimum` (optional, number): Lowest value, included. Defaults to 1 for integers and 0 for floats.
- `maximum` (optional, number): Highest value. Included for integers. Defaults to 100 for integers and 1 for floats.
- `count` (optional, integer, default `1`, range 1..1000): How many values, rolls or picks to make.
- `size` (optional, integer, default `16`, range 1..1024): For bytes: how many bytes in each value.
- `notation` (optional, string, default `"1d6"`): For dice: what to roll, such as "d20", "2d6" or "3d6+2".
- `items` (optional, array): For pick and shuffle: the list to choose from or reorder.
- `unique` (optional, boolean, default `true`): For pick: never choose the same item twice.

## Example 1: Five numbers from 1 to 6

```json
{"input":{"kind":"integer","minimum":1,"maximum":6,"count":5}}
```

## Example 2: Three six-sided dice plus two

```json
{"input":{"kind":"dice","notation":"3d6+2"}}
```

## Example 3: Two different items from a list

```json
{"input":{"kind":"pick","items":["red","green","blue"],"count":2}}
```

## Example 4: A list in random order

```json
{"input":{"kind":"shuffle","items":[1,2,3,4,5]}}
```

## Example 5: A 256-bit random key as hex

```json
{"input":{"kind":"bytes","size":32}}
```

## Example 6: Three decimals between 0 and 1

```json
{"input":{"kind":"float","count":3}}
```

**How random is it?** Values come from the operating system's cryptographic random source, and are drawn without modulo bias. They are suitable for draws, keys and tokens.

**How do I flip a coin?** Use kind "pick" with the items "heads" and "tails", or an integer from 0 to 1.

**What dice notation is understood?** NdS with an optional modifier: "2d6" rolls two six-sided dice, "d20" rolls one, and "3d6+2" adds 2 to the total. Up to 100 dice with up to 1,000 sides.
