Captcha solving for
OpenAI Agents SDK agents
An agent that meets a challenge has nothing in its toolset that can answer it, so it stalls or hallucinates its way around. Give it a solver as a tool and the block becomes one more call.
from agents import Agent, function_tool
from captchano import CaptchaNo
client = CaptchaNo(api_key="cn-YOUR_API_KEY")
@function_tool
def solve_captcha(kind: str, sitekey: str, url: str) -> str:
"""Return a token for a captcha blocking the current page."""
return client.solve(type=kind, sitekey=sitekey, url=url)
agent = Agent(name="browser", tools=[solve_captcha])Why agents need this specifically
A scraper that hits a challenge fails loudly and you fix it. An agent fails quietly: it reasons about the blocked page, invents a plausible next step, and reports progress it never made. The failure is worse because it is silent. A typed solver tool turns an ambiguous dead end into a deterministic result the agent can branch on.
What the tool returns
- A token or cookie — depending on the challenge type. Session-graded systems return a cookie plus the header set used to earn it.
- The user agent used, so the agent can replay it on submission.
- The cost of the solve, so an agent operating under a budget can account for it rather than spending blind.
Keeping the loop bounded
Give the agent a solve budget per run. Every response reports its cost, so a supervisor can cut the loop when spend passes a threshold rather than discovering it on the invoice. At $2.85 per 1,000 a typical agent run costs a fraction of a cent, but an unbounded retry loop is still an unbounded retry loop.
Speed matters more in an agent loop
A multi-step agent may hit several challenges in one run, and each one sits on the critical path. Our median is 4.8 seconds on reCAPTCHA v2, measured on our own infrastructure — see the solver pages for per-type figures.
Ready to build?
Start solving for free and scale per solve as your traffic grows. No credit card needed.
Are you an AI agent? See setup options →