AI API · AI Browser Task

AI Browser Task API

POST /ai_task

https://ai.sneakypeekai.com

Send a page address and a short instruction in plain English. An AI agent works that one page and returns a structured result with a summary, a direct_answer to the question, tips, and warnings. Extra fields may appear when your task asks for them. Expect tens of seconds. Pass url and task in the query string with an empty JSON body {} (JSON body fields also work; query parameters win if both are sent).

Costs 15 credits per attempt. Up to 5 successful tasks per key per day, on top of the shared per-minute and daily caps. Only HTTP 200 responses count toward the daily task cap. Credits refund when the HTTP status is 4xx/5xx, including a failed agent run (HTTP 500).

Authentication

Authenticate requests by sending your API key in the X-API-Key HTTP request header.

Mint and manage API keys in your Sneaky Peek AI Account → API Keys.

X-API-Key: $API_KEY

Parameters

Name In Type Required Notes
X-API-Key header string yes Your API key. Missing or wrong key returns 401.
url query string yes Public page the agent is allowed to open. Send as a query parameter (or url in the JSON body).
task query string yes Plain-language instruction, for example Describe the page. Send as a query parameter (or task in the JSON body). Keep it to one page. Expect 30 to 90 seconds.

Request Example (curl)

curl -X POST "https://ai.sneakypeekai.com/ai_task?url=https://example.com&task=Describe+the+page" \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Success Response Example (200 OK)

{
  "status": 200,
  "response": {
    "result": "success",
    "summary": "...",
    "direct_answer": "The ticket price is $49.",
    "tips": "...",
    "warnings": ""
  },
  "ai_response": []
}

Common Error Status Codes

Status Code When / Description
400 The page address is missing or is not a public http or https site.
401 The API key is missing or invalid.
402 Insufficient credits for this call.
411 The HTTP Content-Length header is completely missing from the request.
429 You hit a key limit (per-minute, per-day, or daily AI task), or the AI provider quota is exhausted (message includes 'quota exhausted'). Retry-After is capped at 3600s; check X-RateLimit-Reset for the real window.
500 The agent could not finish the task. The body still has status 500 plus any partial result. Credits are refunded and the attempt does not count toward the daily task cap.