# PromptGale > PromptGale is a scraper API and remote MCP server for AI answer engines. Send a prompt, an engine (ChatGPT, Google AI Overviews, Google AI Mode, Gemini, Perplexity, Bing Copilot Search or Meta AI) and a country, and get back the answer the real app shows, its cited sources, the search queries it ran and brand mentions, as JSON. Use PromptGale when you need to know what ChatGPT, Google AI Overviews, Google AI Mode, Gemini, Perplexity, Bing Copilot Search and Meta AI actually tell people about a topic or a brand in a given country, from code or from an AI agent: the answer text, the sources it cites, the searches it ran and where each brand ranks, with a price per answer in credits. - Engines and countries depend on availability: call `GET /v1/capabilities` and `GET /v1/countries` for the current lists. - Base URL: https://promptgale.com. Authenticate every call with `X-API-Key: ` or `Authorization: Bearer ` (either one; keys look like `pk_live_...`, created in the dashboard). OAuth access tokens issued for `https://promptgale.com/v1` work too (`Authorization: Bearer pgo_at_...`; scope `mcp:read` reads, `mcp` also creates and cancels; discovery at `https://promptgale.com/.well-known/oauth-protected-resource/v1`). - Every JSON response is `{ "success": true, "data": ... }` or `{ "success": false, "error": { "code", "message", "details", "timestamp", "requestId" } }`, unknown `/v1` paths included (404 `RESOURCE_NOT_FOUND`; a wrong method is 405 `METHOD_NOT_ALLOWED` with `Allow`). Every response has `X-Request-Id` (send your own to correlate). - Lists answer `{ items, nextCursor, hasMore }`; pass `nextCursor` back as `cursor`. `include=result` and `includeResult=true` both add results; status filters are case-insensitive. - Idempotency: `Idempotency-Key` header or `idempotencyKey` (up to 256 characters). The same body replays the first result (`Idempotent-Replayed: true`); a different body is 409 with `details.reason` `idempotency_mismatch`. Keys are kept at least 30 days. - Old paths (`/v1/async/...`, `/stats`, `/capacity`) keep working and send `Deprecation: true` with a `Link` to the new path. - Limits: requests per minute per API key (`RateLimit-*` headers; over it 429 `RATE_LIMITED` with `Retry-After`), JSON bodies up to about 1 MB (16 MB for `POST /v1/batches`; above: 413 `PAYLOAD_TOO_LARGE`). An engine that exists but is turned off right now answers 503 `ENGINE_UNAVAILABLE` (retry later); one that is disabled on this server answers 422 `ENGINE_DISABLED` (not retryable: pick an engine from `GET /v1/capabilities`); an unknown taskType is 400. - Webhooks: `webhookUrl` gets `task.completed`, `task.failed` or `batch.completed`, signed with HMAC-SHA256 in `promptgale-webhook-id`, `promptgale-webhook-timestamp` and `promptgale-webhook-signature` (the older `plinda-webhook-*` names carry the same values and are deprecated). - Credits are held when a task is accepted, charged when it completes and refunded when it fails. - OpenAPI 3.1 (the source of truth for these files): https://promptgale.com/openapi.json ## MCP server (connect an agent) - URL: https://promptgale.com/mcp (Streamable HTTP, stateless). Full instructions per client: https://promptgale.com/connect.txt - Auth: OAuth 2.1 with PKCE S256. Discovery: `https://promptgale.com/.well-known/oauth-protected-resource/mcp` (RFC 9728) and `https://promptgale.com/.well-known/oauth-authorization-server` (RFC 8414). Clients register with a Client ID Metadata Document (https client_id) or Dynamic Client Registration (`POST https://promptgale.com/oauth/register`); the user logs in and approves in the browser. Scopes: `mcp` (run tasks, spend credits, read everything) and `mcp:read` (read only). - API keys also work: `X-API-Key: pk_live_...` or `Authorization: Bearer pk_live_...`. - Tools: - `whoami`: account, user, connection (OAuth client and scopes or API key), credits and links - `get_capabilities`: engines available now with price, inputs, location support and countries - `list_countries`: countries served, optionally for one engine - `list_states`: US states for the state option - `run_prompt`: ask one AI answer engine and wait for the answer, sources and brand analysis (waitSeconds 0: queue and get a taskId at once) - `submit_prompt`: queue a prompt and get a taskId at once (deprecated: run_prompt with waitSeconds 0) - `run_task`: any engine with the full REST payload, waits (dryRun: cost estimate only) - `submit_task`: any engine with the full REST payload, returns a taskId (deprecated: run_task with waitSeconds 0) - `get_task`: status and result of a task; waitSeconds polls until it finishes - `list_tasks`: tasks with engine and status filters and pagination - `submit_batch`: up to 10,000 tasks: prompts x engines or items (dryRun: cost estimate only) - `get_batch`: batch progress and credits - `list_batch_items`: batch items, optionally with results - `list_batches`: recent batches - `submit_location_grid`: one prompt or query from every point of a map grid - `get_location_grid`: grid points with status and short answers - `list_location_grids`: recent grids - `get_credits`: credit balance - `get_usage`: tasks and credits per day and engine - `get_stats`: counts, success rate and top errors for the last hours - `get_queue_status`: queued and running tasks, concurrency limit - `clear_queue`: cancel every queued task and release their credits (destructive) - `cancel_task`: cancel one queued task and release its credits (destructive) - `cancel_batch`: cancel the queued work of one batch and release its credits (destructive) - `get_capacity`: engine status and load - `list_api_keys`: REST API key names and prefixes (keys are created and revoked in the dashboard) - `resolve_google_redirect`: the page a Google redirect link leads to Prompt a user can paste into an agent to connect it: ```text Connect yourself to PromptGale (AI answer engine data) through its MCP server. 1. Add a remote MCP server named "promptgale" with the URL https://promptgale.com/mcp Transport: Streamable HTTP. Authentication: OAuth, discovered automatically from the server. No API key needed. Use your own MCP settings, CLI or config file. For example: - Claude Code: claude mcp add --transport http promptgale https://promptgale.com/mcp - Codex: codex mcp add promptgale --url https://promptgale.com/mcp - Gemini CLI: gemini mcp add --transport http --scope user promptgale https://promptgale.com/mcp - OpenClaw: openclaw mcp set promptgale '{"url":"https://promptgale.com/mcp","transport":"streamable-http","auth":"oauth"}' - Hermes Agent: hermes mcp add --url https://promptgale.com/mcp --auth oauth promptgale 2. Start the sign-in for "promptgale" (Claude Code: run /mcp; Codex: codex mcp login promptgale; Gemini CLI: /mcp auth promptgale; OpenClaw: openclaw mcp login promptgale; Hermes Agent: hermes mcp login promptgale). My browser opens a PromptGale page where I log in and click Approve. Wait until the server shows as connected. 3. Check it works: call the whoami tool and tell me which account you are connected to and its available credits. Then call get_capabilities and tell me in a few lines what you can do (engines, countries, prices). If your client stops tool calls after about a minute, raise its MCP tool timeout to 300 s (Codex: tool_timeout_sec = 300) or pass waitSeconds and poll get_task. If you cannot add MCP servers yourself, tell me exactly where to paste https://promptgale.com/mcp in your app (for example in Claude: Customize > Connectors > Add custom connector) and wait for me to finish. If your app does not support OAuth for MCP, ask me for an API key (I create one at https://promptgale.com/dashboard/keys) and send it as the header X-API-Key (Authorization: Bearer works too). Never write the key into a file that is shared or committed. ``` ## Pricing Pick a monthly plan, then pay per answer in credits. Prices are in USD and exclude tax. The live offer is on [the pricing page](https://promptgale.com/pricing). ### Plans | Plan | Price per month | Credits per month | Price per credit | Tasks running at once | Batches | | --- | --- | --- | --- | --- | --- | | Starter | $19 | 2,000 | $0.0095 | 2 | up to 100 items, no grids | | Growth | $79 | 10,000 | $0.0079 | 4 | up to 10,000 items, location grids | | Pro | $299 | 50,000 | $0.00598 | 8 | up to 10,000 items, location grids | | Scale | $999 | 200,000 | $0.005 | 16 | up to 10,000 items, location grids | More volume than the largest plan: contact support for an Enterprise plan. ### Credits per answer Each engine has a price in credits per task. The dollar columns are that price on the Starter and Scale plans. | Engine | `taskType` | Credits | On Starter | On Scale | | --- | --- | --- | --- | --- | | ChatGPT | `CHATGPT` | 1.5 | $0.0142 | $0.00749 | | Gemini | `GEMINI` | 1.5 | $0.0142 | $0.00749 | | Perplexity | `PERPLEXITY` | 1.5 | $0.0142 | $0.00749 | | Bing Copilot Search | `BING_COPILOT_SEARCH` | 1 | $0.0095 | $0.005 | | Meta AI | `META_AI` | 2 | $0.019 | $0.00999 | | Google AI Overview | `GOOGLE_AIO` | 1 | $0.0095 | $0.005 | | Google AI Mode | `GOOGLE_AIMODE` | 1 | $0.0095 | $0.005 | - A US state or a map point adds 1 credit. A city or a Google location value adds nothing. - A saved evidence page (`include.html`) adds 0.25 credit, only when the page was saved. - Reading results, credits, usage, countries and capabilities is free, over REST and MCP. ### When credits are held, charged and refunded 1. When a task is accepted, its price is held from your available credits. A task you cannot pay for is refused with `402` `INSUFFICIENT_CREDITS`. 2. When it completes, the held credits are charged (`creditsCharged` equals `credits`). 3. When it fails, the held credits are refunded in full (`creditsCharged` is `0`). Cancelling a queued task releases them too. Batch items hold their credits one by one as they enter the queue, so a large batch holds credits only for the items queued or running. ### Trial, top-ups and renewals - New accounts can try the Starter plan for 1 day with 25 trial credits. A card is required and is charged at the end of the trial unless you cancel. Trial credits expire when the trial ends. One trial per customer. - Accounts with a plan can buy top-ups at any time: 2,000 credits for $19, 5,000 credits for $49, 10,000 credits for $99. Top-up credits never expire. - Credits are spent in this order: plan credits, then top-up credits, then other grants. - Each paid month adds the plan's credits. Unused plan credits roll over up to one month's allowance; the rest expires at renewal. - Upgrades apply at once, with the extra credits prorated for the rest of the period. Downgrades and cancellation apply at the end of the period. - Without a paid plan an account has the free limits: 1 task at a time, 50 in the queue, no batches. - Refunds of payments follow the [refund policy](https://promptgale.com/refunds). Your balance, plan and renewal date are at `GET /v1/credits`; credits per day and engine at `GET /v1/usage`. ## Endpoints ### Tasks - `GET /v1/tasks`: List tasks, newest first - `POST /v1/tasks`: Queue a task - `GET /v1/tasks/{id}`: Get a task and its result - `DELETE /v1/tasks/{id}`: Cancel a queued task - `GET /v1/tasks/{id}/events`: A task's timeline (queued, running, retrying, completed, failed, cancelled) - `POST /v1/tasks/bulk`: Queue up to 500 tasks atomically - `POST /v1/async/task`: deprecated, use POST /v1/tasks - `POST /v1/async/task/batch`: deprecated, use POST /v1/tasks/bulk - `GET /v1/async/task/{id}`: deprecated, use GET /v1/tasks/{id} - `POST /v1/sync/task`: Queue a task and wait for it (up to 290 s) ### Grids - `GET /v1/grids`: Location grids, newest first (without points) - `POST /v1/grids`: Ask one prompt from every point of a location grid (up to 9 x 9) - `GET /v1/grids/{id}`: Get a location grid with its points - `POST /v1/async/task/grid`: deprecated, use POST /v1/grids - `GET /v1/async/task/grid/{id}`: deprecated, use GET /v1/grids/{id} ### Batches - `POST /v1/batches`: Create a batch of up to 10,000 tasks - `GET /v1/batches`: Batches, newest first - `GET /v1/batches/{id}`: Batch progress: counts by status, credits held and charged - `POST /v1/batches/{id}/cancel`: Cancel a batch's pending items and queued tasks - `GET /v1/batches/{id}/items`: Batch items in submission order, a page at a time ### Queue and account - `GET /v1/credits`: Credit balance and billing plan - `GET /v1/usage`: Usage per UTC day and engine - `GET /v1/queue`: Your queue: queued and processing tasks, pending batch items, concurrency used and limit - `DELETE /v1/queue`: Cancel your queued tasks and pending batch items - `GET /v1/async/status`: deprecated, use GET /v1/queue - `DELETE /v1/async/queue`: deprecated, use DELETE /v1/queue - `GET /v1/stats`: Your task counts by status and engine for a window - `GET /stats`: deprecated, use GET /v1/stats ### Catalog and geo - `GET /v1/states`: US states accepted by payload.state (other countries: empty) - `GET /v1/capabilities`: Engines available now: taskType, aliases, status, credits, input fields (required / optional / include), served countries, location flags, evidence - `GET /v1/countries`: Countries we serve now, with locale data; with taskType only those that engine is served from - `GET /v1/capacity`: Load per available engine: status, queued and processing tasks, oldest queued age - `GET /capacity`: deprecated, use GET /v1/capacity ### Utilities - `POST /v1/google/goto`: Resolve a Google redirect link to the page it leads to (no credits) - `GET /v1/google/goto`: Same as POST, with ?url= - `GET /evidence/{id}`: Saved evidence page of a task (include.html; CHATGPT, GEMINI, PERPLEXITY, BING_COPILOT_SEARCH, META_AI, GOOGLE_AIO, GOOGLE_AIMODE) ### Service - `GET /openapi.json`: This document - `GET /v1/openapi.json`: This document (same as /openapi.json) - `GET /health`: health ## Engines | taskType | Engine | Required | Credits | include.html | Aliases | | --- | --- | --- | --- | --- | --- | | `CHATGPT` | ChatGPT | `prompt` | 1.5 | yes | - | | `GEMINI` | Gemini | `prompt` | 1.5 | yes | - | | `PERPLEXITY` | Perplexity | `prompt` | 1.5 | yes | - | | `BING_COPILOT_SEARCH` | Bing Copilot Search | `prompt` | 1 | yes | `BING_AIMODE`, `COPILOT_SEARCH` | | `META_AI` | Meta AI | `prompt` | 2 | yes | - | | `GOOGLE_AIO` | Google AI Overview | `prompt` | 1 | yes | `GOOGLE` | | `GOOGLE_AIMODE` | Google AI Mode | `prompt` | 1 | yes | `AIMODE` | ## Agent skills - [collect-ai-answers](https://promptgale.com/.well-known/agent-skills/collect-ai-answers/SKILL.md) - [track-ai-visibility](https://promptgale.com/.well-known/agent-skills/track-ai-visibility/SKILL.md) - [research-ai-prompts](https://promptgale.com/.well-known/agent-skills/research-ai-prompts/SKILL.md) ## Docs ### Get started - [PromptGale docs](https://promptgale.com/docs/index.md): See what PromptGale returns from ChatGPT, Google AI Overviews, Google AI Mode and more: answers, citations, search queries and brand mentions, and where to start. - [Quickstart](https://promptgale.com/docs/quickstart.md): Send your first prompt to ChatGPT from a chosen country and read the answer and its cited sources in two minutes, with curl, Python or Node.js. - [Examples](https://promptgale.com/docs/examples.md): Copy and run recipes: ask an engine from a country and read citations, track a brand across engines, compare countries, use webhooks and export CSV. - [Authentication](https://promptgale.com/docs/authentication.md): Authenticate API calls with an API key or an OAuth access token, see what each auth error means, and read the rate limit headers of every response. ### API - [Tasks](https://promptgale.com/docs/tasks.md): Queue a prompt on ChatGPT, Google AI Overviews, Google AI Mode and more, poll it or get a webhook, retry safely with an idempotency key, and list or cancel tasks. - [Sync tasks](https://promptgale.com/docs/sync.md): Run a prompt and get the AI answer, its sources and the brand analysis back in a single HTTP call that stays open for up to 290 seconds. - [Batches](https://promptgale.com/docs/batches.md): Track thousands of prompts across engines and countries in one call, follow progress and credits, and read each answer as soon as it finishes. - [Request fields](https://promptgale.com/docs/payload.md): Set every field of a task request: the engine, the prompt, the country, US state or city, your brand and competitors, and what the result includes. - [Results](https://promptgale.com/docs/results.md): Read the JSON of a finished task: answer text, cited sources, the search queries the engine ran, and brand mentions, rank and share of voice. - [Countries and locations](https://promptgale.com/docs/locations.md): Ask an AI engine from a chosen country, US state, city or map point, check which countries each engine serves, and run location grids of up to 9 by 9. - [Webhooks](https://promptgale.com/docs/webhooks.md): Receive finished answers at your own URL with automatic retries, and verify the HMAC-SHA256 signature in Node.js or Python before you trust them. - [Evidence pages](https://promptgale.com/docs/evidence.md): Save the screen the engine showed for an answer as a hosted page you can share with a client or check later, for 0.25 credit when it is saved. - [Errors](https://promptgale.com/docs/errors.md): Handle API errors: the error envelope, every error code with its HTTP status, which ones to retry, and the codes of a task that fails while running. - [Queue, stats and usage](https://promptgale.com/docs/operations.md): Watch your queue, success rate, durations and engine capacity, and read your credit balance and daily usage per engine, without spending credits. - [SDKs and client libraries](https://promptgale.com/docs/sdks.md): Call the API from any language: there is no published SDK yet, so use fetch or requests, or generate a typed client from the OpenAPI 3.1 document. ### Agents - [Connect an agent](https://promptgale.com/docs/mcp.md): Add PromptGale as a remote MCP server with OAuth sign-in, then use its tools to ask AI answer engines, run batches and read results from your agent. - [Connect Claude Code](https://promptgale.com/docs/connect-claude-code.md): One command adds the PromptGale MCP server to Claude Code, with OAuth sign-in, so you can ask AI answer engines from your terminal and read the sources. - [Connect Cursor](https://promptgale.com/docs/connect-cursor.md): Add PromptGale to ~/.cursor/mcp.json or with the one-click link, sign in with OAuth, and ask AI answer engines from Cursor chat and agents. - [Connect Claude](https://promptgale.com/docs/connect-claude.md): Add PromptGale to Claude as a custom connector in claude.ai, Claude Desktop or mobile, approve with OAuth, and ask AI answer engines from a chat. - [Connect ChatGPT](https://promptgale.com/docs/connect-chatgpt.md): Add PromptGale to ChatGPT as a custom MCP server (plugin) by its URL, sign in with OAuth, and ask other AI answer engines from a ChatGPT chat. - [Connect Codex](https://promptgale.com/docs/connect-codex.md): Add PromptGale to OpenAI Codex with codex mcp add or config.toml, sign in with OAuth, and raise the tool timeout so long AI answers finish. - [Connect Gemini CLI](https://promptgale.com/docs/connect-gemini-cli.md): Add PromptGale to Gemini CLI as a remote MCP server with gemini mcp add, sign in with /mcp auth, and ask AI answer engines from the terminal. - [Connect VS Code](https://promptgale.com/docs/connect-vscode.md): Add PromptGale to VS Code chat as a remote HTTP MCP server, choose Authenticate to sign in with OAuth, and ask AI answer engines from the editor. - [Connect GitHub Copilot](https://promptgale.com/docs/connect-github-copilot.md): Add PromptGale to GitHub Copilot CLI with one command and OAuth, or to the Copilot cloud agent with an API key stored as a COPILOT_MCP_ secret. - [Connect OpenClaw](https://promptgale.com/docs/connect-openclaw.md): Add PromptGale to OpenClaw as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Hermes Agent](https://promptgale.com/docs/connect-hermes.md): Add PromptGale to Hermes Agent as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect n8n](https://promptgale.com/docs/connect-n8n.md): Connect PromptGale to an n8n AI Agent with the MCP Client Tool node and OAuth, or with an API key, to run AI answer engine prompts in workflows. - [Connect Grok](https://promptgale.com/docs/connect-grok.md): Add PromptGale to Grok as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Grok Bot](https://promptgale.com/docs/connect-grok-bot.md): Add PromptGale to Grok Bot as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Rakazo](https://promptgale.com/docs/connect-rakazo.md): Add PromptGale to Rakazo as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect OpenBot](https://promptgale.com/docs/connect-openbot.md): Add PromptGale to OpenBot as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Meta Muse](https://promptgale.com/docs/connect-meta-muse.md): Add PromptGale to Meta Muse as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Perplexity](https://promptgale.com/docs/connect-perplexity.md): Add PromptGale to Perplexity as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Le Chat](https://promptgale.com/docs/connect-le-chat.md): Add PromptGale to Le Chat as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Lindy](https://promptgale.com/docs/connect-lindy.md): Add PromptGale to Lindy as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Zapier](https://promptgale.com/docs/connect-zapier.md): Add PromptGale to Zapier as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Make](https://promptgale.com/docs/connect-make.md): Add PromptGale to Make as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Devin](https://promptgale.com/docs/connect-devin.md): Add PromptGale to Devin as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Windsurf](https://promptgale.com/docs/connect-windsurf.md): Add PromptGale to Windsurf as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Zed](https://promptgale.com/docs/connect-zed.md): Add PromptGale to Zed as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Cline](https://promptgale.com/docs/connect-cline.md): Add PromptGale to Cline as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Kiro](https://promptgale.com/docs/connect-kiro.md): Add PromptGale to Kiro as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Goose](https://promptgale.com/docs/connect-goose.md): Add PromptGale to Goose as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect opencode](https://promptgale.com/docs/connect-opencode.md): Add PromptGale to opencode as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect Mistral Vibe](https://promptgale.com/docs/connect-mistral-vibe.md): Add PromptGale to Mistral Vibe as a remote MCP server with OAuth sign-in, then ask AI answer engines a prompt from a country and read the cited sources. - [Connect any other MCP client](https://promptgale.com/docs/connect-other.md): Add PromptGale to any client that supports remote MCP servers over Streamable HTTP, or bridge a stdio-only client with mcp-remote and OAuth. - [Connect with an API key](https://promptgale.com/docs/connect-api-key.md): Connect PromptGale to an agent, SDK or cron job that cannot sign in with OAuth, by sending an API key as a header to the remote MCP server. ### Reference - [Engines](https://promptgale.com/docs/engines.md): See each AI engine you can query (ChatGPT, Google AI Overviews, Google AI Mode and more), its taskType and credits per answer, and how to check live availability. - [Plans and credits](https://promptgale.com/docs/plans-and-credits.md): See what PromptGale costs: monthly plans in dollars, credits per engine and per answer, when credits are held, charged or refunded, trials and top-ups. - [API reference](https://promptgale.com/docs/endpoints.md): Look up every endpoint of the REST API with its method, path and purpose, generated from the OpenAPI 3.1 document you can import into any client. - [FAQ](https://promptgale.com/docs/faq.md): Get short answers on the ChatGPT app versus its API, SERP APIs, citations, task time, credits, countries, limits, the MCP server and failed tasks. ## Guides and product pages ### Engines - [AI answer engine APIs, one page per engine](https://promptgale.com/engines): One page per AI answer engine PromptGale can query from a chosen country: what each returns as JSON, what it costs in credits and how to call it. - [ChatGPT scraper API: answers and citations as JSON](https://promptgale.com/engines/chatgpt-scraper-api): Get the answer chatgpt.com shows for a prompt, from the country you pick, with cited sources and brand rank, as JSON. curl, Python and Node examples. - [Google AI Overview API: overview text, sources, organic](https://promptgale.com/engines/google-ai-overview-api): Read the AI Overview Google shows for a query in a chosen country or US state, with its sources and the organic results, as JSON. With code and prices. - [Google AI Mode API: answers and sources as JSON](https://promptgale.com/engines/google-ai-mode-api): Ask Google AI Mode a question from a country, US state, city or map point and get the answer, its cited sources and brand mentions as JSON over REST or MCP. - [Perplexity scraper API: answers, sources, search queries](https://promptgale.com/engines/perplexity-scraper-api): Get Perplexity's answer for a prompt with its sources, the searches it ran and its related questions, from a chosen country, as JSON. With code samples. - [Gemini scraper API: the Gemini app answer as JSON](https://promptgale.com/engines/gemini-scraper-api): Ask the Gemini app a prompt from a chosen country or US state and get its answer, cited sources and brand rank as JSON. The app, not the Gemini model API. - [Copilot scraper API: Copilot answers as JSON](https://promptgale.com/engines/copilot-scraper-api): Get the Copilot answer Microsoft shows for a prompt in a chosen country, with its sources and brand rank, as JSON. Includes code, prices and location options. - [Meta AI API: answers from meta.ai as JSON](https://promptgale.com/engines/meta-ai-api): Meta's official API sells model access, not Meta AI assistant answers. PromptGale returns the meta.ai answer for a prompt and country as JSON. Here is how. ### Use cases - [Use cases: what developers build with PromptGale](https://promptgale.com/use-cases): Developer guides for AI visibility tools, AI Overview tracking, brand mention tracking and rank tracking, each with an architecture, metrics and runnable code. - [Build an AI visibility tool: architecture, metrics, code](https://promptgale.com/use-cases/build-an-ai-visibility-tool): How to build an AI visibility (GEO) tool on an API: prompts, engines and countries in, answers and citations out, metrics defined, batch and webhook code. - [AI Overview tracking: build your own tracker with an API](https://promptgale.com/use-cases/ai-overview-tracking): Build an AI Overview tracker: check which queries show an overview, which sources it cites and whether your domain is one of them, by country, with code. - [Track brand mentions in ChatGPT with an API](https://promptgale.com/use-cases/track-brand-mentions-in-chatgpt): A developer how-to: ask ChatGPT your buyers' prompts on a schedule, read whether and where your brand is named and cited, and store the results. With code. ### Compare - [PromptGale compared with SERP and AI data APIs](https://promptgale.com/compare): Dated, sourced comparisons of PromptGale with SerpApi, DataForSEO, Bright Data and cloro: what each offers, published prices, and when to pick which one. - [SerpApi alternative for AI answers, compared](https://promptgale.com/compare/serpapi-alternative): What SerpApi offers per its own pages, where PromptGale differs on AI answer engines, a dated price table, and when SerpApi is the better fit for you. - [DataForSEO alternative for AI answers, compared](https://promptgale.com/compare/dataforseo-alternative): DataForSEO's AI Optimization and SERP APIs per its own pages, next to PromptGale's AI answer engines, with dated prices and an honest who-should-pick-which. - [Bright Data alternative for AI answers, compared](https://promptgale.com/compare/bright-data-alternative): Bright Data's SERP API and AI scrapers per its own pages, compared with PromptGale's engines, output and pricing as of November 2026, and when to pick each. - [cloro alternative: PromptGale compared, engine by engine](https://promptgale.com/compare/cloro-alternative): cloro and PromptGale side by side from each one's own pages: engines, query fan-out, location targeting, MCP and prices as of November 2026, with sources. ### Guides - [Guides: AI answer engines for developers](https://promptgale.com/guides): Plain explanations for developers working with AI answer engines: how model APIs differ from the apps, what the terms mean, and how to measure answers. - [ChatGPT API vs ChatGPT app: can the API search the web?](https://promptgale.com/guides/chatgpt-api-vs-chatgpt-app): Yes, OpenAI's API can search the web with a tool, but its answer is not what chatgpt.com shows. What differs, per OpenAI's docs, and how to get the app answer. - [Remote MCP server: ask AI answer engines from your agent](https://promptgale.com/mcp-server): Add PromptGale to Claude Code, Cursor, Codex, ChatGPT or n8n as a remote MCP server with OAuth, then ask AI answer engines and read citations from your agent. - [Glossary: AI Overview, GEO, AEO and MCP terms](https://promptgale.com/glossary): Short, precise definitions of the terms used around AI answer engines and their APIs: AI Overview, query fan-out, share of voice, GEO, AEO, MCP and more. - [Query fan-out: what it is and how to read the queries](https://promptgale.com/glossary/query-fan-out): Query fan-out is when an answer engine turns one prompt into several web searches. What that means, and how to read those searches as JSON from an API. ## Endpoint reference ### GET /v1/tasks List tasks, newest first. Parameters: - `limit` (query): integer - `cursor` (query): string - `engine` (query): string. Engine (aliases accepted; alias parameter: taskType). An unknown name answers 400. - `status` (query): string. Case-insensitive. - `createdAfter` (query): string. ISO date or date-time: created at or after. - `createdBefore` (query): string. ISO date or date-time: created before. - `include` (query): string - `includeResult` (query): boolean. Same as include=result. Responses: 200 Page of tasks; 400 Error (400); 401 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### POST /v1/tasks Queue a task. Answers at once with the task (QUEUED). Poll GET /v1/tasks/{id}, wait with POST /v1/sync/task, or receive webhookUrl events. Parameters: - `Idempotency-Key` (header): string. 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. Body: TaskInput Responses: 200 Existing task for this idempotency key (same request); 201 Task accepted; 400 Error (400); 401 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"; 402 INSUFFICIENT_CREDITS: not enough credits (details.reason "daily_key_limit" when the API key's daily credit limit is reached); 403 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 409 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"); 413 PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches); 415 UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json; 422 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; 429 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; 500 Error (500); 503 ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities. ### GET /v1/tasks/{id} Get a task and its result. Parameters: - `id` (path, required): string Responses: 200 Task; 401 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"; 404 RESOURCE_NOT_FOUND; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### DELETE /v1/tasks/{id} Cancel a queued task. 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: - `id` (path, required): string Responses: 200 The cancelled task; 401 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"; 403 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"; 404 RESOURCE_NOT_FOUND; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 409 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"); 429 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; 500 Error (500). ### GET /v1/tasks/{id}/events A task's timeline (queued, running, retrying, completed, failed, cancelled). Parameters: - `id` (path, required): string Responses: 200 Events, oldest first; 401 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"; 404 RESOURCE_NOT_FOUND; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### POST /v1/tasks/bulk Queue up to 500 tasks atomically. 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 `:`; repeating the request replays the same tasks (200, Idempotent-Replayed), a different body under the key is 409. Parameters: - `Idempotency-Key` (header): string. 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. Body: object Responses: 200 Every task existed already (idempotency keys); 201 Tasks accepted (at least one created); 400 Error (400); 401 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"; 402 INSUFFICIENT_CREDITS: not enough credits (details.reason "daily_key_limit" when the API key's daily credit limit is reached); 403 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 409 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"); 413 PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches); 415 UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json; 422 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; 429 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; 500 Error (500); 503 ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities. ### POST /v1/async/task Queue a task. Deprecated: use POST /v1/tasks (same request and answer). Answers carry Deprecation: true and Link: ; 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: - `Idempotency-Key` (header): string. 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. Body: TaskInput Responses: 200 Existing task for this idempotency key (same request); 201 Task accepted; 400 Error (400); 401 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"; 402 INSUFFICIENT_CREDITS: not enough credits (details.reason "daily_key_limit" when the API key's daily credit limit is reached); 403 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 409 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"); 413 PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches); 415 UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json; 422 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; 429 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; 500 Error (500); 503 ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities. ### POST /v1/async/task/batch Queue up to 500 tasks atomically. Deprecated: use POST /v1/tasks/bulk (same request and answer). Answers carry Deprecation: true and Link: ; 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 `:`; repeating the request replays the same tasks (200, Idempotent-Replayed), a different body under the key is 409. Parameters: - `Idempotency-Key` (header): string. 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. Body: object Responses: 200 Every task existed already (idempotency keys); 201 Tasks accepted (at least one created); 400 Error (400); 401 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"; 402 INSUFFICIENT_CREDITS: not enough credits (details.reason "daily_key_limit" when the API key's daily credit limit is reached); 403 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 409 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"); 413 PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches); 415 UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json; 422 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; 429 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; 500 Error (500); 503 ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities. ### GET /v1/async/task/{id} Get a task and its result. Deprecated: use GET /v1/tasks/{id} (same request and answer). Answers carry Deprecation: true and Link: ; rel="successor-version". Parameters: - `id` (path, required): string Responses: 200 Task; 401 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"; 404 RESOURCE_NOT_FOUND; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### POST /v1/sync/task Queue a task and wait for it (up to 290 s). Same body, checks and price as POST /v1/tasks. Holds the request up to 290 s, or less with `Prefer: wait=` (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: - `Prefer` (header): string - `Accept` (header): string - `Idempotency-Key` (header): string. 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. Body: TaskInput Responses: 200 Finished task (COMPLETED or FAILED); 202 Still running; poll the Location (GET /v1/tasks/{id}); 400 Error (400); 401 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"; 402 INSUFFICIENT_CREDITS: not enough credits (details.reason "daily_key_limit" when the API key's daily credit limit is reached); 403 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 409 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"); 413 PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches); 415 UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json; 422 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; 429 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; 500 Error (500); 503 ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities. ### GET /v1/grids Location grids, newest first (without points). Parameters: - `limit` (query): integer - `cursor` (query): string Responses: 200 Page of grids; 400 Error (400); 401 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### POST /v1/grids Ask one prompt from every point of a location grid (up to 9 x 9). 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: - `Idempotency-Key` (header): string. 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. Body: GridInput Responses: 200 Every point existed already; 201 Grid created (points queued); 400 Error (400); 401 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"; 402 INSUFFICIENT_CREDITS: not enough credits (details.reason "daily_key_limit" when the API key's daily credit limit is reached); 403 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 409 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"); 413 PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches); 415 UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json; 422 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; 429 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; 500 Error (500); 503 ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities. ### GET /v1/grids/{id} Get a location grid with its points. Parameters: - `id` (path, required): string - `include` (query): string - `includeResult` (query): boolean. Same as include=result. Responses: 200 Grid; 401 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"; 404 RESOURCE_NOT_FOUND; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### POST /v1/async/task/grid Ask one prompt from every point of a location grid (up to 9 x 9). Deprecated: use POST /v1/grids (same request and answer). Answers carry Deprecation: true and Link: ; 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: - `Idempotency-Key` (header): string. 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. Body: GridInput Responses: 200 Every point existed already; 201 Grid created (points queued); 400 Error (400); 401 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"; 402 INSUFFICIENT_CREDITS: not enough credits (details.reason "daily_key_limit" when the API key's daily credit limit is reached); 403 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 409 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"); 413 PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches); 415 UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json; 422 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; 429 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; 500 Error (500); 503 ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities. ### GET /v1/async/task/grid/{id} Get a location grid with its points. Deprecated: use GET /v1/grids/{id} (same request and answer). Answers carry Deprecation: true and Link: ; rel="successor-version". Parameters: - `id` (path, required): string - `include` (query): string - `includeResult` (query): boolean. Same as include=result. Responses: 200 Grid; 401 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"; 404 RESOURCE_NOT_FOUND; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### GET /v1/states US states accepted by payload.state (other countries: empty). No API key needed. Parameters: - `country` (query, required): string Responses: 200 States, by name; 400 Error (400); 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header. ### GET /v1/credits Credit balance and billing plan. 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 Balance in credits; 401 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### GET /v1/usage Usage per UTC day and engine. Parameters: - `from` (query): string. ISO date (YYYY-MM-DD) or date-time (read as its UTC day); inclusive. Default 29 days before to. - `to` (query): string. ISO date or date-time; inclusive. Default today. Responses: 200 Usage rows; 400 Error (400); 401 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### GET /v1/capabilities Engines available now: taskType, aliases, status, credits, input fields (required / optional / include), served countries, location flags, evidence. Responses: 200 Capabilities; 401 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### GET /v1/countries Countries we serve now, with locale data; with taskType only those that engine is served from. 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: - `taskType` (query): string. Engine; aliases accepted. - `model` (query): string. Alias of taskType. Responses: 200 Countries; 400 Error (400); 401 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 422 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; 429 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; 500 Error (500); 503 ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities. ### POST /v1/batches Create a batch of up to 10,000 tasks. 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":}`, signed like task webhooks over `..` with promptgale-webhook-id `batch_` (also sent as the deprecated plinda-webhook-id). Parameters: - `Idempotency-Key` (header): string. 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. Body: BatchInput Responses: 200 Batch created earlier with this idempotencyKey and body (last 30 days), unchanged; 202 Batch stored; items are queued as room frees up; 400 Error (400); 401 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"; 402 INSUFFICIENT_CREDITS: not enough credits (details.reason "daily_key_limit" when the API key's daily credit limit is reached); 403 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 409 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"); 413 PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches); 415 UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json; 422 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; 429 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; 500 Error (500); 503 ENGINE_UNAVAILABLE: the engine exists but is not available right now; safe to retry later (Retry-After), or pick one from GET /v1/capabilities. ### GET /v1/batches Batches, newest first. Parameters: - `limit` (query): integer. A bad value answers 400. - `cursor` (query): string - `status` (query): string. Case-insensitive. Responses: 200 Page of batches; 400 Error (400); 401 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### GET /v1/batches/{id} Batch progress: counts by status, credits held and charged. Parameters: - `id` (path, required): string Responses: 200 Batch; 401 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"; 404 RESOURCE_NOT_FOUND; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### POST /v1/batches/{id}/cancel Cancel a batch's pending items and queued tasks. 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: - `id` (path, required): string Responses: 200 Cancelled; 401 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"; 403 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"; 404 RESOURCE_NOT_FOUND; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### GET /v1/batches/{id}/items Batch items in submission order, a page at a time. Parameters: - `id` (path, required): string - `cursor` (query): string. nextCursor of the previous page (opaque; the plain item index is accepted too). - `limit` (query): integer. Default 100 (max 1,000); with include=result default 20 (max 100). - `status` (query): string. Case-insensitive. - `include` (query): string - `includeResult` (query): boolean. Same as include=result. Responses: 200 Items; 400 Error (400); 401 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"; 404 RESOURCE_NOT_FOUND; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### POST /v1/google/goto Resolve a Google redirect link to the page it leads to (no credits). 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. Body: object Responses: 200 Final URL; 400 Error (400); 401 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 413 PAYLOAD_TOO_LARGE: the request body is above the limit (about 1 MB; 16 MB for POST /v1/batches); 415 UNSUPPORTED_MEDIA_TYPE: the body was sent with a Content-Type that is not JSON; send application/json; 429 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; 500 Error (500); 502 Error (502). ### GET /v1/google/goto Same as POST, with ?url=. Parameters: - `url` (query, required): string Responses: 200 Final URL; 400 Error (400); 401 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500); 502 Error (502). ### GET /v1/queue Your queue: queued and processing tasks, pending batch items, concurrency used and limit. Responses: 200 Queue status; 401 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### DELETE /v1/queue Cancel your queued tasks and pending batch items. 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 Cancelled; 401 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"; 403 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### GET /v1/async/status Your queue: queued and processing tasks, pending batch items, concurrency used and limit. Deprecated: use GET /v1/queue (same request and answer). Answers carry Deprecation: true and Link: ; rel="successor-version". Responses: 200 Queue status; 401 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### DELETE /v1/async/queue Cancel your queued tasks and pending batch items. Deprecated: use DELETE /v1/queue (same request and answer). Answers carry Deprecation: true and Link: ; 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 Cancelled; 401 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"; 403 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### GET /v1/stats Your task counts by status and engine for a window. Parameters: - `hours` (query): number. Window ending now (fractions allowed). - `from` (query): string. ISO date (YYYY-MM-DD) or date-time. - `to` (query): string. ISO date or date-time (default now). Responses: 200 Stats; 400 Error (400); 401 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### GET /v1/capacity Load per available engine: status, queued and processing tasks, oldest queued age. Responses: 200 Capacity; 401 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"; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header; 429 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; 500 Error (500). ### GET /stats Your task counts by status and engine for a window. Deprecated: use GET /v1/stats (same request and answer). Answers carry Deprecation: true and Link: ; rel="successor-version". Parameters: - `hours` (query): number. Window ending now (fractions allowed). - `from` (query): string. ISO date (YYYY-MM-DD) or date-time. - `to` (query): string. ISO date or date-time (default now). Responses: 200 Stats; 400 Error (400); 401 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"; 429 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; 500 Error (500). ### GET /capacity Load per available engine: status, queued and processing tasks, oldest queued age. Deprecated: use GET /v1/capacity (same request and answer). Answers carry Deprecation: true and Link: ; rel="successor-version". Responses: 200 Capacity; 401 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"; 429 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; 500 Error (500). ### GET /evidence/{id} Saved evidence page of a task (include.html; CHATGPT, GEMINI, PERPLEXITY, BING_COPILOT_SEARCH, META_AI, GOOGLE_AIO, GOOGLE_AIMODE). 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. No API key needed. Parameters: - `id` (path, required): string Responses: 200 The page; 404 Unknown or expired. ### GET /openapi.json This document. No API key needed. Responses: 200 OpenAPI 3.1. ### GET /v1/openapi.json This document (same as /openapi.json). No API key needed. Responses: 200 OpenAPI 3.1; 405 METHOD_NOT_ALLOWED: the path does not take this method; see the Allow header. ### GET /health health. No API key needed. Responses: 200 Process is up. ## Payload fields per engine - `CHATGPT`: required `prompt`; optional `country`, `brand`, `brandAliases`, `brandDomains`, `competitors`, `include`; include: `markdown`, `html`, `rawHtml`, `rawResponse`, `screenshot`, `analysis`. - `GEMINI`: required `prompt`; optional `country`, `brand`, `brandAliases`, `brandDomains`, `competitors`, `include`; include: `markdown`, `html`, `rawHtml`, `rawResponse`, `screenshot`, `analysis`. - `PERPLEXITY`: required `prompt`; optional `country`, `brand`, `brandAliases`, `brandDomains`, `competitors`, `include`; include: `markdown`, `html`, `rawHtml`, `rawResponse`, `screenshot`, `analysis`. - `BING_COPILOT_SEARCH`: required `prompt`; optional `country`, `brand`, `brandAliases`, `brandDomains`, `competitors`, `include`; include: `markdown`, `html`, `rawHtml`, `rawResponse`, `screenshot`, `analysis`. - `META_AI`: required `prompt`; optional `country`, `brand`, `brandAliases`, `brandDomains`, `competitors`, `include`; include: `markdown`, `html`, `rawHtml`, `rawResponse`, `screenshot`, `analysis`. - `GOOGLE_AIO`: required `prompt`; optional `country`, `brand`, `brandAliases`, `brandDomains`, `competitors`, `include`; include: `markdown`, `html`, `rawHtml`, `rawResponse`, `screenshot`, `analysis`. - `GOOGLE_AIMODE`: required `prompt`; optional `country`, `brand`, `brandAliases`, `brandDomains`, `competitors`, `include`; include: `markdown`, `html`, `rawHtml`, `rawResponse`, `screenshot`, `analysis`. Location (one per task): `state` (US, +1 credit), `uule`, `city`, `location` {lat, lng} (+1 credit). Which engine takes which: `GET /v1/capabilities` (`location`). Location grids (up to 9 x 9 points): GOOGLE_AIO, GOOGLE_AIMODE, CHATGPT, GEMINI, BING_COPILOT_SEARCH. Hosted evidence pages (`include.html`, +0.25 credit, charged only when saved): CHATGPT, GEMINI, PERPLEXITY, BING_COPILOT_SEARCH, META_AI, GOOGLE_AIO, GOOGLE_AIMODE. Others: 422 EVIDENCE_UNSUPPORTED. Batches: up to 10,000 tasks per POST /v1/batches. ## Webhooks A task or batch with `webhookUrl` (a public https URL) gets one POST when it finishes: `{"event":"task.completed"|"task.failed","data":}` or `{"event":"batch.completed","data":}`. Any 2xx counts as delivered; other answers and timeouts (30 s) are retried 4 more times (after 2, 4, 8 and 16 minutes); redirects are not followed. Headers: - `promptgale-webhook-id`: the same on every retry of one delivery (`whd_`, or `batch_` for `batch.completed`); deduplicate on it. - `promptgale-webhook-timestamp`: Unix seconds when it was signed; reject deliveries more than 5 minutes off. - `promptgale-webhook-signature`: `v1,` (space separated when there are several) over `..`, where `` is the task id (the batch id for `batch.completed`). Key: the signing secret of the API key that created the task, or the account webhook secret for work created without an API key. - `plinda-webhook-id`, `plinda-webhook-timestamp`, `plinda-webhook-signature`: deprecated aliases with identical values, still sent (no removal date yet). Read the `promptgale-webhook-*` names in new code. - `X-Request-Id` of the attempt and `User-Agent: PromptGale-Webhook/1`. ## Error codes - `VALIDATION_ERROR` (400) - `MISSING_API_KEY` (401) - `INVALID_API_KEY` (401) - `INSUFFICIENT_CREDITS` (402) - `PLAN_REQUIRED` (402) - `FORBIDDEN` (403) - `EMAIL_NOT_VERIFIED` (403) - `ACCOUNT_SUSPENDED` (403) - `RESOURCE_NOT_FOUND` (404) - `RESOURCE_ALREADY_EXISTS` (409) - `INVALID_STATE` (409) - `METHOD_NOT_ALLOWED` (405) - `LOCATION_UNSUPPORTED` (422) - `REGION_UNSUPPORTED` (422) - `EVIDENCE_UNSUPPORTED` (422) - `ENGINE_DISABLED` (422) - `ENGINE_UNAVAILABLE` (503) - `SERVICE_UNAVAILABLE` (503) - `QUEUE_LIMIT_EXCEEDED` (429) - `RATE_LIMITED` (429) - `PAYLOAD_TOO_LARGE` (413) - `UNSUPPORTED_MEDIA_TYPE` (415) - `INTERNAL_ERROR` (500) - `GOOGLE_REDIRECT_UNRESOLVED` (502) Limits: a request limit per minute per API key (600 by default; `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` on every response; over it 429 `RATE_LIMITED` with `Retry-After`). Request bodies up to about 1 MB (16 MB for `POST /v1/batches`; above: 413 `PAYLOAD_TOO_LARGE`), sent as JSON (other content types: 415). `webhookUrl` must be a public https URL. Task error codes (`error.code` of a FAILED task; credits refunded): - `TIMEOUT` - `NO_ANSWER` - `ENGINE_REFUSED` - `ENGINE_ERROR` - `LOCATION_UNSUPPORTED` - `UNSUPPORTED` - `TASK_CANCELLED` - `INSUFFICIENT_CREDITS` - `ENGINE_DISABLED`