Find a section & browse all pages
Retrieve a solve
// poll a pending solve by id
Fetches a solve within your key's permitted result scope and gates. Depending on its policy, a key can read its own requests or those in its workspace. Poll any pending solve until status leaves pending. Reading never creates another solve or charges a credit. A successful credit-metered solve is charged when its result is persisted, not when you retrieve it.
curl https://api.solvegate.io/v1/solve/slv_8Kd2aF9 \
-H "Authorization: Bearer sk_live_•••"{
"id": "slv_8Kd2…aF9",
"status": "solved",
"token": "0.Xa3f…X9_cleared",
"solve_ms": 980
}Solve states
There are three states and two of them are terminal. Poll pending until the response reports solved or failed. These terminal statuses do not change, although the result itself expires. A 503 result_unavailable response is a retrieval failure: retry the same ID, rather than creating new work.
| status | Means | Poll again? |
|---|---|---|
| pending | Accepted and in flight. token is null. | Yes |
| solved | token contains the result while retained; it is null after result expiry. Use a non-null result promptly. | No |
| failed | error_code says why. Never billed. | No — create a new solve if you want to retry |
How often to poll. Start with a one-second interval and stop on either terminal state. Retrieval does not consume the POST solve rate limit, but a tight loop adds network and server work without making the solve finish sooner. Both SDKs provide wait(), which defaults to one-second polling and returns the latest solve if its local deadline passes; check its status before using the token.
{
"id": "slv_example",
"status": "pending",
"token": null,
"billed": false
}{
"id": "slv_example",
"status": "failed",
"token": null,
"billed": false,
"error_code": "user_proxy_error",
"error_message": "Your proxy refused or dropped the connection to the target."
}A 404 does not reveal restricted records. A missing id, a record removed by retention, another workspace's id, or a key's result-scope/gate restriction can return 404 not_found. Check the id, workspace and key policy.
Three separate lifetimes
Result storage, request history and target validity are separate. expires_at is the SolveGate result-storage cutoff, from the configured TTL (120 seconds by default). After that cutoff the retained record still says solved, with token: null and its original billed flag. Request records are retained separately (seven days by default), then can return 404. Cloudflare independently controls credential validity: Turnstile tokens are single-use and expire 300 seconds after generation; WAF cookies have their own expiry and session constraints.
{
"id": "slv_example",
"status": "solved",
"token": null,
"expires_at": 1714663200,
"meter": "credits",
"billed": true
}If the result store cannot serve an unexpired result, the API returns 503 result_unavailable with Retry-After: 1 and the solve's billed flag. Retrieve the same ID after that delay. This error neither cancels a solve nor refunds its charge; retrying does not extend the result lifetime.
Ready to pour through the gate?
// free sandbox keys · no card required to start