reCAPTCHA Configuration
Configure reCAPTCHA providers for image and video generation
reCAPTCHA Configuration
All image and video generation requires reCAPTCHA verification. The SDK supports 7 providers with automatic retry and fallback chains.
Recommended Providers
- Chrome — Real Chrome browser, persistent context, highest reCAPTCHA scores
- YesCaptcha — Reliable cloud-based solving, no local browser needed
Other providers: Playwright, Regotcha, CapSolver, Veo3Solver, Custom (self-hosted)
Why reCAPTCHA?
Google Labs uses reCAPTCHA v3 Enterprise to protect against abuse. The SDK handles this transparently:
- All generation requests require a reCAPTCHA token
- SDK automatically fetches a token before each request
- If token evaluation fails, SDK retries with a new token (up to 3 attempts)
Supported Providers
Chrome (Recommended)
Uses a real Chrome browser with persistent context via Chrome DevTools Protocol. Achieves the highest reCAPTCHA scores by maintaining a real browser session.
Why Chrome?
- Persistent browser context — maintains cookies and session across requests
- Real Chrome fingerprint — highest reCAPTCHA v3 scores
- No external API dependency — runs locally
- Auto-cleanup via
client.close()
YesCaptcha (Recommended)
YesCaptcha is a reliable cloud-based captcha solving service.
Why YesCaptcha?
- No local browser required
- Consistent success rates
- Simple setup
Playwright
Uses a Playwright-managed browser to generate reCAPTCHA tokens locally.
Requires playwright as a peer dependency: npm install playwright
Regotcha
Regotcha is optimized for Google Labs reCAPTCHA v3 Enterprise.
CapSolver
CapSolver provides proxy support and browser fingerprinting.
CapSolver returns additional browser fingerprint data (userAgent, secChUa) that the SDK automatically includes in requests.
Veo3Solver
Veo3Solver is a token service that provides pre-solved reCAPTCHA tokens via JWT authentication.
No polling required - tokens are returned immediately via a simple GET request.
Static Token (Testing)
For testing captcha services or debugging, you can pass a token directly without using any provider.
This bypasses all provider logic and uses the provided token directly. Useful for:
- Testing captcha provider tokens manually
- Debugging API responses without waiting for token generation
- Integration testing with known-good tokens
Custom Solver
Use your own self-hosted reCAPTCHA solver service.
Custom Solver API Specification:
Your custom solver endpoint must implement a POST endpoint that accepts:
And returns:
On error:
Configuration Options
| Option | Type | Required | Description |
|---|---|---|---|
provider | 'chrome' | 'yescaptcha' | 'playwright' | 'regotcha' | 'capsolver' | 'veo3solver' | 'custom' | Yes | The captcha solving service to use |
apiKey | string | Yes* | API key for the provider (*not required for custom/veo3solver) |
jwtToken | string | No** | JWT token for authentication (**required for veo3solver) |
customEndpoint | string | No*** | Custom solver endpoint URL (***required for custom provider) |
staticToken | string | No | Static token to use directly (bypasses provider, useful for testing) |
proxy | string | No | Proxy URL (CapSolver and Custom only) |
anchor | string | No | Anchor parameter (Custom only) |
reload | string | No | Reload parameter (Custom only) |
maxRetries | number | No | Maximum polling attempts |
playwrightOptions | object | No | Playwright browser config |
chromeOptions | object | No | Chrome browser config |
fallback | RecaptchaConfig | No | Fallback provider config |
How It Works
Token Request Flow
- SDK creates a task with the provider
- Provider solves the reCAPTCHA challenge
- SDK polls for the result
- Token is included in API requests
Regotcha Flow
CapSolver Flow
Browser Fingerprint
CapSolver provides additional browser fingerprint data:
userAgent: Browser user agent stringsecChUa: Sec-CH-UA header value
The SDK automatically includes these headers in requests when available, improving success rates.
Using Proxies (CapSolver)
For better success rates, CapSolver supports residential proxies:
Proxy formats:
- HTTP:
http://user:pass@ip:port - SOCKS5:
socks5://user:pass@ip:port
Automatic Retry on Evaluation Failure
Sometimes reCAPTCHA tokens are rejected by Google with "reCAPTCHA evaluation failed". The SDK automatically handles this by:
- Detecting the evaluation failure response
- Requesting a new token from your provider
- Retrying the request (up to 3 attempts by default)
Without reCAPTCHA
Both image and video generation require reCAPTCHA configuration. Without it, requests will fail immediately:
Error Handling
Cost Considerations
All providers charge per solved captcha:
- Chrome (Recommended): Free — runs locally, no API costs
- YesCaptcha (Recommended): Check pricing at yescaptcha.com
- Regotcha: Check pricing at regotcha.com
- CapSolver: Check pricing at capsolver.com
Each generation request requires a new token. If evaluation fails, the SDK will request additional tokens (up to 3 per request). Plan your budget accordingly.