Documentation
Pay-per-call HTTP 402 endpoints for AI agents. One key, one header, twelve endpoints.
Quickstart
Get an API key and make your first call in under a minute.
- 1Buy credits
Visit the homepage and complete checkout. $1 buys 5 credits. Credits never expire.
- 2Save your API key
Stripe redirects you to a success page with an
ap_live_...key. Save it — we won't show it again. - 3Make your first request
Bearer auth on every endpoint. 1 credit per successful call.
curl -X POST https://402s.shop/api/v1/qr-code \
-H "Authorization: Bearer ap_live_..." \
-H "Content-Type: application/json" \
-d '{"text":"Hello from my agent"}' \
--output result.pngAuthentication
Every endpoint requires a Bearer token in the Authorization header.
Authorization: Bearer ap_live_VyQ_cUtIndDub...
Header missing, malformed, or key not recognized.
Key valid, balance is 0. Response includes WWW-Authenticate with the top-up URL.
Pricing
Pay-per-call. 1 credit per successful endpoint call. Credits never expire.
| Package | Price | Credits | $ / call |
|---|---|---|---|
| small | $1 | 5 | $0.200 |
| medium | $5 | 30 | $0.167 |
| large | $20 | 150 | $0.133 |
4xx and 5xx responses do not deduct credits. Only successful 2xx responses are charged.
Errors
Invalid JSON, missing required fields, or out-of-range values.
Missing or unrecognized Bearer token.
API key valid but credits = 0. Top up to continue.
External fetch failed (URL unreachable, transcript not found, etc). No credit deducted.
Unexpected server error. No credit deducted.
AI summarization endpoint is offline (missing ANTHROPIC_API_KEY).
HTTP 402 response example
HTTP/1.1 402 Payment Required WWW-Authenticate: Bearer realm="402s.shop", charge="$1", topup_url="https://402s.shop" X-Credits-Remaining: 0 Content-Type: application/json { "error": "payment_required", "message": "Out of credits. Top up to continue using the API.", "topup_url": "https://402s.shop", "credits_remaining": 0 }
Endpoints
12 endpoints. All POST. All require Bearer auth. All cost 1 credit per success.
/qr-code
/api/v1/qr-code·1 creditGenerate a QR code PNG from any text or URL.
Request body
textstringrequiredText to encode (1–2048 chars).
sizenumberoptionalWidth in pixels (100–1000, default 300).
Response
image/png with X-Credits-Remaining header.
Example
curl -X POST https://402s.shop/api/v1/qr-code \
-H "Authorization: Bearer ap_live_..." \
-H "Content-Type: application/json" \
-d '{"text":"Hello from my agent"}' \
--output result.png/og-image
/api/v1/og-image·1 creditGenerate a 1200×630 social-media OG image with title and subtitle.
Request body
titlestringrequired1–200 characters.
subtitlestringoptionalUp to 300 characters.
theme"dark" | "light"optionalDefault "dark".
Response
image/png with X-Credits-Remaining header.
Example
curl -X POST https://402s.shop/api/v1/og-image \
-H "Authorization: Bearer ap_live_..." \
-H "Content-Type: application/json" \
-d '{"title":"AgentPay","subtitle":"HTTP 402 for AI agents","theme":"dark"}' \
--output result.png/screenshot
/api/v1/screenshot·1 creditRender a webpage in headless Chromium and return a PNG screenshot.
Request body
urlstringrequiredhttp(s) URL to screenshot.
viewport{ width, height }optional320–1920 × 240–2160. Default 1280×800.
fullPagebooleanoptionalCapture full scrolling page. Default false.
Response
image/png with X-Credits-Remaining header.
Example
curl -X POST https://402s.shop/api/v1/screenshot \
-H "Authorization: Bearer ap_live_..." \
-H "Content-Type: application/json" \
-d '{"url":"https://402s.shop","viewport":{"width":1280,"height":800},"fullPage":false}' \
--output result.png/pdf-from-url
/api/v1/pdf-from-url·1 creditRender any URL to a print-ready PDF.
Request body
urlstringrequiredhttp(s) URL.
format"A4" | "Letter" | "Legal"optionalDefault "A4".
Response
application/pdf with X-Credits-Remaining header.
Example
curl -X POST https://402s.shop/api/v1/pdf-from-url \
-H "Authorization: Bearer ap_live_..." \
-H "Content-Type: application/json" \
-d '{"url":"https://en.wikipedia.org/wiki/HTTP_402","format":"A4"}' \
--output result.pdf/word-count
/api/v1/word-count·1 creditCount words on any webpage and estimate reading time.
Request body
urlstringrequiredhttp(s) URL.
Response
application/json with X-Credits-Remaining header.
{
"url": "https://en.wikipedia.org/wiki/HTTP_402",
"wordCount": 1247,
"readingTimeMinutes": 7,
"charCount": 8423
}Example
curl -X POST https://402s.shop/api/v1/word-count \
-H "Authorization: Bearer ap_live_..." \
-H "Content-Type: application/json" \
-d '{"url":"https://en.wikipedia.org/wiki/HTTP_402"}'/extract-metadata
/api/v1/extract-metadata·1 creditExtract Open Graph, Twitter card, and standard meta tags.
Request body
urlstringrequiredhttp(s) URL.
Response
application/json with X-Credits-Remaining header.
{
"url": "https://github.com",
"title": "GitHub",
"description": "GitHub is where over 100 million developers shape the future of software.",
"image": "https://github.githubassets.com/.../og-image.png",
"siteName": "GitHub",
"type": "object",
"favicon": "https://github.com/favicon.ico",
"locale": "en"
}Example
curl -X POST https://402s.shop/api/v1/extract-metadata \
-H "Authorization: Bearer ap_live_..." \
-H "Content-Type: application/json" \
-d '{"url":"https://github.com"}'/extract-emails
/api/v1/extract-emails·1 creditFind email addresses on a page (mailto links + body text). Deduplicated, max 100.
Request body
urlstringrequiredhttp(s) URL.
Response
application/json with X-Credits-Remaining header.
{
"url": "https://www.python.org/about/contact/",
"emails": [
"webmaster@python.org",
"psf@python.org"
],
"count": 2
}Example
curl -X POST https://402s.shop/api/v1/extract-emails \
-H "Authorization: Bearer ap_live_..." \
-H "Content-Type: application/json" \
-d '{"url":"https://www.python.org/about/contact/"}'/website-tech
/api/v1/website-tech·1 creditDetect framework, CMS, analytics, and hosting/CDN from HTML and response headers.
Request body
urlstringrequiredhttp(s) URL.
Response
application/json with X-Credits-Remaining header.
{
"url": "https://vercel.com",
"framework": "Next.js",
"cms": null,
"analytics": [
"Google Analytics"
],
"hosting": "Vercel",
"server": "Vercel",
"technologies": [
"Next.js",
"Google Analytics",
"Vercel"
]
}Example
curl -X POST https://402s.shop/api/v1/website-tech \
-H "Authorization: Bearer ap_live_..." \
-H "Content-Type: application/json" \
-d '{"url":"https://vercel.com"}'/whois
/api/v1/whois·1 creditWHOIS lookup with normalized fields (registrar, dates, nameservers, status).
Request body
domainstringrequiredDomain name like example.com.
Response
application/json with X-Credits-Remaining header.
{
"domain": "402s.shop",
"registrar": "Namecheap, Inc.",
"createdDate": "2026-04-30T00:00:00Z",
"expiresDate": "2027-04-30T00:00:00Z",
"updatedDate": "2026-04-30T00:00:00Z",
"nameservers": [
"ns1.example.com",
"ns2.example.com"
],
"status": [
"clientTransferProhibited"
],
"raw": {
"...": "full whois record"
}
}Example
curl -X POST https://402s.shop/api/v1/whois \
-H "Authorization: Bearer ap_live_..." \
-H "Content-Type: application/json" \
-d '{"domain":"402s.shop"}'/domain-check
/api/v1/domain-check·1 creditHeuristic availability check via WHOIS — best-effort, not authoritative.
Request body
domainstringrequiredDomain name like example.com.
Response
application/json with X-Credits-Remaining header.
{
"domain": "this-domain-is-probably-available-12345.com",
"available": true,
"registrar": null,
"expiresDate": null
}Example
curl -X POST https://402s.shop/api/v1/domain-check \
-H "Authorization: Bearer ap_live_..." \
-H "Content-Type: application/json" \
-d '{"domain":"this-domain-is-probably-available-12345.com"}'/youtube-transcript
/api/v1/youtube-transcript·1 creditFetch a YouTube video transcript with timestamps and computed word count.
Request body
urlstringrequiredYouTube watch / shorts / embed / youtu.be URL.
langstringoptionalBCP-47 language code (default "en").
Response
application/json with X-Credits-Remaining header.
{
"videoId": "dQw4w9WgXcQ",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"language": "en",
"transcript": [
{
"text": "We're no strangers to love",
"offset": 0,
"duration": 3.5
},
{
"text": "You know the rules and so do I",
"offset": 3.5,
"duration": 3.5
}
],
"fullText": "We're no strangers to love You know the rules and so do I ...",
"wordCount": 312,
"durationSeconds": 213
}Example
curl -X POST https://402s.shop/api/v1/youtube-transcript \
-H "Authorization: Bearer ap_live_..." \
-H "Content-Type: application/json" \
-d '{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'/summarize
/api/v1/summarize·1 creditAI-powered summary of supplied text or fetched URL. Uses Claude Haiku 4.5.
Request body
textstringoptionalProvide either text (50–50000 chars) or url, not both.
urlstringoptionalhttp(s) URL to fetch and summarize.
length"short" | "medium" | "long"optionalDefault "medium".
Response
application/json with X-Credits-Remaining header.
{
"summary": "HTTP 402 Payment Required is a status code defined in the HTTP specification...",
"originalLength": 8423,
"summaryLength": 412,
"compressionRatio": 0.0489,
"model": "claude-haiku-4-5",
"length": "medium"
}Example
curl -X POST https://402s.shop/api/v1/summarize \
-H "Authorization: Bearer ap_live_..." \
-H "Content-Type: application/json" \
-d '{"url":"https://en.wikipedia.org/wiki/HTTP_402","length":"medium"}'