AI API · AI Browser Task

AI Browser Task

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. url and task MUST be passed in the query string with an empty JSON body {}.

Costs 15 credits per attempt. Up to 5 attempts per key per day, on top of the shared per-minute and daily caps. Every attempt counts. Credits refund only when the HTTP status is 4xx/5xx (not when HTTP 200 carries a failed body).

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. Must be provided as a query parameter.
task query string yes Plain-language instruction, for example Describe the page. Must be provided as a query parameter. 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 300s; check X-RateLimit-Reset for the real window.
200 + body status 500 Agent failure often returns HTTP 200 with body status 500; credits are not refunded in that case.