{"openapi":"3.1.0","info":{"title":"AfterImage","description":"Shared copies of public web pages for AI agents. Send Authorization: Bearer ak_live_… or pay with x402. HTTP 402 if unpaid.","version":"0.1.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}}}},"/v1/stats":{"get":{"summary":"Stats","operationId":"stats_v1_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Stats V1 Stats Get"}}}}}}},"/v1/page":{"get":{"summary":"Get Page","operationId":"get_page_v1_page_get","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","description":"http(s) URL to snapshot","title":"Url"},"description":"http(s) URL to snapshot"},{"name":"max_age_s","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Reuse a cached snapshot if it is no older than this many seconds.","default":900,"title":"Max Age S"},"description":"Reuse a cached snapshot if it is no older than this many seconds."}],"responses":{"200":{"description":"Readable snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageResponse"}}}},"400":{"description":"URL is not fetchable"},"402":{"description":"Payment required (API key or x402)"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/search":{"get":{"summary":"Search Pages","operationId":"search_pages_v1_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","description":"Search the already-fetched corpus. Does not hit the live web.","title":"Q"},"description":"Search the already-fetched corpus. Does not hit the live web."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}},{"name":"max_age_s","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Only return snapshots no older than this many seconds.","title":"Max Age S"},"description":"Only return snapshots no older than this many seconds."}],"responses":{"200":{"description":"Corpus hits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"402":{"description":"Payment required (API key or x402)"},"422":{"description":"Query is empty"}},"security":[{"BearerAuth":[]}]}},"/mcp":{"post":{"summary":"Mcp Endpoint","operationId":"mcp_endpoint_mcp_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Message"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required (API key or x402)"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/billing/checkout":{"post":{"summary":"Billing Checkout","operationId":"billing_checkout_v1_billing_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest","default":{"pack":"starter"}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/balance":{"get":{"summary":"Billing Balance","operationId":"billing_balance_v1_billing_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"BearerAuth":[]}]}}},"components":{"schemas":{"CheckoutRequest":{"properties":{"pack":{"type":"string","title":"Pack","description":"starter ($5) or builder ($20)","default":"starter"}},"type":"object","title":"CheckoutRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PageResponse":{"properties":{"url":{"type":"string","title":"Url"},"final_url":{"type":"string","title":"Final Url"},"status":{"type":"integer","title":"Status"},"title":{"type":"string","title":"Title"},"text":{"type":"string","title":"Text"},"hash":{"type":"string","title":"Hash"},"fetched_at":{"type":"string","title":"Fetched At"},"age_s":{"type":"integer","title":"Age S"},"cache":{"type":"string","title":"Cache"},"price_usdc":{"type":"string","title":"Price Usdc"},"max_age_s":{"type":"integer","title":"Max Age S","default":900},"truncated":{"type":"boolean","title":"Truncated","default":false},"stored":{"type":"boolean","title":"Stored","default":true},"stored_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stored Reason"},"origin_max_age_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Origin Max Age S"},"vary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vary"},"etag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Etag"},"last_modified":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Modified"}},"type":"object","required":["url","final_url","status","title","text","hash","fetched_at","age_s","cache","price_usdc"],"title":"PageResponse"},"SearchHit":{"properties":{"url":{"type":"string","title":"Url"},"title":{"type":"string","title":"Title"},"snippet":{"type":"string","title":"Snippet"},"hash":{"type":"string","title":"Hash"},"fetched_at":{"type":"string","title":"Fetched At"},"age_s":{"type":"integer","title":"Age S"},"status":{"type":"integer","title":"Status"},"score":{"type":"number","title":"Score"},"truncated":{"type":"boolean","title":"Truncated","default":false},"aliases":{"items":{"type":"string"},"type":"array","title":"Aliases"}},"type":"object","required":["url","title","snippet","hash","fetched_at","age_s","status","score"],"title":"SearchHit"},"SearchResponse":{"properties":{"q":{"type":"string","title":"Q"},"indexed":{"type":"integer","title":"Indexed"},"hits":{"items":{"$ref":"#/components/schemas/SearchHit"},"type":"array","title":"Hits"},"price_usdc":{"type":"string","title":"Price Usdc","default":"0.005"},"max_age_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Age S"},"limit":{"type":"integer","title":"Limit","default":10}},"type":"object","required":["q","indexed","hits"],"title":"SearchResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"ak_live_… from POST /v1/billing/checkout. HTTP 402 if missing or empty. x402 PAYMENT-SIGNATURE is an alternative."}}}}