{"openapi":"3.1.0","info":{"title":"PromptGale API","version":"1.0.0","description":"PromptGale: collect answers and citations from AI answer engines. Credits are held when a task is accepted, charged when it completes and refunded when it fails. include.html saves a hosted evidence page (+0.25 credit, charged only when saved) on CHATGPT, GEMINI, PERPLEXITY, BING_COPILOT_SEARCH, META_AI, GOOGLE_AIO, GOOGLE_AIMODE; other engines answer 422 EVIDENCE_UNSUPPORTED. Every response carries X-Request-Id (send your own to correlate) and every error body error.requestId. Unknown /v1 paths answer 404 RESOURCE_NOT_FOUND and wrong methods 405 METHOD_NOT_ALLOWED, both in the JSON envelope. Lists answer { items, nextCursor, hasMore }. Browsers may call /v1 (CORS, no cookies). Idempotency: one key per account and endpoint (Idempotency-Key header or body idempotencyKey, up to 256 characters); the same body replays (Idempotent-Replayed: true), a different body is 409 with details.reason \"idempotency_mismatch\"; keys are kept at least 30 days. Deprecated paths keep working and send Deprecation and Link headers. An engine that exists but is disabled on this server answers 422 ENGINE_DISABLED (not retryable); one that is not available right now answers 503 ENGINE_UNAVAILABLE (retry later). Engines and countries depend on availability; call GET /v1/capabilities and GET /v1/countries.","termsOfService":"https://promptgale.com/terms","contact":{"name":"PromptGale support","email":"support@promptgale.com","url":"https://promptgale.com/docs"},"license":{"name":"Proprietary","url":"https://promptgale.com/terms"}},"externalDocs":{"description":"PromptGale docs","url":"https://promptgale.com/docs"},"servers":[{"url":"https://promptgale.com"},{"url":"https://api.promptgale.com"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"oauth2":["mcp:read"]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key (pk_live_..., full access) or OAuth access token (pgo_at_..., issued for resource <origin>/v1) as Authorization: Bearer."},"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key: pk_live_..."},"oauth2":{"type":"oauth2","description":"Authorization code with PKCE (S256); ask for resource=<origin>/v1. Scope mcp:read reads; mcp also creates and cancels tasks, grids and batches (read-only tokens get 403 insufficient_scope there). Metadata: /.well-known/oauth-protected-resource/v1.","flows":{"authorizationCode":{"authorizationUrl":"https://promptgale.com/oauth/authorize","tokenUrl":"https://promptgale.com/oauth/token","refreshUrl":"https://promptgale.com/oauth/token","scopes":{"mcp":"Run tasks and spend credits, and read everything","mcp:read":"Read tasks, results, batches, grids, usage and credits"}}}}},"headers":{"X-Request-Id":{"description":"Id of this request (a well-formed X-Request-Id you sent, or ours); also error.requestId. Quote it when reporting a problem.","schema":{"type":"string"}},"RateLimit-Limit":{"description":"Requests allowed per minute for this API key (or OAuth account).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the window resets.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"Location":{"description":"Absolute URL of the created (or still running) resource.","schema":{"type":"string","format":"uri"}},"Idempotent-Replayed":{"description":"true when an idempotency key returned an earlier result instead of creating one.","schema":{"type":"string","enum":["true"]}},"WWW-Authenticate":{"description":"Bearer realm=\"promptgale\" with resource_metadata; error=\"invalid_token\" or \"insufficient_scope\" when a token was refused.","schema":{"type":"string"}},"Preference-Applied":{"description":"wait=<seconds> when Prefer: wait was sent: the longest this request waited.","schema":{"type":"string"}},"X-Task-Id":{"description":"Id of the task.","schema":{"type":"string"}},"Deprecation":{"description":"true on deprecated paths; Link names the successor.","schema":{"type":"string"}},"Link":{"description":"<new path>; rel=\"successor-version\" on deprecated paths.","schema":{"type":"string"}},"Allow":{"description":"Methods the path takes.","schema":{"type":"string"}}},"schemas":{"TaskType":{"type":"string","enum":["CHATGPT","GEMINI","PERPLEXITY","BING_COPILOT_SEARCH","META_AI","GOOGLE_AIO","GOOGLE_AIMODE"],"description":"Canonical engine name. Engines and countries depend on availability; call GET /v1/capabilities and GET /v1/countries."},"AnswerPayload":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"country":{"type":"string","pattern":"^[A-Za-z]{2}$"},"brand":{"type":"string","minLength":1,"maxLength":200},"brandAliases":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"brandDomains":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"competitors":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"include":{"default":{"markdown":true,"html":false,"rawResponse":false,"screenshot":false,"analysis":false},"type":"object","properties":{"markdown":{"default":true,"type":"boolean"},"html":{"default":false,"type":"boolean"},"rawHtml":{"type":"boolean"},"rawResponse":{"default":false,"type":"boolean"},"screenshot":{"default":false,"type":"boolean"},"analysis":{"default":false,"type":"boolean"}},"additionalProperties":false},"state":{"type":"string","pattern":"^[A-Za-z]{2}$"},"uule":{"type":"string","minLength":6,"maxLength":700},"city":{"type":"string","minLength":1,"maxLength":100},"location":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180}},"required":["lat","lng"],"additionalProperties":false}},"required":["prompt"],"additionalProperties":false},"TaskInput":{"type":"object","required":["taskType","payload"],"additionalProperties":false,"properties":{"taskType":{"type":"string","description":"Engine. Case-insensitive; aliases accepted: GOOGLE, AIMODE, COPILOT_SEARCH, BING_AIMODE","examples":["CHATGPT","GEMINI"]},"payload":{"oneOf":[{"$ref":"#/components/schemas/AnswerPayload"}]},"webhookUrl":{"type":"string","format":"uri","description":"Receives task.completed / task.failed (signed)."},"idempotencyKey":{"type":"string","maxLength":256},"priority":{"type":"integer","minimum":0,"maximum":10,"default":0}}},"EngineResult":{"type":"object","properties":{"engine":{"type":"string","enum":["CHATGPT","GEMINI","PERPLEXITY","BING_COPILOT_SEARCH","META_AI","GOOGLE_AIO","GOOGLE_AIMODE"]},"text":{"type":"string"},"markdown":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"},"title":{"type":"string"},"domain":{"type":"string"},"snippet":{"type":"string"},"cited":{"type":"boolean"},"citationNumber":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["position","url","domain","cited"],"additionalProperties":false}},"organic":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"},"title":{"type":"string"},"snippet":{"type":"string"},"domain":{"type":"string"}},"required":["position","url","title","domain"],"additionalProperties":false}},"aiOverviewPresent":{"type":"boolean"},"searchQueries":{"type":"array","items":{"type":"string"}},"relatedQuestions":{"type":"array","items":{"type":"string"}},"model":{"type":"string"},"html":{"type":"string"},"screenshotBase64":{"type":"string"},"htmlUrl":{"type":"string"},"evidence":{"type":"object","properties":{"status":{"type":"string","enum":["ok","failed"]},"url":{"type":"string"},"expiresAt":{"type":"string"},"format":{"type":"string","enum":["snapshot","html+screenshot"]},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false,"required":["status"]},"cached":{"type":"boolean"},"cachedAt":{"type":"string"},"analysis":{"type":"object","properties":{"version":{"type":"number","const":1},"status":{"type":"string","enum":["ok","no_answer"]},"method":{"type":"string","enum":["rules","rules+llm"]},"brands":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"mentioned":{"type":"boolean"},"mentions":{"type":"integer","minimum":0,"maximum":9007199254740991},"firstPosition":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rank":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"cited":{"type":"boolean"},"citedUrls":{"type":"array","items":{"type":"string"}},"role":{"type":"string","enum":["target","competitor"]},"shareOfVoice":{"type":["number","null"]},"recommended":{"type":["boolean","null"]},"sentiment":{"anyOf":[{"type":"string","enum":["positive","neutral","negative"]},{"type":"null"}]},"sentimentReason":{"type":"string"}},"required":["name","mentioned","mentions","firstPosition","rank","cited","citedUrls","role"],"additionalProperties":false}},"brandsNamed":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"rank":{"type":"integer","minimum":1,"maximum":9007199254740991},"mentions":{"type":"integer","minimum":0,"maximum":9007199254740991},"firstPosition":{"type":"integer","minimum":0,"maximum":9007199254740991},"role":{"type":"string","enum":["target","competitor","other"]},"foundIn":{"type":"string","enum":["input","list","bold","heading","llm"]},"recommended":{"type":"boolean"},"shareOfVoice":{"type":"number"},"sentiment":{"anyOf":[{"type":"string","enum":["positive","neutral","negative"]},{"type":"null"}]}},"required":["name","rank","mentions","firstPosition","role","foundIn","recommended","shareOfVoice"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"},"domain":{"type":"string"},"cited":{"type":"boolean"},"kind":{"type":"string","enum":["owned","competitor","ugc","news","marketplace","review","reference","other"]},"brand":{"type":["string","null"]}},"required":["position","url","domain","cited","kind","brand"],"additionalProperties":false}},"citationKinds":{"type":"object","propertyNames":{"type":"string","enum":["owned","competitor","ugc","news","marketplace","review","reference","other"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":["owned","competitor","ugc","news","marketplace","review","reference","other"]},"llm":{"type":"object","properties":{"status":{"type":"string","enum":["ok","failed","skipped"]}},"additionalProperties":false,"required":["status"]}},"required":["status","brands"],"additionalProperties":false},"location":{"type":"object","properties":{"country":{"type":"string"},"locale":{"type":"string"},"timezone":{"type":"string"},"googleLocation":{"type":["string","null"]},"state":{"type":"string"},"city":{"type":"string"},"uule":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"},"approximate":{"type":"boolean"}},"additionalProperties":false,"required":["country","locale","timezone"],"description":"The location asked for and where the engine placed the request. approximate: the finer location (state, city, point) could only be approximated."},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"meta":{"type":"object","properties":{"localization":{"type":"object","properties":{"status":{"type":"string","enum":["ok","mismatch","unknown"]},"answerCountry":{"type":["string","null"]}},"required":["status","answerCountry"],"additionalProperties":false},"countryHint":{"type":"boolean"}},"additionalProperties":false,"description":"Answer localization, when the engine reports it."}},"required":["engine","text","sources","location","durationMs","meta"],"additionalProperties":false},"GridInput":{"type":"object","properties":{"taskType":{"type":"string","minLength":1,"maxLength":64},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"grid":{"type":"object","properties":{"center":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180}},"required":["lat","lng"],"additionalProperties":false},"place":{"type":"string","minLength":1,"maxLength":100},"rows":{"type":"integer","minimum":1,"maximum":9},"cols":{"type":"integer","minimum":1,"maximum":9},"spacingKm":{"type":"number","minimum":0.1,"maximum":50}},"required":["rows","cols","spacingKm"],"additionalProperties":false},"idempotencyKey":{"type":"string","minLength":1,"maxLength":256},"webhookUrl":{"type":"string","maxLength":2048,"format":"uri"},"priority":{"default":0,"type":"integer","minimum":0,"maximum":10}},"required":["taskType","payload","grid"],"additionalProperties":false,"description":"Location grid. taskType one of GOOGLE_AIO, GOOGLE_AIMODE, CHATGPT, GEMINI, BING_COPILOT_SEARCH. Each point is a task with payload.location; credits = engine price + 1 per point."},"LatLng":{"type":"object","required":["lat","lng"],"properties":{"lat":{"type":"number"},"lng":{"type":"number"}}},"Grid":{"type":"object","properties":{"id":{"type":"string","pattern":"^grd_"},"taskType":{"$ref":"#/components/schemas/TaskType"},"country":{"type":"string"},"center":{"$ref":"#/components/schemas/LatLng"},"place":{"type":["string","null"]},"rows":{"type":"integer"},"cols":{"type":"integer"},"spacingKm":{"type":"number"},"idempotencyKey":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"created":{"type":"integer","description":"POST only: points created by this request."},"summary":{"type":"object","properties":{"total":{"type":"integer"},"queued":{"type":"integer"},"processing":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"}}},"points":{"type":"array","description":"Row by row from the north-west corner.","items":{"type":"object","properties":{"row":{"type":"integer"},"col":{"type":"integer"},"key":{"type":"string","description":"Idempotency key of the point task: <gridId>:r<row>c<col>."},"location":{"$ref":"#/components/schemas/LatLng"},"task":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["QUEUED","PROCESSING","COMPLETED","FAILED"]},"credits":{"type":"number"},"error":{"oneOf":[{"$ref":"#/components/schemas/TaskError"},{"type":"null"}]}}},"answer":{"type":["string","null"],"description":"Answer text (finished points)."},"result":{"oneOf":[{"$ref":"#/components/schemas/EngineResult"},{"type":"null"}],"description":"With include=result."}}}}}},"BatchInput":{"type":"object","required":["items"],"additionalProperties":false,"properties":{"items":{"type":"array","minItems":1,"maxItems":10000,"items":{"allOf":[{"$ref":"#/components/schemas/TaskInput"}],"description":"A task request (its own idempotencyKey and webhookUrl allowed) plus an optional customId.","properties":{"customId":{"type":"string","maxLength":200,"description":"Your id for the item, echoed in the item list."}}}},"idempotencyKey":{"type":"string","maxLength":256,"description":"Same key and body within 30 days returns the first batch (200, Idempotent-Replayed); a different body: 409 idempotency_mismatch; older: 409 idempotency_key_expired."},"webhookUrl":{"type":"string","format":"uri","description":"Gets batch.completed once, and each item task.completed / task.failed unless the item has its own webhookUrl."},"metadata":{"type":"object","description":"Up to 8 KB of JSON, returned with the batch."}}},"BatchCounts":{"type":"object","properties":{"pending":{"type":"integer"},"queued":{"type":"integer"},"processing":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"},"rejected":{"type":"integer"}}},"Batch":{"type":"object","required":["id","status","total","counts","progress","credits","createdAt"],"properties":{"id":{"type":"string","pattern":"^bat_"},"status":{"type":"string","enum":["OPEN","COMPLETED"],"description":"COMPLETED when every item is completed, failed or rejected."},"total":{"type":"integer"},"counts":{"$ref":"#/components/schemas/BatchCounts"},"progress":{"type":"object","properties":{"done":{"type":"integer"},"percent":{"type":"number"}}},"credits":{"type":"object","description":"estimated: every item completing; held: admitted items not finished; charged: completed items; pending: items not admitted yet.","properties":{"estimated":{"type":"number"},"held":{"type":"number"},"charged":{"type":"number"},"pending":{"type":"number"}}},"idempotencyKey":{"type":["string","null"]},"webhookUrl":{"type":["string","null"]},"metadata":{},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}}},"BatchItem":{"type":"object","properties":{"index":{"type":"integer"},"customId":{"type":["string","null"]},"taskType":{"$ref":"#/components/schemas/TaskType"},"status":{"type":"string","enum":["pending","queued","processing","completed","failed","rejected"]},"taskId":{"type":["string","null"]},"credits":{"type":"number"},"error":{"oneOf":[{"$ref":"#/components/schemas/TaskError"},{"type":"null"}],"description":"Rejected items: INSUFFICIENT_CREDITS or TASK_CANCELLED; failed items: the task error. Null otherwise."},"completedAt":{"type":["string","null"],"format":"date-time"},"task":{"oneOf":[{"$ref":"#/components/schemas/Task"},{"type":"null"}],"description":"With include=result."}}},"QueueStatus":{"type":"object","properties":{"queued":{"type":"integer"},"processing":{"type":"integer"},"pendingBatchItems":{"type":"integer","description":"Batch items not queued yet."},"retrying":{"type":"integer","description":"Queued tasks waiting for a retry."},"concurrency":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":"integer"}}},"byPriority":{"type":"array","items":{"type":"object","properties":{"priority":{"type":"integer"},"queued":{"type":"integer"}}}},"byEngine":{"type":"array","items":{"type":"object","properties":{"taskType":{"type":"string"},"queued":{"type":"integer"},"processing":{"type":"integer"}}}},"oldestQueuedAt":{"type":["string","null"],"format":"date-time"}}},"UsState":{"type":"object","required":["code","name"],"properties":{"code":{"type":"string","examples":["TX"]},"name":{"type":"string"},"largestCity":{"type":"string"},"timezone":{"type":"string"}}},"Task":{"type":"object","required":["id","taskType","status","country","credits","createdAt"],"properties":{"id":{"type":"string","pattern":"^tsk_[0-9A-Za-z]{24}$"},"taskType":{"$ref":"#/components/schemas/TaskType"},"status":{"type":"string","enum":["QUEUED","PROCESSING","COMPLETED","FAILED"]},"source":{"type":"string","enum":["api","dashboard","mcp"]},"country":{"type":"string"},"priority":{"type":"integer"},"payload":{"type":"object"},"result":{"oneOf":[{"$ref":"#/components/schemas/EngineResult"},{"type":"null"}]},"error":{"oneOf":[{"$ref":"#/components/schemas/TaskError"},{"type":"null"}],"description":"FAILED tasks only."},"credits":{"type":"number","description":"Price of this task, in credits: held while it runs, charged when COMPLETED, refunded in full when FAILED (see creditsCharged)."},"creditsCharged":{"type":["number","null"],"description":"What the task cost in the end: equal to credits when COMPLETED, 0 when FAILED (refunded), null while QUEUED or PROCESSING."},"idempotencyKey":{"type":["string","null"]},"webhookUrl":{"type":["string","null"]},"durationMs":{"type":["integer","null"],"description":"Engine time of the last attempt, in ms. A task that was retried internally took longer end to end: use completedAt minus startedAt for the wall time."},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"batchId":{"type":"string","description":"Batch item tasks only."},"batchIndex":{"type":"integer","description":"Batch item tasks only: the item index."}}},"TaskEvent":{"type":"object","required":["id","at","level","msg"],"properties":{"id":{"type":["integer","string"]},"at":{"type":"string","format":"date-time"},"level":{"type":"string","enum":["info","warn","error"]},"msg":{"type":"string","description":"Queued, Running, Retrying, Completed, Failed: <reason>, Cancelled."}}},"GridSummary":{"type":"object","properties":{"id":{"type":"string","pattern":"^grd_"},"taskType":{"$ref":"#/components/schemas/TaskType"},"country":{"type":"string"},"place":{"type":["string","null"]},"center":{"$ref":"#/components/schemas/LatLng"},"rows":{"type":"integer"},"cols":{"type":"integer"},"spacingKm":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"summary":{"type":"object","properties":{"total":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"}}}}},"Stats":{"type":"object","properties":{"window":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}}},"now":{"type":"object","description":"Right now, whenever the tasks were created.","properties":{"queued":{"type":"integer"},"processing":{"type":"integer"},"pendingBatchItems":{"type":"integer"}}},"tasks":{"type":"object","properties":{"total":{"type":"integer"},"queued":{"type":"integer"},"processing":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"},"successRate":{"type":["number","null"],"description":"Percent of finished tasks that completed."},"credits":{"type":"number"}}},"byEngine":{"type":"array","items":{"type":"object","properties":{"taskType":{"type":"string"},"total":{"type":"integer"},"queued":{"type":"integer"},"processing":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"},"credits":{"type":"number"},"avgDurationMs":{"type":["number","null"]},"p95DurationMs":{"type":["number","null"]}}}},"topErrors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"integer"}}}}}},"Usage":{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date"},"taskType":{"type":"string"},"tasks":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"},"credits":{"type":"number","description":"Credits charged (completed tasks)."}}}}}},"GotoResult":{"type":"object","properties":{"url":{"type":"string"},"source":{"type":"string"},"cached":{"type":"boolean"},"method":{"type":"string","enum":["decoded","cache","request"]}}},"ClearQueueResult":{"type":"object","properties":{"cancelled":{"type":"integer"},"batchItemsCancelled":{"type":"integer"},"creditsReleased":{"type":"number"},"queued":{"type":"integer"}}},"BulkResult":{"type":"object","properties":{"tasks":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Task"}],"properties":{"existing":{"type":"boolean","description":"An idempotency key matched an earlier task."}}}},"created":{"type":"integer"}}},"TaskError":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["TIMEOUT","NO_ANSWER","ENGINE_REFUSED","ENGINE_ERROR","LOCATION_UNSUPPORTED","UNSUPPORTED","TASK_CANCELLED","INSUFFICIENT_CREDITS","ENGINE_DISABLED"],"description":"Why the task failed (credits refunded). TIMEOUT: no answer in time. NO_ANSWER: the engine returned no answer. ENGINE_REFUSED: the engine declined to answer the prompt. ENGINE_ERROR: the task could not be completed; try again later. LOCATION_UNSUPPORTED: the engine is not available for the requested location. UNSUPPORTED: the request is not supported by the engine. ENGINE_DISABLED: the engine was disabled on this server before the task ran. TASK_CANCELLED: cancelled while queued. INSUFFICIENT_CREDITS: a batch item that could not be paid for."},"message":{"type":"string","description":"Short fixed message for the code."}}},"Country":{"type":"object","required":["code","name","locale","timezone","available"],"properties":{"code":{"type":"string","description":"ISO 3166-1 alpha-2."},"name":{"type":"string"},"lang":{"type":"string"},"locale":{"type":"string"},"timezone":{"type":"string"},"hl":{"type":"string"},"gl":{"type":"string"},"acceptLanguage":{"type":"string"},"available":{"const":true}}},"EngineCapability":{"type":"object","properties":{"taskType":{"$ref":"#/components/schemas/TaskType"},"label":{"type":"string"},"kind":{"type":"string","enum":["answer"]},"status":{"type":"string","enum":["stable","beta"]},"aliases":{"type":"array","items":{"type":"string"}},"credits":{"type":"number"},"creditsMilli":{"type":"integer"},"input":{"type":"object","properties":{"required":{"type":"array","items":{"type":"string"}},"optional":{"type":"array","items":{"type":"string"}},"include":{"type":"array","items":{"type":"string"}}}},"supportsCountry":{"type":"boolean"},"countries":{"type":"array","items":{"type":"string"},"description":"Countries the engine is served from right now (ISO2)."},"location":{"type":"object","properties":{"state":{"type":"boolean"},"uule":{"type":"boolean"},"city":{"type":"boolean"},"location":{"type":"boolean"},"grid":{"type":"boolean"},"placeCredits":{"type":"number"}}},"evidence":{"type":"object","properties":{"supported":{"type":"boolean"},"credits":{"type":"number"}}}}},"Capabilities":{"type":"object","properties":{"engines":{"type":"array","items":{"$ref":"#/components/schemas/EngineCapability"},"description":"Engines available now."},"countries":{"type":"array","items":{"type":"string"},"description":"Countries served by at least one engine (ISO2)."},"extras":{"type":"object","properties":{"state":{"type":"number"},"location":{"type":"number"},"evidence":{"type":"number"}}},"evidence":{"type":"object","properties":{"engines":{"type":"array","items":{"$ref":"#/components/schemas/TaskType"}},"retentionDays":{"type":"integer"}}}}},"Capacity":{"type":"object","properties":{"engines":{"type":"array","items":{"type":"object","properties":{"taskType":{"$ref":"#/components/schemas/TaskType"},"status":{"type":"string","enum":["stable","beta"]},"queued":{"type":"integer"},"processing":{"type":"integer"},"oldestQueuedSec":{"type":["integer","null"]}}}},"at":{"type":"string","format":"date-time"}}},"ErrorResponse":{"type":"object","required":["success","error"],"examples":[{"success":false,"error":{"code":"VALIDATION_ERROR","message":"request validation failed","details":[{"path":"payload.prompt","message":"Too small: expected string to have >=1 characters"}],"timestamp":"2026-11-27T12:00:00.000Z","requestId":"req_5f0c9e2b7a4d4c1e9b8a6f3d2c1b0a99"}}],"properties":{"success":{"const":false},"error":{"type":"object","required":["code","message","timestamp"],"properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","MISSING_API_KEY","INVALID_API_KEY","INSUFFICIENT_CREDITS","PLAN_REQUIRED","FORBIDDEN","EMAIL_NOT_VERIFIED","ACCOUNT_SUSPENDED","RESOURCE_NOT_FOUND","RESOURCE_ALREADY_EXISTS","INVALID_STATE","METHOD_NOT_ALLOWED","LOCATION_UNSUPPORTED","REGION_UNSUPPORTED","EVIDENCE_UNSUPPORTED","ENGINE_DISABLED","ENGINE_UNAVAILABLE","SERVICE_UNAVAILABLE","QUEUE_LIMIT_EXCEEDED","RATE_LIMITED","PAYLOAD_TOO_LARGE","UNSUPPORTED_MEDIA_TYPE","INTERNAL_ERROR","GOOGLE_REDIRECT_UNRESOLVED"]},"message":{"type":"string"},"details":{"description":"Code-specific; details.reason refines some codes (grid_unsupported, daily_key_limit, idempotency_mismatch, idempotency_key_expired, insufficient_scope, task_not_queued)."},"timestamp":{"type":"string","format":"date-time"},"requestId":{"type":"string","description":"Same as the X-Request-Id header."}}}}}}},"paths":{"/v1/tasks":{"get":{"operationId":"listTasks","summary":"List tasks, newest first","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"engine","in":"query","schema":{"type":"string"},"description":"Engine (aliases accepted; alias parameter: taskType). An unknown name answers 400."},{"name":"status","in":"query","schema":{"type":"string","enum":["QUEUED","PROCESSING","COMPLETED","FAILED"]},"description":"Case-insensitive."},{"name":"createdAfter","in":"query","schema":{"type":"string"},"description":"ISO date or date-time: created at or after."},{"name":"createdBefore","in":"query","schema":{"type":"string"},"description":"ISO date or date-time: created before."},{"name":"include","in":"query","schema":{"type":"string","enum":["result"]}},{"name":"includeResult","in":"query","schema":{"type":"boolean"},"description":"Same as include=result."}],"responses":{"200":{"description":"Page of tasks","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","required":["items","nextCursor","hasMore"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"nextCursor":{"type":["string","null"],"description":"Opaque; pass it back as cursor. Null on the last page."},"hasMore":{"type":"boolean"}}}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Tasks"]},"post":{"operationId":"createTask","summary":"Queue a task","description":"Answers at once with the task (QUEUED). Poll GET /v1/tasks/{id}, wait with POST /v1/sync/task, or receive webhookUrl events.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":256},"description":"Same as the body idempotencyKey (the body wins). Replays the first result for the same body; a different body is 409 idempotency_mismatch. Kept at least 30 days."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskInput"},"examples":{"prompt":{"summary":"Ask one engine from the US, with brand analysis","value":{"taskType":"CHATGPT","payload":{"prompt":"best crm for a small agency","country":"US","brand":"Acme","competitors":["Globex","Initech"]},"idempotencyKey":"run-2026-11-27-001"}}}}}},"responses":{"200":{"description":"Existing task for this idempotency key (same request)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Task"}}}}}},"201":{"description":"Task accepted","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Location":{"$ref":"#/components/headers/Location"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Task"}}},"examples":{"example":{"summary":"Accepted and queued","value":{"success":true,"data":{"id":"tsk_8Jx0c2Lq9Vb3Nm5Rt7Wy1Ze4","taskType":"CHATGPT","source":"api","country":"US","priority":0,"payload":{"prompt":"best crm for a small agency","country":"US","brand":"Acme","competitors":["Globex","Initech"]},"credits":1.5,"idempotencyKey":"run-2026-11-27-001","webhookUrl":null,"createdAt":"2026-11-27T12:00:00.000Z","status":"QUEUED","result":null,"error":null,"creditsCharged":null,"durationMs":null,"startedAt":null,"completedAt":null}}}}}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_CREDITS: not enough credits (details.reason \"daily_key_limit\" when the API key's daily credit limit is reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"403":{"description":"FORBIDDEN: a read-only OAuth token (scope mcp:read) on a route that needs the mcp scope; details.reason \"insufficient_scope\", WWW-Authenticate error=\"insufficient_scope\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"RESOURCE_ALREADY_EXISTS: idempotency key reused with a different request (details.reason \"idempotency_mismatch\") or a batch key older than 30 days (\"idempotency_key_expired\")","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"413":{"description":"PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"415":{"description":"UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"422":{"description":"LOCATION_UNSUPPORTED / REGION_UNSUPPORTED / EVIDENCE_UNSUPPORTED: the engine does not take this location, country or include.html; ENGINE_DISABLED: the engine exists but is disabled on this server (not retryable); pick one from GET /v1/capabilities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"503":{"description":"ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"oauth2":["mcp"]}],"tags":["Tasks"]}},"/v1/tasks/{id}":{"get":{"operationId":"retrieveTask","summary":"Get a task and its result","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Task","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Task"}}},"examples":{"example":{"summary":"A completed task with its result","value":{"success":true,"data":{"id":"tsk_8Jx0c2Lq9Vb3Nm5Rt7Wy1Ze4","taskType":"CHATGPT","source":"api","country":"US","priority":0,"payload":{"prompt":"best crm for a small agency","country":"US","brand":"Acme","competitors":["Globex","Initech"]},"credits":1.5,"idempotencyKey":"run-2026-11-27-001","webhookUrl":null,"createdAt":"2026-11-27T12:00:00.000Z","status":"COMPLETED","error":null,"creditsCharged":1.5,"durationMs":14210,"startedAt":"2026-11-27T12:00:01.000Z","completedAt":"2026-11-27T12:00:16.000Z","result":{"engine":"CHATGPT","text":"For a small agency, the most recommended CRMs are Acme and Globex ...","sources":[{"position":1,"url":"https://example.com/best-crm","domain":"example.com","title":"Best CRMs for agencies","cited":true,"citationNumber":1}],"searchQueries":["best crm small agency"],"analysis":{"status":"ok","brands":[{"name":"Acme","role":"target","mentioned":true,"mentions":2,"firstPosition":52,"rank":1,"cited":false,"citedUrls":[],"shareOfVoice":66.7},{"name":"Globex","role":"competitor","mentioned":true,"mentions":1,"firstPosition":62,"rank":2,"cited":false,"citedUrls":[],"shareOfVoice":33.3}]},"location":{"country":"US","locale":"en-US","timezone":"America/New_York"},"durationMs":14210,"meta":{}}}}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"RESOURCE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Tasks"]},"delete":{"operationId":"cancelTask","summary":"Cancel a queued task","description":"Ends a QUEUED task FAILED with TASK_CANCELLED, releases its held credits and sends its webhook. A task that is no longer QUEUED: 409 INVALID_STATE (details.reason \"task_not_queued\", details.status).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The cancelled task","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Task"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"FORBIDDEN: a read-only OAuth token (scope mcp:read) on a route that needs the mcp scope; details.reason \"insufficient_scope\", WWW-Authenticate error=\"insufficient_scope\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"RESOURCE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"RESOURCE_ALREADY_EXISTS: idempotency key reused with a different request (details.reason \"idempotency_mismatch\") or a batch key older than 30 days (\"idempotency_key_expired\")","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"oauth2":["mcp"]}],"tags":["Tasks"]}},"/v1/tasks/{id}/events":{"get":{"operationId":"listTaskEvents","summary":"A task's timeline (queued, running, retrying, completed, failed, cancelled)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Events, oldest first","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","required":["items","nextCursor","hasMore"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TaskEvent"}},"nextCursor":{"type":["string","null"],"description":"Opaque; pass it back as cursor. Null on the last page."},"hasMore":{"type":"boolean"},"taskId":{"type":"string"}}}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"RESOURCE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Tasks"]}},"/v1/tasks/bulk":{"post":{"operationId":"createTasksBulk","summary":"Queue up to 500 tasks atomically","description":"All tasks are accepted or none. Every invalid item is reported in details.items (index, code, message, details; up to 50) with their shared code, or VALIDATION_ERROR when the codes differ. With a request-level key (idempotencyKey or Idempotency-Key) items without their own key get `<key>:<index>`; repeating the request replays the same tasks (200, Idempotent-Replayed), a different body under the key is 409.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":256},"description":"Same as the body idempotencyKey (the body wins). Replays the first result for the same body; a different body is 409 idempotency_mismatch. Kept at least 30 days."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tasks"],"properties":{"tasks":{"type":"array","minItems":1,"maxItems":500,"items":{"$ref":"#/components/schemas/TaskInput"}},"idempotencyKey":{"type":"string","maxLength":256}}}}}},"responses":{"200":{"description":"Every task existed already (idempotency keys)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/BulkResult"}}}}}},"201":{"description":"Tasks accepted (at least one created)","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/BulkResult"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_CREDITS: not enough credits (details.reason \"daily_key_limit\" when the API key's daily credit limit is reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"403":{"description":"FORBIDDEN: a read-only OAuth token (scope mcp:read) on a route that needs the mcp scope; details.reason \"insufficient_scope\", WWW-Authenticate error=\"insufficient_scope\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"RESOURCE_ALREADY_EXISTS: idempotency key reused with a different request (details.reason \"idempotency_mismatch\") or a batch key older than 30 days (\"idempotency_key_expired\")","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"413":{"description":"PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"415":{"description":"UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"422":{"description":"LOCATION_UNSUPPORTED / REGION_UNSUPPORTED / EVIDENCE_UNSUPPORTED: the engine does not take this location, country or include.html; ENGINE_DISABLED: the engine exists but is disabled on this server (not retryable); pick one from GET /v1/capabilities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"503":{"description":"ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"oauth2":["mcp"]}],"tags":["Tasks"]}},"/v1/async/task":{"post":{"operationId":"submitTask","summary":"Queue a task","description":"Deprecated: use POST /v1/tasks (same request and answer). Answers carry Deprecation: true and Link: </v1/tasks>; rel=\"successor-version\". Answers at once with the task (QUEUED). Poll GET /v1/tasks/{id}, wait with POST /v1/sync/task, or receive webhookUrl events.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":256},"description":"Same as the body idempotencyKey (the body wins). Replays the first result for the same body; a different body is 409 idempotency_mismatch. Kept at least 30 days."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskInput"},"examples":{"prompt":{"summary":"Ask one engine from the US, with brand analysis","value":{"taskType":"CHATGPT","payload":{"prompt":"best crm for a small agency","country":"US","brand":"Acme","competitors":["Globex","Initech"]},"idempotencyKey":"run-2026-11-27-001"}}}}}},"responses":{"200":{"description":"Existing task for this idempotency key (same request)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Task"}}}}}},"201":{"description":"Task accepted","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Location":{"$ref":"#/components/headers/Location"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Task"}}},"examples":{"example":{"summary":"Accepted and queued","value":{"success":true,"data":{"id":"tsk_8Jx0c2Lq9Vb3Nm5Rt7Wy1Ze4","taskType":"CHATGPT","source":"api","country":"US","priority":0,"payload":{"prompt":"best crm for a small agency","country":"US","brand":"Acme","competitors":["Globex","Initech"]},"credits":1.5,"idempotencyKey":"run-2026-11-27-001","webhookUrl":null,"createdAt":"2026-11-27T12:00:00.000Z","status":"QUEUED","result":null,"error":null,"creditsCharged":null,"durationMs":null,"startedAt":null,"completedAt":null}}}}}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_CREDITS: not enough credits (details.reason \"daily_key_limit\" when the API key's daily credit limit is reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"403":{"description":"FORBIDDEN: a read-only OAuth token (scope mcp:read) on a route that needs the mcp scope; details.reason \"insufficient_scope\", WWW-Authenticate error=\"insufficient_scope\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"RESOURCE_ALREADY_EXISTS: idempotency key reused with a different request (details.reason \"idempotency_mismatch\") or a batch key older than 30 days (\"idempotency_key_expired\")","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"413":{"description":"PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"415":{"description":"UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"422":{"description":"LOCATION_UNSUPPORTED / REGION_UNSUPPORTED / EVIDENCE_UNSUPPORTED: the engine does not take this location, country or include.html; ENGINE_DISABLED: the engine exists but is disabled on this server (not retryable); pick one from GET /v1/capabilities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"503":{"description":"ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"deprecated":true,"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"oauth2":["mcp"]}],"tags":["Tasks"]}},"/v1/async/task/batch":{"post":{"operationId":"submitBatch","summary":"Queue up to 500 tasks atomically","description":"Deprecated: use POST /v1/tasks/bulk (same request and answer). Answers carry Deprecation: true and Link: </v1/tasks/bulk>; rel=\"successor-version\". All tasks are accepted or none. Every invalid item is reported in details.items (index, code, message, details; up to 50) with their shared code, or VALIDATION_ERROR when the codes differ. With a request-level key (idempotencyKey or Idempotency-Key) items without their own key get `<key>:<index>`; repeating the request replays the same tasks (200, Idempotent-Replayed), a different body under the key is 409.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":256},"description":"Same as the body idempotencyKey (the body wins). Replays the first result for the same body; a different body is 409 idempotency_mismatch. Kept at least 30 days."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tasks"],"properties":{"tasks":{"type":"array","minItems":1,"maxItems":500,"items":{"$ref":"#/components/schemas/TaskInput"}},"idempotencyKey":{"type":"string","maxLength":256}}}}}},"responses":{"200":{"description":"Every task existed already (idempotency keys)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/BulkResult"}}}}}},"201":{"description":"Tasks accepted (at least one created)","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/BulkResult"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Link":{"$ref":"#/components/headers/Link"}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_CREDITS: not enough credits (details.reason \"daily_key_limit\" when the API key's daily credit limit is reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"403":{"description":"FORBIDDEN: a read-only OAuth token (scope mcp:read) on a route that needs the mcp scope; details.reason \"insufficient_scope\", WWW-Authenticate error=\"insufficient_scope\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"RESOURCE_ALREADY_EXISTS: idempotency key reused with a different request (details.reason \"idempotency_mismatch\") or a batch key older than 30 days (\"idempotency_key_expired\")","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"413":{"description":"PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"415":{"description":"UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"422":{"description":"LOCATION_UNSUPPORTED / REGION_UNSUPPORTED / EVIDENCE_UNSUPPORTED: the engine does not take this location, country or include.html; ENGINE_DISABLED: the engine exists but is disabled on this server (not retryable); pick one from GET /v1/capabilities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"503":{"description":"ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"deprecated":true,"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"oauth2":["mcp"]}],"tags":["Tasks"]}},"/v1/async/task/{id}":{"get":{"operationId":"getTask","summary":"Get a task and its result","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Task","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Task"}}},"examples":{"example":{"summary":"A completed task with its result","value":{"success":true,"data":{"id":"tsk_8Jx0c2Lq9Vb3Nm5Rt7Wy1Ze4","taskType":"CHATGPT","source":"api","country":"US","priority":0,"payload":{"prompt":"best crm for a small agency","country":"US","brand":"Acme","competitors":["Globex","Initech"]},"credits":1.5,"idempotencyKey":"run-2026-11-27-001","webhookUrl":null,"createdAt":"2026-11-27T12:00:00.000Z","status":"COMPLETED","error":null,"creditsCharged":1.5,"durationMs":14210,"startedAt":"2026-11-27T12:00:01.000Z","completedAt":"2026-11-27T12:00:16.000Z","result":{"engine":"CHATGPT","text":"For a small agency, the most recommended CRMs are Acme and Globex ...","sources":[{"position":1,"url":"https://example.com/best-crm","domain":"example.com","title":"Best CRMs for agencies","cited":true,"citationNumber":1}],"searchQueries":["best crm small agency"],"analysis":{"status":"ok","brands":[{"name":"Acme","role":"target","mentioned":true,"mentions":2,"firstPosition":52,"rank":1,"cited":false,"citedUrls":[],"shareOfVoice":66.7},{"name":"Globex","role":"competitor","mentioned":true,"mentions":1,"firstPosition":62,"rank":2,"cited":false,"citedUrls":[],"shareOfVoice":33.3}]},"location":{"country":"US","locale":"en-US","timezone":"America/New_York"},"durationMs":14210,"meta":{}}}}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Link":{"$ref":"#/components/headers/Link"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"RESOURCE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"deprecated":true,"description":"Deprecated: use GET /v1/tasks/{id} (same request and answer). Answers carry Deprecation: true and Link: </v1/tasks/{id}>; rel=\"successor-version\".","tags":["Tasks"]}},"/v1/sync/task":{"post":{"operationId":"runTask","summary":"Queue a task and wait for it (up to 290 s)","description":"Same body, checks and price as POST /v1/tasks. Holds the request up to 290 s, or less with `Prefer: wait=<seconds>` (0 = answer at once; answered with Preference-Applied). Not finished by then: 202 with the task and an absolute `Location` (GET /v1/tasks/{id}); it keeps running and is charged as usual. A repeated idempotencyKey waits on the task that holds the key (Idempotent-Replayed). `Accept: text/html` with payload.include.html answers the saved page of a completed task (X-Task-Id header); without include.html it is refused (400) before a task is created.","parameters":[{"name":"Prefer","in":"header","required":false,"schema":{"type":"string","examples":["wait=120"]}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","enum":["application/json","text/html"]}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":256},"description":"Same as the body idempotencyKey (the body wins). Replays the first result for the same body; a different body is 409 idempotency_mismatch. Kept at least 30 days."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskInput"},"examples":{"prompt":{"summary":"Ask one engine from the US, with brand analysis","value":{"taskType":"CHATGPT","payload":{"prompt":"best crm for a small agency","country":"US","brand":"Acme","competitors":["Globex","Initech"]},"idempotencyKey":"run-2026-11-27-001"}}}}}},"responses":{"200":{"description":"Finished task (COMPLETED or FAILED)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Task-Id":{"$ref":"#/components/headers/X-Task-Id"},"Preference-Applied":{"$ref":"#/components/headers/Preference-Applied"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Task"}}},"examples":{"example":{"summary":"A completed task with its result","value":{"success":true,"data":{"id":"tsk_8Jx0c2Lq9Vb3Nm5Rt7Wy1Ze4","taskType":"CHATGPT","source":"api","country":"US","priority":0,"payload":{"prompt":"best crm for a small agency","country":"US","brand":"Acme","competitors":["Globex","Initech"]},"credits":1.5,"idempotencyKey":"run-2026-11-27-001","webhookUrl":null,"createdAt":"2026-11-27T12:00:00.000Z","status":"COMPLETED","error":null,"creditsCharged":1.5,"durationMs":14210,"startedAt":"2026-11-27T12:00:01.000Z","completedAt":"2026-11-27T12:00:16.000Z","result":{"engine":"CHATGPT","text":"For a small agency, the most recommended CRMs are Acme and Globex ...","sources":[{"position":1,"url":"https://example.com/best-crm","domain":"example.com","title":"Best CRMs for agencies","cited":true,"citationNumber":1}],"searchQueries":["best crm small agency"],"analysis":{"status":"ok","brands":[{"name":"Acme","role":"target","mentioned":true,"mentions":2,"firstPosition":52,"rank":1,"cited":false,"citedUrls":[],"shareOfVoice":66.7},{"name":"Globex","role":"competitor","mentioned":true,"mentions":1,"firstPosition":62,"rank":2,"cited":false,"citedUrls":[],"shareOfVoice":33.3}]},"location":{"country":"US","locale":"en-US","timezone":"America/New_York"},"durationMs":14210,"meta":{}}}}}}}}},"202":{"description":"Still running; poll the Location (GET /v1/tasks/{id})","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Location":{"$ref":"#/components/headers/Location"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"Preference-Applied":{"$ref":"#/components/headers/Preference-Applied"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Task"}}}}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_CREDITS: not enough credits (details.reason \"daily_key_limit\" when the API key's daily credit limit is reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"403":{"description":"FORBIDDEN: a read-only OAuth token (scope mcp:read) on a route that needs the mcp scope; details.reason \"insufficient_scope\", WWW-Authenticate error=\"insufficient_scope\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"RESOURCE_ALREADY_EXISTS: idempotency key reused with a different request (details.reason \"idempotency_mismatch\") or a batch key older than 30 days (\"idempotency_key_expired\")","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"413":{"description":"PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"415":{"description":"UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"422":{"description":"LOCATION_UNSUPPORTED / REGION_UNSUPPORTED / EVIDENCE_UNSUPPORTED: the engine does not take this location, country or include.html; ENGINE_DISABLED: the engine exists but is disabled on this server (not retryable); pick one from GET /v1/capabilities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"503":{"description":"ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"oauth2":["mcp"]}],"tags":["Tasks"]}},"/v1/grids":{"get":{"operationId":"listGrids","summary":"Location grids, newest first (without points)","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Page of grids","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","required":["items","nextCursor","hasMore"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/GridSummary"}},"nextCursor":{"type":["string","null"],"description":"Opaque; pass it back as cursor. Null on the last page."},"hasMore":{"type":"boolean"}}}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Grids"]},"post":{"operationId":"submitGrid","summary":"Ask one prompt from every point of a location grid (up to 9 x 9)","description":"Validation, engine status, country and credits are checked for the whole grid first; then every point is queued as a task with payload.location. Sending the same grid again with the same idempotencyKey only creates the missing points. An engine without grids: 422 LOCATION_UNSUPPORTED with details.reason \"grid_unsupported\".","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":256},"description":"Same as the body idempotencyKey (the body wins). Replays the first result for the same body; a different body is 409 idempotency_mismatch. Kept at least 30 days."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GridInput"}}}},"responses":{"200":{"description":"Every point existed already","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Grid"}}}}}},"201":{"description":"Grid created (points queued)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Location":{"$ref":"#/components/headers/Location"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Grid"}}}}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_CREDITS: not enough credits (details.reason \"daily_key_limit\" when the API key's daily credit limit is reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"403":{"description":"FORBIDDEN: a read-only OAuth token (scope mcp:read) on a route that needs the mcp scope; details.reason \"insufficient_scope\", WWW-Authenticate error=\"insufficient_scope\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"RESOURCE_ALREADY_EXISTS: idempotency key reused with a different request (details.reason \"idempotency_mismatch\") or a batch key older than 30 days (\"idempotency_key_expired\")","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"413":{"description":"PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"415":{"description":"UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"422":{"description":"LOCATION_UNSUPPORTED / REGION_UNSUPPORTED / EVIDENCE_UNSUPPORTED: the engine does not take this location, country or include.html; ENGINE_DISABLED: the engine exists but is disabled on this server (not retryable); pick one from GET /v1/capabilities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"503":{"description":"ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"oauth2":["mcp"]}],"tags":["Grids"]}},"/v1/grids/{id}":{"get":{"operationId":"retrieveGrid","summary":"Get a location grid with its points","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","schema":{"type":"string","enum":["result"]}},{"name":"includeResult","in":"query","schema":{"type":"boolean"},"description":"Same as include=result."}],"responses":{"200":{"description":"Grid","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Grid"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"RESOURCE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Grids"]}},"/v1/async/task/grid":{"post":{"operationId":"createGrid","summary":"Ask one prompt from every point of a location grid (up to 9 x 9)","description":"Deprecated: use POST /v1/grids (same request and answer). Answers carry Deprecation: true and Link: </v1/grids>; rel=\"successor-version\". Validation, engine status, country and credits are checked for the whole grid first; then every point is queued as a task with payload.location. Sending the same grid again with the same idempotencyKey only creates the missing points. An engine without grids: 422 LOCATION_UNSUPPORTED with details.reason \"grid_unsupported\".","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":256},"description":"Same as the body idempotencyKey (the body wins). Replays the first result for the same body; a different body is 409 idempotency_mismatch. Kept at least 30 days."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GridInput"}}}},"responses":{"200":{"description":"Every point existed already","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Grid"}}}}}},"201":{"description":"Grid created (points queued)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Location":{"$ref":"#/components/headers/Location"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Grid"}}}}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_CREDITS: not enough credits (details.reason \"daily_key_limit\" when the API key's daily credit limit is reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"403":{"description":"FORBIDDEN: a read-only OAuth token (scope mcp:read) on a route that needs the mcp scope; details.reason \"insufficient_scope\", WWW-Authenticate error=\"insufficient_scope\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"RESOURCE_ALREADY_EXISTS: idempotency key reused with a different request (details.reason \"idempotency_mismatch\") or a batch key older than 30 days (\"idempotency_key_expired\")","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"413":{"description":"PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"415":{"description":"UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"422":{"description":"LOCATION_UNSUPPORTED / REGION_UNSUPPORTED / EVIDENCE_UNSUPPORTED: the engine does not take this location, country or include.html; ENGINE_DISABLED: the engine exists but is disabled on this server (not retryable); pick one from GET /v1/capabilities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"503":{"description":"ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"deprecated":true,"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"oauth2":["mcp"]}],"tags":["Grids"]}},"/v1/async/task/grid/{id}":{"get":{"operationId":"getGrid","summary":"Get a location grid with its points","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","schema":{"type":"string","enum":["result"]}},{"name":"includeResult","in":"query","schema":{"type":"boolean"},"description":"Same as include=result."}],"responses":{"200":{"description":"Grid","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Grid"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Link":{"$ref":"#/components/headers/Link"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"RESOURCE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"deprecated":true,"description":"Deprecated: use GET /v1/grids/{id} (same request and answer). Answers carry Deprecation: true and Link: </v1/grids/{id}>; rel=\"successor-version\".","tags":["Grids"]}},"/v1/states":{"get":{"operationId":"listStates","summary":"US states accepted by payload.state (other countries: empty)","security":[],"parameters":[{"name":"country","in":"query","required":true,"schema":{"type":"string","pattern":"^[A-Za-z]{2}$"}}],"responses":{"200":{"description":"States, by name","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/UsState"}}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Catalog and geo"]}},"/v1/credits":{"get":{"operationId":"getCredits","summary":"Credit balance and billing plan","description":"Balance in credits plus the billing state. Credits are spent in this order: included plan credits, then top-up credits, then other grants. Unused included credits roll over to the next period up to rollover_cap; top-up credits never expire. Plans and top-ups are bought at /dashboard/billing.","responses":{"200":{"description":"Balance in credits","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"available":{"type":"number"},"held":{"type":"number"},"used":{"type":"number"},"granted":{"type":"number"},"availableMilli":{"type":"integer"},"plan":{"type":"string","enum":["free","legacy","starter","growth","pro","scale"]},"billing_status":{"type":"string","enum":["free","trialing","active","past_due","paused","canceled","suspended"]},"period_end":{"type":["string","null"],"format":"date-time","description":"End of the current subscription period."},"included_remaining":{"type":"number","description":"Unspent included plan credits, not counting credits held by running tasks."},"topup_remaining":{"type":"number","description":"Unspent top-up credits, not counting credits held by running tasks."},"rollover_cap":{"type":["number","null"],"description":"Most included credits kept at the next renewal (1x the monthly allowance); null without a paid plan."}}}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Queue and account"]}},"/v1/usage":{"get":{"operationId":"getUsage","summary":"Usage per UTC day and engine","parameters":[{"name":"from","in":"query","schema":{"type":"string"},"description":"ISO date (YYYY-MM-DD) or date-time (read as its UTC day); inclusive. Default 29 days before to."},{"name":"to","in":"query","schema":{"type":"string"},"description":"ISO date or date-time; inclusive. Default today."}],"responses":{"200":{"description":"Usage rows","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Usage"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Queue and account"]}},"/v1/capabilities":{"get":{"operationId":"getCapabilities","summary":"Engines available now: taskType, aliases, status, credits, input fields (required / optional / include), served countries, location flags, evidence","responses":{"200":{"description":"Capabilities","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Capabilities"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Catalog and geo"]}},"/v1/countries":{"get":{"operationId":"listCountries","summary":"Countries we serve now, with locale data; with taskType only those that engine is served from","description":"Countries depend on availability and change over time. A task for a country not listed for its engine is refused with 422 REGION_UNSUPPORTED.","parameters":[{"name":"taskType","in":"query","schema":{"type":"string"},"description":"Engine; aliases accepted."},{"name":"model","in":"query","schema":{"type":"string"},"description":"Alias of taskType."}],"responses":{"200":{"description":"Countries","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Country"}}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"LOCATION_UNSUPPORTED / REGION_UNSUPPORTED / EVIDENCE_UNSUPPORTED: the engine does not take this location, country or include.html; ENGINE_DISABLED: the engine exists but is disabled on this server (not retryable); pick one from GET /v1/capabilities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"503":{"description":"ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Catalog and geo"]}},"/v1/batches":{"post":{"operationId":"createBatch","summary":"Create a batch of up to 10,000 tasks","description":"Every item is validated first; one invalid item refuses the batch (400, or the shared 4xx code) with details.items (index, code, message; up to 50) and nothing is stored. Items are stored pending and queued as room frees up: each account keeps at most a window of batch tasks queued or running (2 x its concurrency limit by default), accounts and batches take turns, and your single tasks run before your queued batch tasks of the same priority. Credits are held per item when it is queued; an item the account cannot pay for at that moment is rejected with INSUFFICIENT_CREDITS (no task, nothing held). When every item is finished the batch is COMPLETED and webhookUrl gets `{\"event\":\"batch.completed\",\"data\":<Batch>}`, signed like task webhooks over `<batchId>.<timestamp>.<body>` with promptgale-webhook-id `batch_<id>` (also sent as the deprecated plinda-webhook-id).","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":256},"description":"Same as the body idempotencyKey (the body wins). Replays the first result for the same body; a different body is 409 idempotency_mismatch. Kept at least 30 days."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchInput"},"examples":{"twoEngines":{"summary":"The same prompt on two engines","value":{"idempotencyKey":"run-2026-11-27","items":[{"customId":"q1-chatgpt","taskType":"CHATGPT","payload":{"prompt":"best crm","country":"US"}},{"customId":"q1-gemini","taskType":"GEMINI","payload":{"prompt":"best crm","country":"US"}}]}}}}}},"responses":{"200":{"description":"Batch created earlier with this idempotencyKey and body (last 30 days), unchanged","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Location":{"$ref":"#/components/headers/Location"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Batch"}}}}}},"202":{"description":"Batch stored; items are queued as room frees up","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Location":{"$ref":"#/components/headers/Location"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Batch"}}},"examples":{"example":{"summary":"Stored; items are queued as room frees up","value":{"success":true,"data":{"id":"bat_3kQ9Zx1Lm7Pv2Rt8","status":"OPEN","total":2,"counts":{"pending":2,"queued":0,"processing":0,"completed":0,"failed":0,"rejected":0},"progress":{"done":0,"percent":0},"credits":{"estimated":3,"held":0,"charged":0,"pending":3},"idempotencyKey":"run-2026-11-27","webhookUrl":null,"metadata":null,"createdAt":"2026-11-27T12:00:00.000Z","completedAt":null}}}}}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_CREDITS: not enough credits (details.reason \"daily_key_limit\" when the API key's daily credit limit is reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"403":{"description":"FORBIDDEN: a read-only OAuth token (scope mcp:read) on a route that needs the mcp scope; details.reason \"insufficient_scope\", WWW-Authenticate error=\"insufficient_scope\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"RESOURCE_ALREADY_EXISTS: idempotency key reused with a different request (details.reason \"idempotency_mismatch\") or a batch key older than 30 days (\"idempotency_key_expired\")","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"413":{"description":"PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"415":{"description":"UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"422":{"description":"LOCATION_UNSUPPORTED / REGION_UNSUPPORTED / EVIDENCE_UNSUPPORTED: the engine does not take this location, country or include.html; ENGINE_DISABLED: the engine exists but is disabled on this server (not retryable); pick one from GET /v1/capabilities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"503":{"description":"ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"oauth2":["mcp"]}],"tags":["Batches"]},"get":{"operationId":"listBatches","summary":"Batches, newest first","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"A bad value answers 400."},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["OPEN","COMPLETED"]},"description":"Case-insensitive."}],"responses":{"200":{"description":"Page of batches","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","required":["items","nextCursor","hasMore"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Batch"}},"nextCursor":{"type":["string","null"],"description":"Opaque; pass it back as cursor. Null on the last page."},"hasMore":{"type":"boolean"}}}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Batches"]}},"/v1/batches/{id}":{"get":{"operationId":"getBatch","summary":"Batch progress: counts by status, credits held and charged","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Batch","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Batch"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"RESOURCE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Batches"]}},"/v1/batches/{id}/cancel":{"post":{"operationId":"cancelBatch","summary":"Cancel a batch's pending items and queued tasks","description":"Pending items are rejected and queued tasks end FAILED, both with TASK_CANCELLED; held credits are released. Running tasks finish. A finished batch answers zeros.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Cancelled","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"cancelled":{"type":"integer"},"batchItemsCancelled":{"type":"integer"},"creditsReleased":{"type":"number"},"batch":{"$ref":"#/components/schemas/Batch"}}}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"FORBIDDEN: a read-only OAuth token (scope mcp:read) on a route that needs the mcp scope; details.reason \"insufficient_scope\", WWW-Authenticate error=\"insufficient_scope\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"RESOURCE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"oauth2":["mcp"]}],"tags":["Batches"]}},"/v1/batches/{id}/items":{"get":{"operationId":"listBatchItems","summary":"Batch items in submission order, a page at a time","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"nextCursor of the previous page (opaque; the plain item index is accepted too)."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000},"description":"Default 100 (max 1,000); with include=result default 20 (max 100)."},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","queued","processing","completed","failed","rejected"]},"description":"Case-insensitive."},{"name":"include","in":"query","schema":{"type":"string","enum":["result"]}},{"name":"includeResult","in":"query","schema":{"type":"boolean"},"description":"Same as include=result."}],"responses":{"200":{"description":"Items","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","required":["items","nextCursor","hasMore"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BatchItem"}},"nextCursor":{"type":["string","null"],"description":"Opaque; pass it back as cursor. Null on the last page."},"hasMore":{"type":"boolean"}}}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"RESOURCE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Batches"]}},"/v1/google/goto":{"post":{"operationId":"resolveGoogleRedirect","summary":"Resolve a Google redirect link to the page it leads to (no credits)","description":"Accepts google.com/goto?url=... (absolute or /goto?url=...) and /url?q=... links. /url links decode without a request; /goto links are requested and the answer is cached for 7 days. Google not answering in time: 502 GOOGLE_REDIRECT_UNRESOLVED with Retry-After when known.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string"}}}}}},"responses":{"200":{"description":"Final URL","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/GotoResult"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"415":{"description":"UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"502":{"description":"Error (502)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Utilities"]},"get":{"operationId":"resolveGoogleRedirectGet","summary":"Same as POST, with ?url=","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Final URL","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/GotoResult"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"502":{"description":"Error (502)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Utilities"]}},"/v1/queue":{"get":{"operationId":"getQueue","summary":"Your queue: queued and processing tasks, pending batch items, concurrency used and limit","responses":{"200":{"description":"Queue status","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/QueueStatus"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Queue and account"]},"delete":{"operationId":"cancelQueue","summary":"Cancel your queued tasks and pending batch items","description":"Each queued task ends FAILED with TASK_CANCELLED, its held credits are released and its webhook is sent. Running tasks keep running. Works for up to 20 s per call; `queued` is what is still waiting (call again while above 0).","responses":{"200":{"description":"Cancelled","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/ClearQueueResult"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"FORBIDDEN: a read-only OAuth token (scope mcp:read) on a route that needs the mcp scope; details.reason \"insufficient_scope\", WWW-Authenticate error=\"insufficient_scope\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"oauth2":["mcp"]}],"tags":["Queue and account"]}},"/v1/async/status":{"get":{"operationId":"getQueueStatus","summary":"Your queue: queued and processing tasks, pending batch items, concurrency used and limit","responses":{"200":{"description":"Queue status","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/QueueStatus"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Link":{"$ref":"#/components/headers/Link"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"deprecated":true,"description":"Deprecated: use GET /v1/queue (same request and answer). Answers carry Deprecation: true and Link: </v1/queue>; rel=\"successor-version\".","tags":["Queue and account"]}},"/v1/async/queue":{"delete":{"operationId":"clearQueue","summary":"Cancel your queued tasks and pending batch items","description":"Deprecated: use DELETE /v1/queue (same request and answer). Answers carry Deprecation: true and Link: </v1/queue>; rel=\"successor-version\". Each queued task ends FAILED with TASK_CANCELLED, its held credits are released and its webhook is sent. Running tasks keep running. Works for up to 20 s per call; `queued` is what is still waiting (call again while above 0).","responses":{"200":{"description":"Cancelled","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/ClearQueueResult"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Link":{"$ref":"#/components/headers/Link"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"FORBIDDEN: a read-only OAuth token (scope mcp:read) on a route that needs the mcp scope; details.reason \"insufficient_scope\", WWW-Authenticate error=\"insufficient_scope\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"deprecated":true,"security":[{"bearerAuth":[]},{"apiKeyAuth":[]},{"oauth2":["mcp"]}],"tags":["Queue and account"]}},"/v1/stats":{"get":{"operationId":"retrieveStats","summary":"Your task counts by status and engine for a window","parameters":[{"name":"hours","in":"query","schema":{"type":"number","exclusiveMinimum":0,"maximum":720,"default":24},"description":"Window ending now (fractions allowed)."},{"name":"from","in":"query","schema":{"type":"string"},"description":"ISO date (YYYY-MM-DD) or date-time."},{"name":"to","in":"query","schema":{"type":"string"},"description":"ISO date or date-time (default now)."}],"responses":{"200":{"description":"Stats","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Stats"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Queue and account"]}},"/v1/capacity":{"get":{"operationId":"retrieveCapacity","summary":"Load per available engine: status, queued and processing tasks, oldest queued age","responses":{"200":{"description":"Capacity","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Capacity"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"tags":["Catalog and geo"]}},"/stats":{"get":{"operationId":"getStats","summary":"Your task counts by status and engine for a window","parameters":[{"name":"hours","in":"query","schema":{"type":"number","exclusiveMinimum":0,"maximum":720,"default":24},"description":"Window ending now (fractions allowed)."},{"name":"from","in":"query","schema":{"type":"string"},"description":"ISO date (YYYY-MM-DD) or date-time."},{"name":"to","in":"query","schema":{"type":"string"},"description":"ISO date or date-time (default now)."}],"responses":{"200":{"description":"Stats","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Stats"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Link":{"$ref":"#/components/headers/Link"}}},"400":{"description":"Error (400)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"deprecated":true,"description":"Deprecated: use GET /v1/stats (same request and answer). Answers carry Deprecation: true and Link: </v1/stats>; rel=\"successor-version\".","tags":["Queue and account"]}},"/capacity":{"get":{"operationId":"getCapacity","summary":"Load per available engine: status, queued and processing tasks, oldest queued age","responses":{"200":{"description":"Capacity","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Capacity"}}}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Link":{"$ref":"#/components/headers/Link"}}},"401":{"description":"MISSING_API_KEY / INVALID_API_KEY: no credential, or an API key or OAuth access token that is invalid, expired, revoked or issued for another resource. Sends WWW-Authenticate: Bearer realm=\"promptgale\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests for this API key in the current minute, or QUEUE_LIMIT_EXCEEDED: too many pending tasks. Both send Retry-After (seconds); every authenticated response sends RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error (500)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}}},"deprecated":true,"description":"Deprecated: use GET /v1/capacity (same request and answer). Answers carry Deprecation: true and Link: </v1/capacity>; rel=\"successor-version\".","tags":["Catalog and geo"]}},"/evidence/{id}":{"get":{"operationId":"getEvidencePage","summary":"Saved evidence page of a task (include.html; CHATGPT, GEMINI, PERPLEXITY, BING_COPILOT_SEARCH, META_AI, GOOGLE_AIO, GOOGLE_AIMODE)","description":"Public (no API key; the id is unguessable) until it expires (30 days by default; see evidence.retentionDays in GET /v1/capabilities). Served with a CSP that blocks scripts, and X-Robots-Tag noindex.","security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^ev[0-9A-Za-z]{32}$"}}],"responses":{"200":{"description":"The page","content":{"text/html":{"schema":{"type":"string"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"404":{"description":"Unknown or expired"}},"tags":["Utilities"]}},"/openapi.json":{"get":{"operationId":"openapi","security":[],"summary":"This document","responses":{"200":{"description":"OpenAPI 3.1"}},"tags":["Service"]}},"/v1/openapi.json":{"get":{"operationId":"openapiV1","security":[],"summary":"This document (same as /openapi.json)","responses":{"200":{"description":"OpenAPI 3.1"},"405":{"description":"METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Service"]}},"/health":{"get":{"operationId":"health","security":[],"responses":{"200":{"description":"Process is up"}},"tags":["Service"]}},"/ready":{"get":{"operationId":"ready","security":[],"summary":"Readiness probe for the operator (not for API clients)","responses":{"200":{"description":"Database reachable"},"503":{"description":"Not ready"}},"tags":["Service"]}}},"tags":[{"name":"Tasks","description":"Queue a prompt on one engine, wait for it, read, list and cancel tasks."},{"name":"Grids","description":"Ask one prompt from every point of a location grid."},{"name":"Batches","description":"Queue up to 10,000 tasks in one call and read the items as they finish."},{"name":"Queue and account","description":"Your queue, statistics, credits and usage."},{"name":"Catalog and geo","description":"Engines available now, countries, US states and capacity."},{"name":"Utilities","description":"Google redirect links and saved evidence pages."},{"name":"Service","description":"This document and the health check."}]}