{"openapi":"3.1.0","info":{"title":"Solvepass API","version":"1.0.0","description":"Asynchronous captcha-solving API. Create a task, poll it, or receive a signed webhook. Live keys reserve credits and capture only on success; test keys return mock solutions.","contact":{"url":"https://solvepass.com/contact"},"license":{"name":"Proprietary"}},"servers":[{"url":"https://api.solvepass.com"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Tasks","description":"Create, list, cancel, and report tasks."},{"name":"Account","description":"Balance and key metadata."},{"name":"Types","description":"Supported challenge types and prices."}],"paths":{"/v1/tasks":{"get":{"tags":["Tasks"],"summary":"List recent tasks","operationId":"listTasks","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Recent tasks for the organization.","content":{"application/json":{"schema":{"type":"object","required":["tasks"],"properties":{"tasks":{"type":"array","items":{"$ref":"#/components/schemas/TaskSummary"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Tasks"],"summary":"Create a task","operationId":"createTask","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replays the same response for 24 hours. A different body with the same key returns 409.","schema":{"type":"string","maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskRequest"}}}},"responses":{"201":{"description":"Task accepted or completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/InsufficientCredits"},"422":{"$ref":"#/components/responses/InvalidRequest"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}}}},"/v1/tasks/{id}":{"get":{"tags":["Tasks"],"summary":"Get task status and solution","operationId":"getTask","parameters":[{"$ref":"#/components/parameters/TaskId"}],"responses":{"200":{"description":"Task state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/tasks/{id}/cancel":{"post":{"tags":["Tasks"],"summary":"Cancel a pending or queued task","operationId":"cancelTask","parameters":[{"$ref":"#/components/parameters/TaskId"}],"responses":{"200":{"description":"Task cancelled.","content":{"application/json":{"schema":{"type":"object","required":["ok","status"],"properties":{"ok":{"type":"boolean","const":true},"status":{"type":"string","const":"cancelled"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/v1/tasks/{id}/report":{"post":{"tags":["Tasks"],"summary":"Report a rejected token for refund review","description":"Accepted for 5 minutes after completion. Evidence of 10+ characters refunds the task price automatically; other reports go to review.","operationId":"reportTask","parameters":[{"$ref":"#/components/parameters/TaskId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRequest"}}}},"responses":{"201":{"description":"Report accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"}}}},"/v1/balance":{"get":{"tags":["Account"],"summary":"Get balance, reserved, and available credits","operationId":"getBalance","responses":{"200":{"description":"Organization balance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/v1/me":{"get":{"tags":["Account"],"summary":"Get organization and key metadata","operationId":"getMe","responses":{"200":{"description":"Organization, key, and balance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/v1/types":{"get":{"tags":["Types"],"summary":"List supported challenge types and prices","operationId":"listTypes","responses":{"200":{"description":"Supported types.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TypesResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"sp_live_... or sp_test_..."}},"parameters":{"TaskId":{"name":"id","in":"path","required":true,"schema":{"type":"string"}}},"responses":{"Unauthorized":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"NotFound":{"description":"The resource does not belong to this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Conflict":{"description":"The task or report is not in a state that allows the action.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"InvalidRequest":{"description":"The request body is invalid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"InsufficientCredits":{"description":"Available credits are below the task price.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"RateLimited":{"description":"Rate or concurrency limit exceeded.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-RateLimit-Limit":{"schema":{"type":"string"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Maintenance":{"description":"Task creation is paused by maintenance mode.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"schemas":{"TaskStatus":{"type":"string","enum":["pending","queued","processing","completed","failed","expired","cancelled"]},"Price":{"type":"object","required":["usd","credits"],"properties":{"usd":{"type":"string","examples":["0.000800"]},"credits":{"type":"string","examples":["0.800"]}}},"TaskError":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"message":{"type":["string","null"]}}},"Solution":{"type":"object","additionalProperties":true,"description":"Token for token types, or cf_clearance cookies plus user_agent for Cloudflare Challenge."},"TaskSummary":{"type":"object","required":["id","type","status","price","created_at"],"properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/ChallengeType"},"status":{"$ref":"#/components/schemas/TaskStatus"},"price":{"$ref":"#/components/schemas/Price"},"error_code":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"latency_ms":{"type":["integer","null"]}}},"Task":{"allOf":[{"$ref":"#/components/schemas/TaskSummary"},{"type":"object","properties":{"solution":{"oneOf":[{"$ref":"#/components/schemas/Solution"},{"type":"null"}]},"error":{"oneOf":[{"$ref":"#/components/schemas/TaskError"},{"type":"null"}]},"test":{"type":"boolean"}}}]},"ChallengeType":{"type":"string","enum":["hcaptcha","recaptcha_v2","recaptcha_v3","funcaptcha","cloudflare_turnstile","cloudflare_challenge"]},"CreateTaskRequest":{"type":"object","required":["type","pageurl"],"properties":{"type":{"$ref":"#/components/schemas/ChallengeType"},"sitekey":{"type":"string","description":"Required for every type except cloudflare_challenge."},"pageurl":{"type":"string","format":"uri"},"proxy":{"type":"string","description":"Proxy URL. Required for cloudflare_challenge and strongly recommended for other types."},"useragent":{"type":"string"},"action":{"type":"string"},"cdata":{"type":"string"},"min_score":{"type":"number","minimum":0,"maximum":1},"invisible":{"type":"boolean"},"enterprise":{"type":"boolean"},"rqdata":{"type":"string"},"blob":{"type":"string"},"surl":{"type":"string"},"callback_url":{"type":"string","format":"uri"},"metadata":{"type":"object","additionalProperties":true}}},"CreateTaskResponse":{"type":"object","required":["id","type","status","price","test","created_at"],"properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/ChallengeType"},"status":{"$ref":"#/components/schemas/TaskStatus"},"price":{"$ref":"#/components/schemas/Price"},"test":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"solution":{"$ref":"#/components/schemas/Solution"}}},"ReportRequest":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string","enum":["token_rejected","wrong_solution","other"]},"details":{"type":"string","maxLength":2000},"evidence":{"type":"string","maxLength":4000}}},"ReportResponse":{"type":"object","required":["id","task_id","status","auto_refund"],"properties":{"id":{"type":"string"},"task_id":{"type":"string"},"status":{"type":"string","enum":["pending","refunded","rejected"]},"auto_refund":{"type":"boolean"},"refund":{"oneOf":[{"type":"object","properties":{"credits":{"type":"string"},"usd":{"type":"string"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}}},"Amount":{"type":"object","required":["micros","credits","usd"],"properties":{"micros":{"type":"string"},"credits":{"type":"string"},"usd":{"type":"string"}}},"BalanceResponse":{"type":"object","required":["balance","reserved","available"],"properties":{"balance":{"$ref":"#/components/schemas/Amount"},"reserved":{"$ref":"#/components/schemas/Amount"},"available":{"$ref":"#/components/schemas/Amount"}}},"MeResponse":{"allOf":[{"$ref":"#/components/schemas/BalanceResponse"},{"type":"object","properties":{"org":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"plan":{"type":"string"},"status":{"type":"string"}}},"key":{"type":"object","properties":{"id":{"type":"string"},"env":{"type":"string","enum":["live","test"]},"prefix":{"type":"string"}}}}}]},"TypesResponse":{"type":"object","required":["types"],"properties":{"types":{"type":"array","items":{"type":"object","required":["type","name","output","price"],"properties":{"type":{"$ref":"#/components/schemas/ChallengeType"},"name":{"type":"string"},"output":{"type":"string","enum":["token","cookies"]},"price":{"oneOf":[{"$ref":"#/components/schemas/Price"},{"type":"null"}]}}}}}},"Problem":{"type":"object","required":["type","title","status","code","detail","request_id"],"properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"code":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}}}}}}