Your first request.
From a fresh workspace to a task result. No special SDK required.
Pre-launch documentation. HexSolver is under development. Check Service status and confirm access with support before sending live requests.
1. Create an API key.
Create your account and verify your email, then open Dashboard → API keys → Create API key. Give it a recognizable name, such as Development or Production.
The full key is displayed only once. Store it in a server-side environment variable or secret manager. Never include it in browser JavaScript, source control, support tickets, or screenshots.
HEXSOLVER_API_KEY=hx_live_YOUR_SECRET_KEY2. Create a task.
The public API origin is https://hexsolver.com. Replace the API key and example website URL with your own values. Confirm service availability and target-domain approval before making requests.
const response = await fetch( "https://hexsolver.com/api/v1/createTask", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ clientKey: process.env.HEXSOLVER_API_KEY, task: { type: "AntiAwsWafTaskProxyless", websiteURL: "https://your-site.example" } }) });const task = await response.json();if (!response.ok || task.errorId) { throw new Error(task.errorDescription || "Request failed");}const taskId = task.taskId;3. Retrieve the result.
Poll for a result with the same API key. Start at a two-second interval and stop after 120 seconds. Retry a processing response, but stop polling on a terminal error. Avoid tight loops.
const deadline = Date.now() + 120_000;let solution;while (Date.now() < deadline) { await new Promise(resolve => setTimeout(resolve, 2_000)); const response = await fetch( "https://hexsolver.com/api/v1/getTaskResult", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ clientKey: process.env.HEXSOLVER_API_KEY, taskId }) } ); const result = await response.json(); if (!response.ok || result.errorId) { throw new Error(result.errorDescription || "Request failed"); } if (result.status === "ready") { solution = result.solution; break; }}if (!solution) throw new Error("Task polling timed out");your-site.example is a placeholder for your approved target website. Keep task creation on your server. A polling timeout stops this example; it does not cancel the task. Check the same task ID before creating a replacement.
Safe retries with a request key.
For each logical task, generate and persist one unique Idempotency-Key header (8–128 letters, numbers, dots, colons, underscores, or hyphens). Reuse that key and the identical task body after a network timeout. You may instead send idempotencyKey in the JSON body; if both are present, they must match.
A retry returns the original task ID and does not reserve or charge again. Reusing a key with different task parameters returns IDEMPOTENCY_CONFLICT (HTTP 409). A failed or expired task is not restarted by replaying its key. Without a retry key, each createTask call is a separate task.
Idempotency-Key: order-5824-request-14. Check your balance.
The response includes balance, reserved, and available amounts in USD. A task temporarily reserves its price. A ready result finalizes the charge; a failed or expired task releases the reservation. When online payments are available, add prepaid credits from Dashboard → Billing. Otherwise, contact HexSolver support about availability.
{ "clientKey": "YOUR_API_KEY"}