Skip to Content
AnySolver logo
AnySolver

Overview

The base URL, API key authentication, JSON response envelope, errorId values and rate limits that every AnySolver API endpoint shares, with examples.

The AnySolver API takes JSON over HTTPS. Task and balance endpoints take JSON POST requests and return errorId in the body. The health check takes an unauthenticated GET and reports readiness through its HTTP status.

Base URL

Every endpoint lives under https://api.anysolver.com, for example https://api.anysolver.com/createTask.

Authentication

Send your API key as clientKey in the JSON body of task and balance requests, with the header Content-Type: application/json. A missing clientKey returns VALIDATION_ERROR, an unknown key returns ERROR_KEY_DOES_NOT_EXIST, and a body sent with another content type returns VALIDATION_ERROR.

{
    "clientKey": "YOUR_API_KEY"
}

Create and copy keys on the API keys page of a workspace in the dashboard: open the workspace from Workspaces. Every key belongs to one workspace, but a request never names it.

Endpoints

Workflow

Create the task: send createTask with the task body. The response holds a taskId.

Poll the task: send getTaskResult with the taskId, as often as every 0.5 seconds, until status is ready or failed.

Use the solution: when status is ready, read the token from solution and submit it to the target site.

To receive the result in the same request instead, use solveTask. Sync or async compares the two.

Response format

A successful response has errorId 0 and the endpoint's own fields:

Success
{
    "errorId": 0,
    "taskId": "01KFNDF328KAN2AJ3BNHCQYE88"
}

An error response has errorId 1 or 2, with errorCode and errorDescription:

Error
{
    "errorId": 1,
    "errorCode": "ERROR_KEY_DOES_NOT_EXIST",
    "errorDescription": "Invalid or missing API key. Check your dashboard for the correct key."
}

errorId tells you only that the request failed, not whose fault it is or whether to retry. VALIDATION_ERROR, for example, means your request must change, yet has errorId 2. Branch on errorCode: Error IDs explains both values, and Retries and idempotency says which codes to retry.

createTask, getTaskResult, solveTask and getBalance answer HTTP 200 for errors too, including rate-limit errors. GET /health is the exception: it answers HTTP 503 when the API cannot accept tasks. A path that is not an endpoint, or a wrong method such as GET /createTask, returns a plain HTTP 404 with no errorId:

Unknown path or method
{
    "message": "Route GET:/createTask not found",
    "error": "Not Found",
    "statusCode": 404
}

Rate limits

Two independent limits apply. Both return RATE_LIMITED with HTTP 200.

LimitValueWhat happens past it
Requests per client IP10,000 requests per 10 secondsEach request over the limit returns RATE_LIMITED until the window moves on.
Processing tasks per key1,000 tasks in processing by defaultcreateTask and solveTask return RATE_LIMITED before any charge.

The request limit counts every endpoint, polling included. A task stops counting against the processing limit as soon as it is ready or failed. The processing limit is set per API key. It exists to contain runaway traffic from a single compromised key, and it is not a paid feature: if your workload needs more, contact support and the cap on your key is raised at no extra cost. Contact support for a higher request limit per IP as well.

Every endpoint's response carries the state of the request limit for your client IP in three headers: x-ratelimit-limit (requests allowed per window), x-ratelimit-remaining (requests left in the current window) and x-ratelimit-reset (seconds until the window moves on). A request over the limit still answers HTTP 200, so read x-ratelimit-remaining to slow down before you reach it.

Request size

Each task and balance endpoint accepts a JSON body up to its own size limit:

EndpointLargest body
createTask32 MiB
solveTask32 MiB
getTaskResult16 KiB
getBalance16 KiB

A larger body returns VALIDATION_ERROR with Request body exceeds the maximum allowed size. in errorDescription, before any charge.