Castle solver API
API health
- 24h health
- Normal
- Healthy / normal
- Available
Last 24 hours
Last 30 days
EverySolve's Castle API returns a set of tokens for your challenge workflow.Castle is a risk and device-intelligence flow in which the target supplies structured metadata rather than a visible image puzzle. It returns a token set. Do not collapse that set into one token or infer a visual CAPTCHA from the product name.
Send POST https://api.everyinfra.com/api/v1/captcha with type set to castle. Put the parameters in the request body, at the same level as type. $0.97 per 1,000 tokens ($0.000972 per token). Each call is charged per token: the price × count. You pay only for the tokens returned. Failed calls and empty results are not charged.
AI prompt
#Help me write a script that calls the EveryInfra "Castle" API.
API contract:
- Request: POST https://api.everyinfra.com/api/v1/captcha with the header Authorization: Bearer <API Key>. Read the key from the EVERYINFRA_API_KEY environment variable; do not put it in the code.
- In the request body, set type to castle and put the parameters next to it at the same level.
- Required parameters:
- website_url: The exact page where this challenge appears, including the relevant path rather than only the site home page.
- website_key: The public site or widget key copied from this exact target integration; it is not a secret key.
- metadata: The structured, public client metadata required by the target Castle flow.
- Optional parameters:
- count: The requested number of results for this task, within the limits listed in the catalog.
- user_agent: The browser user agent for this challenge session; keep it consistent when the returned result is bound to that session.
- proxy: The proxy for the solve session; when a result is network-bound, use the same exit for the subsequent target request.
- Example request body:
{
"type": "castle",
"website_url": "<website_url>",
"website_key": "<website_key>",
"metadata": "<metadata>"
}
- Billing: $0.97 per 1,000 tokens ($0.000972 per token). Each call is charged per token: the price × count. You pay only for the tokens returned. Failed calls and empty results are not charged.
- On 422, fix the parameters using the suggestions and allowed values in the error. On 429 or 503, wait for Retry-After and try again.
Before writing code, ask me how many items I need to process and what format to save the results in, then confirm the plan and the rough cost with me.Request parameters
#| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
Authorization | header | string | Yes | - | Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository. |
type | body | string | Yes | castle | CAPTCHA type, fixed value. |
website_url | body | string | Yes | - | The exact page where this challenge appears, including the relevant path rather than only the site home page. |
website_key | body | string | Yes | - | The public site or widget key copied from this exact target integration; it is not a secret key. |
metadata | body | object | Yes | - | The structured, public client metadata required by the target Castle flow. |
count | body | number | No | - | The requested number of results for this task, within the limits listed in the catalog. |
user_agent | body | string | No | - | The browser user agent for this challenge session; keep it consistent when the returned result is bound to that session. |
proxy | body | string | No | - | The proxy for the solve session; when a result is network-bound, use the same exit for the subsequent target request. |
Code samples
#curl -X POST 'https://api.everyinfra.com/api/v1/captcha' \
-H "Authorization: Bearer $EVERYINFRA_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"type": "castle",
"website_url": "<website_url>",
"website_key": "<website_key>",
"metadata": "<metadata>"
}'OpenAPI definition (JSON)Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.
Response example
#{ "id": "req_…", "type": "castle", "solution": { "tokens": "…" }, "billing": { "charged": …, "charged_usd": …, "balance_after_usd": …, … }, "quota": { … }}
Where the Castle parameters come from
#website_key and metadata must come from the same target integration; count, user_agent, and proxy are optional request context.
Code to find these values on the page
[...document.scripts].map(s=>s.src).filter(s=>/castle\.io/.test(s))How to recognize Castle
#Castle is a risk and device-intelligence flow in which the target supplies structured metadata rather than a visible image puzzle.
What makes Castle different
It returns a token set. Do not collapse that set into one token or infer a visual CAPTCHA from the product name.
How to use the Castle API
#The Castle API returns a set of tokens in tokens. Its solution format is tokens. Submit the returned tokens together, the way the target site's request expects them.
- 01Read GET /api/v1/captcha/types and select the
castleentry. - 02Send
type: "castle"and the required parameters to POST /api/v1/captcha. - 03Read a set of tokens from
tokens. - 04Submit the returned tokens together, the way the target site's request expects them.
Billing and availability This type is priced per token: each call costs the listed price × count, and you pay only for the tokens returned. EverySolve charges only when a solution is delivered successfully. An unsuccessful attempt is not charged, and any held amount goes back to your balance automatically. Read available and the price fields from GET /api/v1/captcha/types at request time rather than treating them as static page content.
Castle integration questions
#How can I identify Castle before choosing a type?
Castle is a risk and device-intelligence flow in which the target supplies structured metadata rather than a visible image puzzle. Use castle only after those signals match the target challenge.
Which target-page values belong in Castle requests?
website_key and metadata must come from the same target integration; count, user_agent, and proxy are optional request context. Provide website_url, website_key, and metadata. Optional parameters are count, user_agent, and proxy.
What does Castle return, and what is easy to confuse it with?
The Castle API returns a set of tokens in tokens. Its solution format is tokens. It returns a token set. Do not collapse that set into one token or infer a visual CAPTCHA from the product name.
Which external source explains the Castle integration?
Castle's first-party site describes the risk and device-intelligence product context. [Open the Castle reference](https://castle.io/). EverySolve-specific fields and live availability still come from the type catalog.
Reference for Castle
#Related CAPTCHA types
#- Basilisk
basilisk$1.53 per 1,000 successful solutions - Capy Puzzle CAPTCHA
capy$3.06 per 1,000 successful solutions - GeeTest CAPTCHA
geetest$2.08 per 1,000 successful solutions - hCaptcha
hcaptcha$4.58 per 1,000 successful solutions - Lemin CAPTCHA
lemin$1.53 per 1,000 successful solutions - MTCaptcha
mtcaptcha$2.22 per 1,000 successful solutions
Errors and billing
#- 401
- Missing or invalid key.
- 402
- Insufficient balance. Top up first.
- 422
- Invalid parameter name or value. Fix it using the suggestions in the error. No charge.
- 429
- Per-minute request limit reached. Wait for Retry-After, then try again.
- 503
- Could not complete. The held charge is returned to your balance. If the outcome is unknown, verify it before you retry.
- 200 empty
- No data. No charge.