Retrieve a solve
// poll a pending solve by id
Fetches a solve belonging to your 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
}There are three states and two of them are terminal. pending is the only one worth polling; solved and failed never change afterwards, so a poll loop that does not stop on either will run until it times out on your side rather than ours.
| status | Means | Poll again? |
|---|---|---|
| pending | Accepted and in flight. token is null. | Yes |
| solved | token contains the result. Apply it promptly using the format for its gate. | 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.
A 404 does not reveal another workspace's records. A missing id, a record removed by retention, and an id belonging to another workspace all return 404 not_found. Check the id and workspace, and save results you need to keep.
Credential expiry and record retention are separate. expires_at is SolveGate's estimated use-by timestamp, derived from a configured TTL (120 seconds by default). It is not an expiry confirmed by Cloudflare. Turnstile tokens expire 300 seconds after generation and can be validated once; WAF cookies have their own expiry and session constraints. Raw solve records are subject to retention (seven days by default) and can later return 404.
Ready to pour through the gate?
// free sandbox keys · no card required to start