Skip to content
moxon home

Password Generation

The /password endpoint generates one or more passwords using cryptographically secure randomness (crypto.randomInt). Supports two modes: random (character-based) and passphrase (word-based). Each response includes the generated passwords along with their strength rating and entropy score.

gethttps://api.moxon.dev/v4/password

Use Cases

Generate secure passwords for users during account creation, produce passphrases for easier memorization, test password strength UI, or seed test fixtures with realistic credentials.

Try itget/v4/password

Parameters

  • type"random" | "passphrase"optional

    Default: random.

    Generation mode: random (character-based) or passphrase (word-based).

  • lengthnumberoptional

    Default: 16.

    Character count for random mode (8–128), or word count for passphrase mode (3–10).

  • uppercase"true" | "false"optional

    Default: true.

    Include uppercase letters (A–Z). Set to false to disable.

  • lowercase"true" | "false"optional

    Default: true.

    Include lowercase letters (a–z). Set to false to disable.

  • digits"true" | "false"optional

    Default: true.

    Include digits (0–9). Set to false to disable.

  • symbols"true" | "false"optional

    Default: false.

    Include symbols (!@#$%^&*()-_=+[]{}|;:,.<>?). Set to true to enable.

  • excludestringoptional

    Default: "".

    Characters to remove from the charset (e.g. exclude=0Ol1).

  • countnumberoptional

    Default: 1.

    Number of passwords to generate (1–20).

  • separatorstringoptional

    Default: -.

    Word separator for passphrase mode.

Response Fields

  • passwordsstring[]

    List of generated passwords or passphrases

  • typestring

    Generation mode used: random or passphrase

  • lengthnumber

    Character count (random) or word count (passphrase)

  • strengthstring

    Strength rating: weak, moderate, strong, or very_strong

  • entropynumber

    Shannon entropy in bits (rounded to 1 decimal place)

Strength Thresholds

StrengthEntropy range
weak< 40 bits
moderate40 – 59.9
strong60 – 79.9
very_strong≥ 80 bits

Code Examples

Error Handling

  • 400Type must be "random" or "passphrase"The type parameter is not a supported value
  • 400Length must be between 8 and 128The length parameter is out of range for random mode
  • 400At least one character set must be enabledAll character sets are disabled or exclude removed all characters
  • 400Count must be between 1 and 20The count parameter is out of the allowed range