Captcha Generation
The /captcha endpoint generates a CAPTCHA image. You can provide your own text or let the API generate a random one automatically.
curl -X GET \ "https://api.moxon.dev/v4/captcha"Send the request to see the response here.
textstringoptionalThe captcha text. If omitted, a random string is generated
lengthnumberoptionalLength of the auto-generated text (default 6)
widthnumberoptionalImage width in pixels (default 300)
heightnumberoptionalImage height in pixels (default 150)
noise"low" | "medium" | "high"optionalNumber of noise lines (default 5)
bgstringoptionalBackground color in hexadecimal (e.g.
ffffff)colorstringoptionalText color in hexadecimal (e.g.
000000)
The endpoint returns a PNG image of the generated captcha.
Good to know
The response includes an X-Captcha-Text header containing the captcha answer, useful for server-side verification. When no text is provided, the auto-generated string avoids ambiguous characters (e.g. 0/O, 1/l).
If parameters are missing or invalid, the API will return an error:
- 400
length must be a numberThelengthparameter is not a number - 400
length must be between 1 and 20Thelengthis out of range - 400
width must be a numberThewidthparameter is not a number - 400
width must be between 100 and 800Thewidthis out of range - 400
height must be a numberTheheightparameter is not a number - 400
height must be between 50 and 400Theheightis out of range - 400
noise must be one of: low, medium, highInvalidnoisevalue - 400
Invalid color (use hex like ff6600)Abgorcolorparameter is malformed
Last updated on April 21, 2026