NewAPIVerve Academy: free courses and certifications anyone can verify.Explore the Academy →

Captcha Generator API

GET

A captcha generator API: an image captcha, its answer and an audio version in one call.

Captcha Generator creates a new captcha on every call: distorted characters or a simple math question as a GIF or PNG, with the answer to check on your server. Add audio=true for a spoken version, the accessible alternative for visitors who can't see the image.

About the Captcha Generator API

Call it with no parameters for five random letters in a 200×70 GIF, plus the solution, an id and a 24-hour download link. Set type=math for a question like 7 + 4 = ?, and tune length, character set, difficulty, size and format to fit your form. Add audio=true for a spoken version in a clear recorded voice, with optional background noise. Audio and math are free on every plan; paid plans can also set colors. Keep the solution on your server and compare it with what the visitor types, ignoring case.

What people use it for

Registration Form Protection
To block automated spam registrations, web apps fetch a challenge image for the signup form and check submitted text against the returned solution.
Failed Login Throttling
When visitors trigger multiple failed login attempts, authentication services display a captcha image to verify that a person is behind the keyboard.
Contact Form Verification
Community forums attach challenge images to public inquiry forms, using the millisecond expiration timestamp to invalidate stale submissions.
Password Reset Defense
Require visitors to solve a visual challenge before sending password reset links to prevent bad actors from triggering bulk recovery emails.

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use Captcha Generator

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the Captcha Generator API.

Read the docs →
Is it cheap enough to generate a captcha for every form submission?
Yes. Each request uses 10 credits, which works out to about $0.0015 per call on the Starter plan, or $1.50 per 1,000 captchas. That plan includes enough credits to generate 20,000 captchas each month. The Free plan includes 20 captchas per month for development and testing.
How do I display the generated captcha to a visitor?
By default the API returns a signed download URL for the rendered image along with a unique identifier. You can link to that URL in an image tag or fetch the image to serve it from your own domain. Add audio=true to also get audioURL, a WAV file of the same challenge spoken aloud, which you can play from an audio element or a play button next to the image. Add inline=true to get the image as a base64 data URI in dataURI (and the audio in audioDataURI) instead, which you can place straight into an image or audio tag; no file is stored and downloadURL and audioURL are null.
How does answer verification work?
You handle verification in your backend application. The API returns the plaintext solution string alongside the image, so your server can store the correct answer temporarily and compare it with the text the visitor submits. Compare without regard to case, even when you use the mixed or alphanumeric character sets: many letters look the same in both cases once distorted, such as c, o, s, v, w, x and z.
Is there an audio captcha for visitors who cannot see the image?
Yes. Add audio=true and the response also carries audioURL, a WAV recording of the same challenge: each letter or digit read one at a time, or for type=math the question itself, such as "seven plus four equals", never the answer. WCAG asks for an alternative to a visual-only test, and audio is that alternative, so it is free on every plan. Each call varies pitch, pace and the gaps between characters slightly, so two recordings of the same answer never match sample for sample. With inline=true the audio comes back as a data URI in audioDataURI.
Should I add background noise to the audio captcha?
audioNoise sets it: none (the default), low, medium or high. none is the clearest and the best choice for accessibility, since the audio exists for visitors who cannot use the image, including people who are hard of hearing or using a screen reader. Each step up adds more background noise, and medium and high also add scrambled speech underneath, which makes automated transcription harder but also makes the audio harder for people to follow. audioNoise only applies with audio=true, and difficulty does not change the audio.
How does a math captcha work?
Set type=math and the image shows a question such as 23 + 15 = ? instead of random letters. The solution field holds the answer as a string of digits, such as "38", so you compare it the same way as a text captcha. Answers are always whole numbers and never negative. length, charset and unambiguous are ignored for math; difficulty chooses the numbers and operators.
What happens when a captcha expires?
The expires timestamp and the image link are both set 24 hours ahead, which is longer than most forms should accept an answer. Store your own shorter deadline with the solution, such as 10 minutes, and treat a later answer as invalid.
Can I customize the character set, length or difficulty?
Yes. Set length from 4 to 8 characters, charset to lowercase, uppercase, mixed, digits or alphanumeric, and difficulty to easy, medium or hard, which adds more rotation, warp, noise lines and background texture at each step. unambiguous=true leaves out characters that are easy to misread, such as 0, O, o, 1, l, I and i. Width runs from 100 to 400 pixels and height from 40 to 150, and format is gif or png. type=math draws an arithmetic question instead, and difficulty then sets the numbers: single-digit addition and subtraction at easy, numbers up to the fifties at medium, and two-digit sums plus multiplication up to 12 times 12 at hard. With no parameters you get five lowercase letters in a 200 by 70 pixel GIF at medium difficulty.
Which options need a paid plan?
Length, character set, difficulty, image size, format, math questions, audio and inline output all work on the Free plan. Setting the text color and background color needs a paid plan; on the Free plan those two parameters are ignored and the captcha uses the default colors.

Ready to build with Captcha Generator? Start with 200 free credits — one key unlocks all 406+ APIs.

Explore the catalog

406+ APIs on the same key and the same response shape.

Browse all APIs