{"openapi":"3.1.0","info":{"title":"x402 Text Summarizer","description":"Compress text, Markdown, or JSON to a structured summary using Claude AI. POST /v1/summarize requires x402 USDC micropayment ($0.005). POST /v1/summarize/trial is free — prose only, 4KB limit.","version":"0.1.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}},"head":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/v1/stats":{"get":{"summary":"Call counts for this session","operationId":"stats_v1_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Stats V1 Stats Get"}}}}}}},"/v1/summarize":{"post":{"summary":"Summarize Paid","operationId":"summarize_paid_v1_summarize_post","parameters":[{"name":"X-Payment-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Payment-Token"}},{"name":"X-PAYMENT","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Payment"}},{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment-Signature"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummarizeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummarizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/summarize/trial":{"post":{"summary":"Trial — no payment required","description":"Free trial endpoint. No x402 payment required. Format: prose only. Length: brief or medium only. No target_words support. Input limit: 4KB. Use POST /v1/summarize for full access.","operationId":"summarize_trial_v1_summarize_trial_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummarizeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummarizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status"},"service":{"type":"string","title":"Service"},"version":{"type":"string","title":"Version"}},"type":"object","required":["status","service","version"],"title":"HealthResponse"},"InputType":{"type":"string","enum":["text","markdown","json"],"title":"InputType"},"SummarizeFormat":{"type":"string","enum":["prose","bullets","headline","tldr"],"title":"SummarizeFormat"},"SummarizeLength":{"type":"string","enum":["brief","medium","detailed"],"title":"SummarizeLength"},"SummarizeMeta":{"properties":{"format":{"type":"string","title":"Format"},"length_preset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Length Preset"},"target_words":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target Words"},"model":{"type":"string","title":"Model"},"input_length":{"type":"integer","title":"Input Length"}},"type":"object","required":["format","length_preset","target_words","model","input_length"],"title":"SummarizeMeta"},"SummarizeRequest":{"properties":{"input":{"type":"string","title":"Input","description":"Text, Markdown, or JSON string to summarize"},"input_type":{"$ref":"#/components/schemas/InputType","description":"text | markdown | json","default":"text"},"format":{"$ref":"#/components/schemas/SummarizeFormat","description":"prose | bullets | headline | tldr","default":"prose"},"length":{"$ref":"#/components/schemas/SummarizeLength","description":"brief | medium | detailed","default":"medium"},"target_words":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target Words","description":"Exact target word count (1–500). Overrides length."},"explain":{"type":"boolean","title":"Explain","description":"Include notes on what was omitted","default":false}},"type":"object","required":["input"],"title":"SummarizeRequest"},"SummarizeResponse":{"properties":{"summary":{"type":"string","title":"Summary"},"format":{"type":"string","title":"Format"},"word_count":{"type":"integer","title":"Word Count"},"compression_ratio":{"type":"number","title":"Compression Ratio"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"meta":{"$ref":"#/components/schemas/SummarizeMeta"}},"type":"object","required":["summary","format","word_count","compression_ratio","meta"],"title":"SummarizeResponse"},"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"}}}}