> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://platform.bctrl.ai/llms.txt.
> For full documentation content, see https://platform.bctrl.ai/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://platform.bctrl.ai/_mcp/server.

# CAPTCHA

> Solve CAPTCHA challenges inside a runtime as a hosted invocation.

A `solveCaptcha` [invocation](/sdk/invocations) clears a CAPTCHA on the active page. It runs inside the runtime, with no CDP round-trips.

## Solve a CAPTCHA

```ts
const result = await bctrl.runtimes.invocations.createAndWait(runtime.id, {
  action: "solveCaptcha",
  page: "active",
});

console.log(result.status, result.output);
```

The action targets the runtime's active page. Add `timeoutMs` to bound how long the solve runs.

## Inside agents

Grant a [hosted agent](/sdk/hosted-agents) the `captcha` builtin through a [toolset](/sdk/tools), and it solves challenges as part of a larger task.

```ts
await bctrl.runtimes.invocations.browserUse.agent(runtime.id, {
  instruction: "Sign in and download the latest statement.",
  toolsetId: "tset_with_captcha",
});
```

## Stealth first

Many challenges never appear when the runtime runs with stealth and a residential [proxy](/sdk/proxies). Solve explicitly when one still blocks the flow. See [Runtime configuration](/sdk/runtime-config).

## Next

* [Hosted agents](/sdk/hosted-agents) - solve as part of a task
* [Runtime configuration](/sdk/runtime-config) - avoid challenges with stealth
* [Proxies](/sdk/proxies) - residential and rotating proxies