{"openapi":"3.1.0","info":{"title":"s2ar","description":"Evidence an agent can hand on — certification, reproducible checks, image work, poetic forms; every answer with a receipt: deterministic assertions over an agent's output (schema, terms, citations, quotes in a source; a signed record), x402 endpoint inspection (a signed record of what a paid endpoint declares), GitHub code reads (a repo map, a file's skeleton, one function's source, search by name or by meaning), text grading against a poetic form, screenshot diffs (structure, colour, texture; a signed record), text extraction from an image (tesseract, the engine version in every answer), deterministic environments an agent plays with every episode sealed (baba, sokoban), reward audits (degenerate probes, invariance, soundness, a seeded exploit search; a graded record) and image certification (compress, then prove a vision model still reads it; a signed record). Every paid route takes GET with query parameters or POST with a JSON body, and answers 402 until paid: USDC on Base over x402, or a key from a card-bought pack. Failed calls are never charged. MCP at https://api.s2ar.dev/mcp.","version":"0.1.1","x-contact":"cody@s2ar.dev"},"paths":{"/v1/models":{"get":{"summary":"Models","operationId":"models_v1_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/chat/completions":{"post":{"summary":"Chat Completions","operationId":"chat_completions_v1_chat_completions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/x402/v1/certify":{"get":{"summary":"certify (GET)","description":"Certify an image compression: the image (by URL, as base64 JSON, or as a multipart file part `original`) is compressed to the smallest version a vision model reads the same way, the drift is measured by a deterministic witness, and the answer is a signed Assay record anyone can verify free at /v1/verify/{record_sha256}. With a `compressed` part too, it audits a transform someone else made. $0.01 per call. Query parameters: image_url, probe. Docs: https://s2ar.dev/examples/certify-a-screenshot.html","operationId":"certify_get_x402","responses":{"200":{"description":"an assay/2 record (kind compression) + receipt","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"tags":["certify"],"parameters":[{"name":"image_url","in":"query","required":false,"schema":{"type":"string"},"description":"https URL of a PNG, JPEG or WebP up to 4 MB","example":"https://s2ar.dev/examples/media/invoice.png"},{"name":"probe","in":"query","required":false,"schema":{"type":"string"},"description":"recon (default), ocr, or auto","example":"ocr"},{"name":"target_model","in":"query","required":false,"schema":{"type":"string"},"description":"the model whose reading must hold (default: the house witness)"}],"x-payment-info":{"intent":"charge","amount":"0.01","currency":"USD","description":"Compress an image and verify a vision model still reads it — a signed record anyone can check. GET ?image_url=","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.01","unit":"per call"},"free":"none: the /x402 mirror always answers 402 until paid"}},"post":{"summary":"certify","description":"Certify an image compression: the image (by URL, as base64 JSON, or as a multipart file part `original`) is compressed to the smallest version a vision model reads the same way, the drift is measured by a deterministic witness, and the answer is a signed Assay record anyone can verify free at /v1/verify/{record_sha256}. With a `compressed` part too, it audits a transform someone else made. $0.01 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/certify-a-screenshot.html","operationId":"certify_post_x402","responses":{"200":{"description":"an assay/2 record (kind compression) + receipt","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"tags":["certify"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","description":"https URL of a PNG, JPEG or WebP up to 4 MB"},"image_b64":{"type":"string","description":"the image bytes, base64 (POST only)"},"probe":{"type":"string","description":"recon (default), ocr, or auto"},"target_model":{"type":"string","description":"the model whose reading must hold (default: the house witness)"}},"anyOf":[{"required":["image_url"]},{"required":["image_b64"]}]},"example":{"image_url":"https://s2ar.dev/examples/media/invoice.png","probe":"ocr"}},"multipart/form-data":{"schema":{"type":"object","properties":{"original":{"type":"string","format":"binary","description":"the image"},"compressed":{"type":"string","format":"binary","description":"optional: a transform to audit"},"probe":{"type":"string"},"target_model":{"type":"string"}},"required":["original"]}}}},"x-payment-info":{"intent":"charge","amount":"0.01","currency":"USD","description":"Compress an image and verify a vision model still reads it — a signed record anyone can check. GET ?image_url=","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.01","unit":"per call"},"free":"none: the /x402 mirror always answers 402 until paid"}}},"/v1/verify":{"post":{"summary":"Verify Posted","description":"Verify a record you hold (pasted, received from someone else): the\nseal and, when signed, the signature against the carried key and this\nhost's pinned key. Free, no account, rate-limited like the GET.","operationId":"verify_posted_v1_verify_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/x402":{"get":{"summary":"X402 Manifest","description":"The x402 surface for crawlers (x402scan's shape; Agent402 reads it too). Served only\nwhile the rail can settle: a manifest of routes nobody can pay would be a false listing.","operationId":"x402_manifest__well_known_x402_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/charter":{"get":{"summary":"Charter Page","operationId":"charter_page_charter_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/charter.md":{"get":{"summary":"Charter Well Known","operationId":"charter_well_known__well_known_charter_md_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/proceedings.json":{"get":{"summary":"Proceedings Latest","operationId":"proceedings_latest__well_known_proceedings_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/proceedings/{day}.json":{"get":{"summary":"Proceedings Edition","operationId":"proceedings_edition__well_known_proceedings__day__json_get","parameters":[{"name":"day","in":"path","required":true,"schema":{"type":"string","title":"Day"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/.well-known/assay.json":{"get":{"summary":"Assay Well Known","description":"The issuer's manifest: format, public key, kinds, expiry, verify and badge URLs, retention.","operationId":"assay_well_known__well_known_assay_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/badge/{record_sha256}.svg":{"get":{"summary":"Assay Badge","description":"FREE: the badge for a record. Not-valid states render grey.","operationId":"assay_badge_v1_badge__record_sha256__svg_get","parameters":[{"name":"record_sha256","in":"path","required":true,"schema":{"type":"string","title":"Record Sha256"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assay/standard":{"get":{"summary":"Assay Standard","description":"The published standard, in brief: the envelope, the seal, the signature, the kinds and their expiry.","operationId":"assay_standard_assay_standard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/verify/{record_sha256}":{"get":{"summary":"Verify","operationId":"verify_v1_verify__record_sha256__get","parameters":[{"name":"record_sha256","in":"path","required":true,"schema":{"type":"string","title":"Record Sha256"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/credits/buy":{"post":{"summary":"Credits Buy","operationId":"credits_buy_v1_credits_buy_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackBody","default":{"usd":5.0}}}}},"responses":{"200":{"description":"Paid: {ok, key, balance_usd, use}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: the MPP challenge is in WWW-Authenticate; POST again with Authorization: Payment"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-payment-info":{"intent":"charge","amount":"500","currency":"USD","description":"sym credits: a $5, $25 or $100 pack; the response carries a key"}}},"/x402/v1/score":{"get":{"summary":"score (GET)","operationId":"score_get_x402","responses":{"200":{"description":"{ok, scores, composite, accepted, diagnostics, charged_usd}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"Score a text against a poetic form (sonnet, haiku, villanelle, limerick, …; GET /v1/score/forms lists them, free, with the acceptance policy) or an inline spec, with programmatic verifiers: meter from a pronouncing dictionary named by version in every answer, rhyme, line and syllable counts. The verdict is gated (an exact line count for fixed forms, a content floor, no credit for identical end words, a floor under every dimension) and every gate names its evidence; the same text gets the same answer every time, and the answer is a signed Assay record anyone can verify free; the text is never kept. $0.005 per call. Query parameters: text, form. Docs: https://s2ar.dev/examples/score-a-sonnet.html","tags":["score"],"parameters":[{"name":"text","in":"query","required":true,"schema":{"type":"string"},"example":"An old silent pond\nA frog jumps into the pond\nSplash! Silence again"},{"name":"form","in":"query","required":false,"schema":{"type":"string"},"description":"a form name; GET /v1/score/forms lists them","example":"haiku"}],"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"Grade a text against a form — meter, rhyme, line and content gates, the dictionary named; a signed record. GET ?text=&form=","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"},"free":"none: the /x402 mirror always answers 402 until paid"}},"post":{"summary":"score","operationId":"score_post_x402","responses":{"200":{"description":"{ok, scores, composite, accepted, diagnostics, charged_usd}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"Score a text against a poetic form (sonnet, haiku, villanelle, limerick, …; GET /v1/score/forms lists them, free, with the acceptance policy) or an inline spec, with programmatic verifiers: meter from a pronouncing dictionary named by version in every answer, rhyme, line and syllable counts. The verdict is gated (an exact line count for fixed forms, a content floor, no credit for identical end words, a floor under every dimension) and every gate names its evidence; the same text gets the same answer every time, and the answer is a signed Assay record anyone can verify free; the text is never kept. $0.005 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/score-a-sonnet.html","tags":["score"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":20000},"form":{"type":"string","description":"a form name; GET /v1/score/forms lists them"},"spec":{"type":"object","description":"an inline form spec instead of a name (POST only)"}},"required":["text"]},"example":{"text":"An old silent pond\nA frog jumps into the pond\nSplash! Silence again","form":"haiku"}}}},"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"Grade a text against a form — meter, rhyme, line and content gates, the dictionary named; a signed record. GET ?text=&form=","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"},"free":"none: the /x402 mirror always answers 402 until paid"}}},"/v1/score/forms":{"get":{"summary":"Score Forms","operationId":"score_forms_v1_score_forms_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/x402/v1/assert":{"get":{"summary":"assert (GET)","operationId":"assert_get_x402","responses":{"200":{"description":"{ok, passed, checks, verdict, score, results[], record_sha256, record, receipt, charged_usd}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"Deterministic assertions over an agent's output: JSON validity and schema (Draft 2020-12), required or banned keys and terms, lengths, guarded regexes, numbers in range, citations present, quoted spans found verbatim in the source as given (its hash is in the record), URLs under allowed domains, the poetry verifiers; or a named rubric (strict-json, api-response, cited-answer, quotes-source, no-hedging; GET /v1/assert/checks lists them). Every check's verdict comes with its evidence (the offset, the count, the missing key), and the answer is a signed Assay record anyone can verify free at /v1/verify/{record_sha256}; the text is never kept. $0.005 per call. Query parameters: text, checks. Docs: https://s2ar.dev/examples/assert-an-agents-output.html","tags":["assert"],"parameters":[{"name":"text","in":"query","required":false,"schema":{"type":"string"},"description":"the output to assert (or `json`, an object)","example":"{\"summary\": \"The glob flag is parsed in defs.rs\", \"source_url\": \"https://github.com/BurntSushi/ripgrep\"}"},{"name":"checks","in":"query","required":false,"schema":{"type":"string"},"description":"the checks; on GET, a JSON list in one parameter","example":"[{\"check\":\"json_valid\"},{\"check\":\"required_keys\",\"keys\":[\"summary\",\"source_url\"]},{\"check\":\"citations_present\",\"min\":1}]"},{"name":"rubric","in":"query","required":false,"schema":{"type":"string"},"description":"a named check list; `schema`, `domains` fill its slots"},{"name":"source","in":"query","required":false,"schema":{"type":"string"},"description":"the source for quotes_in_source"},{"name":"schema","in":"query","required":false,"schema":{"type":"string"},"description":"for json_schema / api-response"}],"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"Assert an agent's output — JSON schema, terms, lengths, citations, quotes in a source; a signed record. GET ?text=&checks=","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"},"free":"none: the /x402 mirror always answers 402 until paid"}},"post":{"summary":"assert","operationId":"assert_post_x402","responses":{"200":{"description":"{ok, passed, checks, verdict, score, results[], record_sha256, record, receipt, charged_usd}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"Deterministic assertions over an agent's output: JSON validity and schema (Draft 2020-12), required or banned keys and terms, lengths, guarded regexes, numbers in range, citations present, quoted spans found verbatim in the source as given (its hash is in the record), URLs under allowed domains, the poetry verifiers; or a named rubric (strict-json, api-response, cited-answer, quotes-source, no-hedging; GET /v1/assert/checks lists them). Every check's verdict comes with its evidence (the offset, the count, the missing key), and the answer is a signed Assay record anyone can verify free at /v1/verify/{record_sha256}; the text is never kept. $0.005 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/assert-an-agents-output.html","tags":["assert"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":20000,"description":"the output to assert (or `json`, an object)"},"json":{"type":"object","description":"the output as a JSON object instead of text (POST only)"},"checks":{"type":"array","maxItems":32,"items":{"type":"object","required":["check"],"properties":{"check":{"type":"string","description":"one of GET /v1/assert/checks"}}},"description":"the checks; on GET, a JSON list in one parameter"},"rubric":{"type":"string","description":"a named check list; `schema`, `domains` fill its slots"},"source":{"type":"string","maxLength":60000,"description":"the source for quotes_in_source"},"schema":{"type":"object","description":"for json_schema / api-response"}},"anyOf":[{"required":["text"]},{"required":["json"]}]},"example":{"text":"{\"summary\": \"The glob flag is parsed in defs.rs\", \"source_url\": \"https://github.com/BurntSushi/ripgrep\"}","checks":[{"check":"json_valid"},{"check":"required_keys","keys":["summary","source_url"]},{"check":"citations_present","min":1}]}}}},"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"Assert an agent's output — JSON schema, terms, lengths, citations, quotes in a source; a signed record. GET ?text=&checks=","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"},"free":"none: the /x402 mirror always answers 402 until paid"}}},"/v1/assert/checks":{"get":{"summary":"Assert Checks","operationId":"assert_checks_v1_assert_checks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/x402/v1/x402/inspect":{"get":{"summary":"inspect (GET)","operationId":"inspect_get_x402","responses":{"200":{"description":"{ok, resource, method, status, verdict, passed, checks, score, summary, results[], record_sha256, record, receipt, charged_usd}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"Probe a paid endpoint the way a wallet, a directory or a facilitator does (one unpaid request, no payment headers) and check what it declares: a 402, the v2 PAYMENT-REQUIRED header, well-formed accepts (scheme, network, amount, payee, asset, timeout, the token's signing domain), a price that reads as money, a resource naming the probed URL, a Bazaar extension that validates against its own schema and declares the probed method, a description, no-store, and Coinbase's validator verdict. Every check names its evidence; the answer is a signed Assay record (30-day expiry; a probe is a point in time) anyone can verify free. $0.005 per call. Query parameters: resource, method. Docs: https://s2ar.dev/examples/inspect-an-x402-endpoint.html","tags":["inspect"],"parameters":[{"name":"resource","in":"query","required":true,"schema":{"type":"string"},"description":"the endpoint's https URL","example":"https://api.s2ar.dev/x402/v1/assert"},{"name":"method","in":"query","required":false,"schema":{"type":"string"},"description":"how to probe it (default GET)","example":"GET"},{"name":"checks","in":"query","required":false,"schema":{"type":"string"},"description":"a subset of GET /v1/x402/inspect/checks (default: all)"}],"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"Inspect an x402 endpoint — its 402, accepts, price, Bazaar extension, CDP verdict; a signed record. GET ?resource=","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"},"free":"none: the /x402 mirror always answers 402 until paid"}},"post":{"summary":"inspect","operationId":"inspect_post_x402","responses":{"200":{"description":"{ok, resource, method, status, verdict, passed, checks, score, summary, results[], record_sha256, record, receipt, charged_usd}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"Probe a paid endpoint the way a wallet, a directory or a facilitator does (one unpaid request, no payment headers) and check what it declares: a 402, the v2 PAYMENT-REQUIRED header, well-formed accepts (scheme, network, amount, payee, asset, timeout, the token's signing domain), a price that reads as money, a resource naming the probed URL, a Bazaar extension that validates against its own schema and declares the probed method, a description, no-store, and Coinbase's validator verdict. Every check names its evidence; the answer is a signed Assay record (30-day expiry; a probe is a point in time) anyone can verify free. $0.005 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/inspect-an-x402-endpoint.html","tags":["inspect"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"resource":{"type":"string","description":"the endpoint's https URL"},"method":{"type":"string","enum":["GET","POST"],"description":"how to probe it (default GET)"},"checks":{"type":"array","items":{"type":"string"},"description":"a subset of GET /v1/x402/inspect/checks (default: all)"}},"required":["resource"]},"example":{"resource":"https://api.s2ar.dev/x402/v1/assert","method":"GET"}}}},"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"Inspect an x402 endpoint — its 402, accepts, price, Bazaar extension, CDP verdict; a signed record. GET ?resource=","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"},"free":"none: the /x402 mirror always answers 402 until paid"}}},"/v1/x402/inspect/checks":{"get":{"summary":"Inspect Checks","operationId":"inspect_checks_v1_x402_inspect_checks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/x402/v1/diff":{"get":{"summary":"diff (GET)","operationId":"diff_get_x402","responses":{"200":{"description":"{ok, verdict same|regression, outcome, passed, checks, regressed[], distances{}, results[], a{sha256,w,h,bytes}, b{…}, record_sha256, record, receipt, charged_usd}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"Assert for pixels: two images (each an https URL or base64) measured by three deterministic witnesses — a 9×8 luma difference hash for structure, an 8×8 RGB signature for colour (the palette regression dhash is blind to), and the relative change of gradient energy for texture (smoothing, ringing) — each against a threshold you may set. The verdict is same or regression; the signed Assay record carries both images by sha256, width, height and bytes, the three distances and the thresholds, never pixels, so anyone holding the files can re-measure and anyone can verify the seal free at /v1/verify/{record_sha256}. Built for an agent that tests a game or a UI: the golden frame against today's. $0.005 per call. Query parameters: a, b. Docs: https://s2ar.dev/examples/diff-two-screenshots.html","tags":["diff"],"parameters":[{"name":"a","in":"query","required":true,"schema":{"type":"string"},"description":"the first image: an https URL of a PNG, JPEG or WebP up to 4 MB, or base64","example":"https://s2ar.dev/examples/media/scene.png"},{"name":"b","in":"query","required":true,"schema":{"type":"string"},"description":"the second image, the same way","example":"https://s2ar.dev/examples/media/scene-rb.png"},{"name":"threshold","in":"query","required":false,"schema":{"type":"string"},"description":"dhash threshold (default 0.10)"},{"name":"color_threshold","in":"query","required":false,"schema":{"type":"string"},"description":"colour-signature threshold (default 0.02)"},{"name":"grad_threshold","in":"query","required":false,"schema":{"type":"string"},"description":"gradient-energy threshold (default 0.25)"}],"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"Diff two screenshots — structure, colour, texture against thresholds; same or regression; a signed record. GET ?a=&b=","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"},"free":"none: the /x402 mirror always answers 402 until paid"}},"post":{"summary":"diff","operationId":"diff_post_x402","responses":{"200":{"description":"{ok, verdict same|regression, outcome, passed, checks, regressed[], distances{}, results[], a{sha256,w,h,bytes}, b{…}, record_sha256, record, receipt, charged_usd}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"Assert for pixels: two images (each an https URL or base64) measured by three deterministic witnesses — a 9×8 luma difference hash for structure, an 8×8 RGB signature for colour (the palette regression dhash is blind to), and the relative change of gradient energy for texture (smoothing, ringing) — each against a threshold you may set. The verdict is same or regression; the signed Assay record carries both images by sha256, width, height and bytes, the three distances and the thresholds, never pixels, so anyone holding the files can re-measure and anyone can verify the seal free at /v1/verify/{record_sha256}. Built for an agent that tests a game or a UI: the golden frame against today's. $0.005 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/diff-two-screenshots.html","tags":["diff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"a":{"type":"string","description":"the first image: an https URL of a PNG, JPEG or WebP up to 4 MB, or base64"},"b":{"type":"string","description":"the second image, the same way"},"threshold":{"type":"number","description":"dhash threshold (default 0.10)"},"color_threshold":{"type":"number","description":"colour-signature threshold (default 0.02)"},"grad_threshold":{"type":"number","description":"gradient-energy threshold (default 0.25)"}},"required":["a","b"]},"example":{"a":"https://s2ar.dev/examples/media/scene.png","b":"https://s2ar.dev/examples/media/scene-rb.png"}}}},"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"Diff two screenshots — structure, colour, texture against thresholds; same or regression; a signed record. GET ?a=&b=","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"},"free":"none: the /x402 mirror always answers 402 until paid"}}},"/v1/diff/checks":{"get":{"summary":"Diff Checks","operationId":"diff_checks_v1_diff_checks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/x402/v1/extract_text":{"get":{"summary":"extract_text (GET)","operationId":"extract_get_x402","responses":{"200":{"description":"{ok, text, words, lines, chars, engine{name, version, lang, acuity}, image{sha256, w, h, bytes, fitted}, receipt, charged_usd}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"The text in an image, as a plain answer: a PNG, JPEG or WebP (an https URL on a public host, base64, or a multipart file part `original`) is fitted to an acuity (long edge 1568 by default, never upscaled) and read by tesseract; the answer is the text, its word, line and character counts, the engine's name and version, the language, and the image by sha256, width, height and bytes — never the pixels, and nothing is stored. Deterministic given the engine version that rides every answer. A fetch that fails, a non-image or a language the host lacks is a 400, never charged. For OCR as evidence — a signed record that a compression kept the text — use certify with probe=ocr. $0.02 per call. Query parameters: image_url. Docs: https://s2ar.dev/examples/extract-the-text.html","tags":["extract_text"],"parameters":[{"name":"image_url","in":"query","required":false,"schema":{"type":"string"},"description":"an https URL of a PNG, JPEG or WebP up to 4 MB on a public host (no redirects)","example":"https://s2ar.dev/examples/media/invoice.png"},{"name":"lang","in":"query","required":false,"schema":{"type":"string"},"description":"a tesseract language the host has (default eng; GET /v1/extract_text/languages)"},{"name":"acuity","in":"query","required":false,"schema":{"type":"string"},"description":"the long edge the image is fitted to before OCR (default 1568, at most 2560)"}],"x-payment-info":{"intent":"charge","amount":"0.02","currency":"USD","description":"Extract the text from an image — tesseract on a URL, base64 or a file; the engine version in every answer. GET ?image_url=","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.02","unit":"per call"},"free":"none: the /x402 mirror always answers 402 until paid"}},"post":{"summary":"extract_text","operationId":"extract_post_x402","responses":{"200":{"description":"{ok, text, words, lines, chars, engine{name, version, lang, acuity}, image{sha256, w, h, bytes, fitted}, receipt, charged_usd}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"The text in an image, as a plain answer: a PNG, JPEG or WebP (an https URL on a public host, base64, or a multipart file part `original`) is fitted to an acuity (long edge 1568 by default, never upscaled) and read by tesseract; the answer is the text, its word, line and character counts, the engine's name and version, the language, and the image by sha256, width, height and bytes — never the pixels, and nothing is stored. Deterministic given the engine version that rides every answer. A fetch that fails, a non-image or a language the host lacks is a 400, never charged. For OCR as evidence — a signed record that a compression kept the text — use certify with probe=ocr. $0.02 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/extract-the-text.html","tags":["extract_text"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","description":"an https URL of a PNG, JPEG or WebP up to 4 MB on a public host (no redirects)"},"image_b64":{"type":"string","description":"the image bytes as base64, instead of a URL"},"lang":{"type":"string","description":"a tesseract language the host has (default eng; GET /v1/extract_text/languages)"},"acuity":{"type":"integer","description":"the long edge the image is fitted to before OCR (default 1568, at most 2560)"}},"required":[]},"example":{"image_url":"https://s2ar.dev/examples/media/invoice.png"}}}},"x-payment-info":{"intent":"charge","amount":"0.02","currency":"USD","description":"Extract the text from an image — tesseract on a URL, base64 or a file; the engine version in every answer. GET ?image_url=","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.02","unit":"per call"},"free":"none: the /x402 mirror always answers 402 until paid"}}},"/v1/extract_text/languages":{"get":{"summary":"Extract Languages","operationId":"extract_languages_v1_extract_text_languages_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/x402/v1/env/reset":{"get":{"summary":"env (GET)","operationId":"env_get_x402","responses":{"200":{"description":"{ok, episode_id, env, version, core_sha, seed, level, horizon, ply, obs, legal, digest, expires_in_s, rail, price_usd}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"Deterministic environments an agent plays over HTTP: reset opens an episode of baba (Baba-Is-You rules on a tiny board; eleven levels with certified solution lengths) or sokoban (generated into a certified push band), step plays one action and answers the observation, the reward, done, the legal actions and a chained digest, and when the episode ends it is sealed as a signed record — the env version, the core's sha, the seed, the level, every action and reward, the final state — that anyone replays to the same digest and verifies free at /v1/verify/{record_sha256}. One price per episode, the steps free; an episode left open past its window (600 s; 50 s on x402) is never charged. A scorecard seals mean return and win rate over your episodes under your policy label. GET /v1/env is the catalogue. $0.02 per call. Query parameters: env, seed. Docs: https://s2ar.dev/examples/play-an-environment.html","tags":["env"],"parameters":[{"name":"env","in":"query","required":false,"schema":{"type":"string"},"description":"baba (default) or sokoban","example":"baba"},{"name":"seed","in":"query","required":false,"schema":{"type":"string"},"description":"the seed (default 0): picks or generates the level, deterministically","example":"0"},{"name":"level","in":"query","required":false,"schema":{"type":"string"},"description":"baba: a level name from GET /v1/env instead of the seed's pick"},{"name":"band","in":"query","required":false,"schema":{"type":"string"},"description":"sokoban: easy (default), medium or hard"}],"x-payment-info":{"intent":"charge","amount":"0.02","currency":"USD","description":"Open an episode of a deterministic environment (baba, sokoban); step it free; the sealed, signed episode. GET ?env=baba","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.02","unit":"per episode; steps are free"},"free":"none: the /x402 mirror always answers 402 until paid"}},"post":{"summary":"env","operationId":"env_post_x402","responses":{"200":{"description":"{ok, episode_id, env, version, core_sha, seed, level, horizon, ply, obs, legal, digest, expires_in_s, rail, price_usd}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"Deterministic environments an agent plays over HTTP: reset opens an episode of baba (Baba-Is-You rules on a tiny board; eleven levels with certified solution lengths) or sokoban (generated into a certified push band), step plays one action and answers the observation, the reward, done, the legal actions and a chained digest, and when the episode ends it is sealed as a signed record — the env version, the core's sha, the seed, the level, every action and reward, the final state — that anyone replays to the same digest and verifies free at /v1/verify/{record_sha256}. One price per episode, the steps free; an episode left open past its window (600 s; 50 s on x402) is never charged. A scorecard seals mean return and win rate over your episodes under your policy label. GET /v1/env is the catalogue. $0.02 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/play-an-environment.html","tags":["env"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"env":{"type":"string","description":"baba (default) or sokoban"},"seed":{"type":"integer","description":"the seed (default 0): picks or generates the level, deterministically"},"level":{"type":"string","description":"baba: a level name from GET /v1/env instead of the seed's pick"},"band":{"type":"string","description":"sokoban: easy (default), medium or hard"}},"required":[]},"example":{"env":"baba","seed":0}}}},"x-payment-info":{"intent":"charge","amount":"0.02","currency":"USD","description":"Open an episode of a deterministic environment (baba, sokoban); step it free; the sealed, signed episode. GET ?env=baba","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.02","unit":"per episode; steps are free"},"free":"none: the /x402 mirror always answers 402 until paid"}}},"/v1/env/step":{"get":{"summary":"Env Step Route","operationId":"env_step_route_v1_env_step_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Env Step Route","operationId":"env_step_route_v1_env_step_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/env/episode/{episode_id}":{"get":{"summary":"Env Episode Route","operationId":"env_episode_route_v1_env_episode__episode_id__get","parameters":[{"name":"episode_id","in":"path","required":true,"schema":{"type":"string","title":"Episode Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/env/scorecard":{"post":{"summary":"Env Scorecard Route","operationId":"env_scorecard_route_v1_env_scorecard_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/env":{"get":{"summary":"Env Catalog Route","operationId":"env_catalog_route_v1_env_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/env/tape/{record_sha256}":{"get":{"summary":"Env Tape Route","description":"A sealed episode as a tape (free, like verify): what a core at core_sha needs to replay it ply by ply and compare\nevery state digest. The first ply whose digest differs is the divergence; none is bit-exact.","operationId":"env_tape_route_v1_env_tape__record_sha256__get","parameters":[{"name":"record_sha256","in":"path","required":true,"schema":{"type":"string","title":"Record Sha256"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/x402/v1/audit":{"get":{"summary":"audit (GET)","operationId":"audit_get_x402","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"},"202":{"description":"{ok, job, status queued, poll, eta_s, price_usd, rail, charged_usd 0, target}"}},"description":"A reward audited without a model: fixed degenerate completions that must not pass (accepted garbage), cosmetic re-renderings of a passing answer that must not move the score (fragility), known-wrong and equivalent answers (soundness and completeness), and a seeded search that drives the reward up while a held-out intent check fails (a constructed, replayable exploit). The target is one of our environments (baba, sokoban), a scorer you expose over https (POST {text, prompt, answer, info} → {score}, with the rows you give), or a Hub environment whose author consented. The job runs in the background (202 + poll); the answer is a graded record (A pass, C partial, F fail, ERR measured) with a reward-integrity score, verifiable free, 180 days; nothing is charged until it completes. $2 per call. Query parameters: env. Docs: https://s2ar.dev/examples/audit-a-reward.html","tags":["audit"],"parameters":[{"name":"env","in":"query","required":false,"schema":{"type":"string"},"description":"one of our environments: baba or sokoban","example":"baba"},{"name":"grader_url","in":"query","required":false,"schema":{"type":"string"},"description":"or an https scorer: POST {text, prompt, answer, info} → {score}"},{"name":"rows","in":"query","required":false,"schema":{"type":"string"},"description":"with grader_url: 1–10 rows {prompt, answer?, info?}"},{"name":"pass_threshold","in":"query","required":false,"schema":{"type":"string"},"description":"with grader_url: the passing score (default 0.5)"},{"name":"hub_env","in":"query","required":false,"schema":{"type":"string"},"description":"or a Hub environment module, with its author's consent on file"},{"name":"n_rows","in":"query","required":false,"schema":{"type":"string"},"description":"rows sampled (default 3, at most 10)"},{"name":"row_seed","in":"query","required":false,"schema":{"type":"string"},"description":"which rows (default 0)"},{"name":"exploit_budget","in":"query","required":false,"schema":{"type":"string"},"description":"search simulations per row (default 128, at most 512)"}],"x-payment-info":{"intent":"charge","amount":"2","currency":"USD","description":"Audit a reward for gaming: degenerate probes, invariance, soundness, a seeded exploit search; a graded signed record. POST","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"2","unit":"per audit; settled when the job completes"},"free":"none: the /x402 mirror always answers 402 until paid"}},"post":{"summary":"audit","operationId":"audit_post_x402","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"},"202":{"description":"{ok, job, status queued, poll, eta_s, price_usd, rail, charged_usd 0, target}"}},"description":"A reward audited without a model: fixed degenerate completions that must not pass (accepted garbage), cosmetic re-renderings of a passing answer that must not move the score (fragility), known-wrong and equivalent answers (soundness and completeness), and a seeded search that drives the reward up while a held-out intent check fails (a constructed, replayable exploit). The target is one of our environments (baba, sokoban), a scorer you expose over https (POST {text, prompt, answer, info} → {score}, with the rows you give), or a Hub environment whose author consented. The job runs in the background (202 + poll); the answer is a graded record (A pass, C partial, F fail, ERR measured) with a reward-integrity score, verifiable free, 180 days; nothing is charged until it completes. $2 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/audit-a-reward.html","tags":["audit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"env":{"type":"string","description":"one of our environments: baba or sokoban"},"grader_url":{"type":"string","description":"or an https scorer: POST {text, prompt, answer, info} → {score}"},"rows":{"type":"array","items":{"type":"object"},"description":"with grader_url: 1–10 rows {prompt, answer?, info?}"},"pass_threshold":{"type":"number","description":"with grader_url: the passing score (default 0.5)"},"hub_env":{"type":"string","description":"or a Hub environment module, with its author's consent on file"},"n_rows":{"type":"integer","description":"rows sampled (default 3, at most 10)"},"row_seed":{"type":"integer","description":"which rows (default 0)"},"exploit_budget":{"type":"integer","description":"search simulations per row (default 128, at most 512)"}},"required":[]},"example":{"env":"baba","n_rows":3,"row_seed":0}}}},"x-payment-info":{"intent":"charge","amount":"2","currency":"USD","description":"Audit a reward for gaming: degenerate probes, invariance, soundness, a seeded exploit search; a graded signed record. POST","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"2","unit":"per audit; settled when the job completes"},"free":"none: the /x402 mirror always answers 402 until paid"}}},"/v1/audit/sample-grader":{"post":{"summary":"Sample Grader Route","description":"A grader anyone can audit first: our poetic-form scorer behind the grader_url contract —\nPOST {text, prompt, answer, info{form}} → {score}. The score is the form's composite in [0, 1]; the form is\ninfo.form (haiku by default). Free, unmetered, and the one grader_url the free rail audits.","operationId":"sample_grader_route_v1_audit_sample_grader_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/audit/{job}":{"get":{"summary":"Audit Status Route","operationId":"audit_status_route_v1_audit__job__get","parameters":[{"name":"job","in":"path","required":true,"schema":{"type":"string","title":"Job"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/x402/watch":{"get":{"summary":"watch (GET)","operationId":"watch_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"A seller's own endpoint inspected daily: the same eleven checks, record and evidence `inspect` gives anyone, every morning, as a hosted report page (/v1/x402/watch/{host}) and a badge (/v1/badge/x402/{host}.svg). Registering with a key is consent to be named for that resource's results (charter clause 8); withdrawn with one DELETE; paid in credits per probe; a probe that does not run is not charged. No x402 rail: a watch is recurring. $0.02 per call. Query parameters: resource, method. Docs: https://s2ar.dev/examples/inspect-an-x402-endpoint.html","tags":["watch"],"parameters":[{"name":"resource","in":"query","required":true,"schema":{"type":"string"},"description":"your endpoint's https URL","example":"https://api.s2ar.dev/x402/v1/assert"},{"name":"method","in":"query","required":false,"schema":{"type":"string"},"description":"how to probe it (default GET)","example":"GET"}],"x-payment-info":{"intent":"charge","amount":"0.02","currency":"USD","description":"Watch your own x402 endpoint — a signed inspection every day, a hosted report and a badge. POST {resource} with a key","protocols":["credits"],"price":{"mode":"fixed","currency":"USD","amount":"0.02","unit":"per probe, one a day"},"free":"0 calls a day without an account; sign in with an email for a $1.00 grant"}},"post":{"summary":"watch","operationId":"watch_post","responses":{"200":{"description":"{ok, resource, method, status, since, latest, days[], fixes[], report, badge}","content":{"application/json":{"schema":{}}}},"401":{"description":"a key is required"},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"description":"A seller's own endpoint inspected daily: the same eleven checks, record and evidence `inspect` gives anyone, every morning, as a hosted report page (/v1/x402/watch/{host}) and a badge (/v1/badge/x402/{host}.svg). Registering with a key is consent to be named for that resource's results (charter clause 8); withdrawn with one DELETE; paid in credits per probe; a probe that does not run is not charged. No x402 rail: a watch is recurring. $0.02 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/inspect-an-x402-endpoint.html","tags":["watch"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"resource":{"type":"string","description":"your endpoint's https URL"},"method":{"type":"string","enum":["GET","POST"],"description":"how to probe it (default GET)"}},"required":["resource"]},"example":{"resource":"https://api.s2ar.dev/x402/v1/assert","method":"GET"}}}},"x-payment-info":{"intent":"charge","amount":"0.02","currency":"USD","description":"Watch your own x402 endpoint — a signed inspection every day, a hosted report and a badge. POST {resource} with a key","protocols":["credits"],"price":{"mode":"fixed","currency":"USD","amount":"0.02","unit":"per probe, one a day"},"free":"0 calls a day without an account; sign in with an email for a $1.00 grant"}},"delete":{"summary":"Withdraw Route","operationId":"withdraw_route_v1_x402_watch_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/x402/watch/{host}":{"get":{"summary":"Report Route","operationId":"report_route_v1_x402_watch__host__get","parameters":[{"name":"host","in":"path","required":true,"schema":{"type":"string","title":"Host"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/badge/x402/{host}.svg":{"get":{"summary":"Badge Route","operationId":"badge_route_v1_badge_x402__host__svg_get","parameters":[{"name":"host","in":"path","required":true,"schema":{"type":"string","title":"Host"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp":{"post":{"summary":"Mcp Post","operationId":"mcp_post_mcp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/mcp/directory":{"get":{"summary":"Mcp Get","operationId":"mcp_get_mcp_directory_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Mcp Directory Post","operationId":"mcp_directory_post_mcp_directory_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Mcp Delete","operationId":"mcp_delete_mcp_directory_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/x402/v1/sym/map":{"get":{"summary":"sym map (GET)","operationId":"map_get_x402","responses":{"200":{"description":"{ok, text, data, tokens_est, charged_usd, repo, ref}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"x-payment-info":{"intent":"charge","amount":"0.01","currency":"USD","description":"GitHub repo map — files ranked by imports with their definitions, fitted to a token budget. GET ?repo=owner/repo","free":"none: the /x402 mirror always answers 402 until paid","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.01","unit":"per call"}},"description":"A map of a public git repository fitted to a token budget: files ranked by how many others import them (PageRank over the import graph), each with its top-level definitions, parsed with tree-sitter (Rust, Python, TypeScript/TSX, JavaScript, Go, Lua, C, C++, Java, Ruby). Use it to orient before reading anything. Every answer carries a receipt. $0.01 per call. Query parameters: repo, ref, budget. Docs: https://s2ar.dev/examples/read-the-function.html","tags":["sym"],"parameters":[{"name":"repo","in":"query","required":true,"schema":{"type":"string"},"description":"a public GitHub, GitLab or Codeberg repository: owner/repo, github.com/owner/repo or its https URL","example":"BurntSushi/ripgrep"},{"name":"ref","in":"query","required":false,"schema":{"type":"string"},"description":"branch, tag or commit; the default branch when omitted","example":"14.1.1"},{"name":"budget","in":"query","required":false,"schema":{"type":"string"},"description":"approximate tokens (default 1000)","example":"600"}]},"post":{"summary":"sym map","operationId":"map_post_x402","responses":{"200":{"description":"{ok, text, data, tokens_est, charged_usd, repo, ref}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"x-payment-info":{"intent":"charge","amount":"0.01","currency":"USD","description":"GitHub repo map — files ranked by imports with their definitions, fitted to a token budget. GET ?repo=owner/repo","free":"none: the /x402 mirror always answers 402 until paid","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.01","unit":"per call"}},"description":"A map of a public git repository fitted to a token budget: files ranked by how many others import them (PageRank over the import graph), each with its top-level definitions, parsed with tree-sitter (Rust, Python, TypeScript/TSX, JavaScript, Go, Lua, C, C++, Java, Ruby). Use it to orient before reading anything. Every answer carries a receipt. $0.01 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/read-the-function.html","tags":["sym"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"repo":{"type":"string","description":"a public GitHub, GitLab or Codeberg repository: owner/repo, github.com/owner/repo or its https URL","examples":["BurntSushi/ripgrep"]},"ref":{"type":"string","description":"branch, tag or commit; the default branch when omitted"},"budget":{"type":"integer","minimum":100,"maximum":8000,"description":"approximate tokens (default 1000)"}},"required":["repo"]},"example":{"repo":"BurntSushi/ripgrep","ref":"14.1.1","budget":600}}}}}},"/x402/v1/sym/find":{"get":{"summary":"sym find (GET)","operationId":"find_get_x402","responses":{"200":{"description":"{ok, text, data, tokens_est, charged_usd, repo, ref}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"Code search by name in a GitHub repo — every definition of a symbol with file and lines. GET ?repo=&name=","free":"none: the /x402 mirror always answers 402 until paid","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"}},"description":"Where a name is defined across a public git repository: every definition whose leaf name or qualified path equals `name` (or starts with it when `prefix` is true), with kind, file and line range. Grep finds mentions; this finds the definition. $0.005 per call. Query parameters: repo, ref, name. Docs: https://s2ar.dev/examples/read-the-function.html","tags":["sym"],"parameters":[{"name":"repo","in":"query","required":true,"schema":{"type":"string"},"description":"a public GitHub, GitLab or Codeberg repository: owner/repo, github.com/owner/repo or its https URL","example":"BurntSushi/ripgrep"},{"name":"ref","in":"query","required":false,"schema":{"type":"string"},"description":"branch, tag or commit; the default branch when omitted","example":"14.1.1"},{"name":"name","in":"query","required":true,"schema":{"type":"string"},"example":"Glob"},{"name":"prefix","in":"query","required":false,"schema":{"type":"string"},"description":"match names starting with `name`"}]},"post":{"summary":"sym find","operationId":"find_post_x402","responses":{"200":{"description":"{ok, text, data, tokens_est, charged_usd, repo, ref}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"Code search by name in a GitHub repo — every definition of a symbol with file and lines. GET ?repo=&name=","free":"none: the /x402 mirror always answers 402 until paid","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"}},"description":"Where a name is defined across a public git repository: every definition whose leaf name or qualified path equals `name` (or starts with it when `prefix` is true), with kind, file and line range. Grep finds mentions; this finds the definition. $0.005 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/read-the-function.html","tags":["sym"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"repo":{"type":"string","description":"a public GitHub, GitLab or Codeberg repository: owner/repo, github.com/owner/repo or its https URL","examples":["BurntSushi/ripgrep"]},"ref":{"type":"string","description":"branch, tag or commit; the default branch when omitted"},"name":{"type":"string"},"prefix":{"type":"boolean","description":"match names starting with `name`"}},"required":["repo","name"]},"example":{"repo":"BurntSushi/ripgrep","ref":"14.1.1","name":"Glob"}}}}}},"/x402/v1/sym/where":{"get":{"summary":"sym where (GET)","operationId":"where_get_x402","responses":{"200":{"description":"{ok, text, data, tokens_est, charged_usd, repo, ref}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"x-payment-info":{"intent":"charge","amount":"0.01","currency":"USD","description":"Code search by meaning in a GitHub repo — the definitions matching a question, with file and lines. GET ?repo=&query=","free":"none: the /x402 mirror always answers 402 until paid","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.01","unit":"per call"}},"description":"Code by meaning in a public git repository: a semantic search over an index of every definition, built once per checkout, plus a name match. Use it when you do not know the name of what you are looking for. A repository's first call may answer 202 while its index builds; that call is not charged. $0.01 per call. Query parameters: repo, ref, query. Docs: https://s2ar.dev/examples/read-the-function.html","tags":["sym"],"parameters":[{"name":"repo","in":"query","required":true,"schema":{"type":"string"},"description":"a public GitHub, GitLab or Codeberg repository: owner/repo, github.com/owner/repo or its https URL","example":"BurntSushi/ripgrep"},{"name":"ref","in":"query","required":false,"schema":{"type":"string"},"description":"branch, tag or commit; the default branch when omitted","example":"14.1.1"},{"name":"query","in":"query","required":true,"schema":{"type":"string"},"example":"how are glob overrides applied"},{"name":"k","in":"query","required":false,"schema":{"type":"string"},"description":"hits to return (default 8)"}]},"post":{"summary":"sym where","operationId":"where_post_x402","responses":{"200":{"description":"{ok, text, data, tokens_est, charged_usd, repo, ref}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"x-payment-info":{"intent":"charge","amount":"0.01","currency":"USD","description":"Code search by meaning in a GitHub repo — the definitions matching a question, with file and lines. GET ?repo=&query=","free":"none: the /x402 mirror always answers 402 until paid","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.01","unit":"per call"}},"description":"Code by meaning in a public git repository: a semantic search over an index of every definition, built once per checkout, plus a name match. Use it when you do not know the name of what you are looking for. A repository's first call may answer 202 while its index builds; that call is not charged. $0.01 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/read-the-function.html","tags":["sym"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"repo":{"type":"string","description":"a public GitHub, GitLab or Codeberg repository: owner/repo, github.com/owner/repo or its https URL","examples":["BurntSushi/ripgrep"]},"ref":{"type":"string","description":"branch, tag or commit; the default branch when omitted"},"query":{"type":"string"},"k":{"type":"integer","minimum":1,"maximum":32,"description":"hits to return (default 8)"}},"required":["repo","query"]},"example":{"repo":"BurntSushi/ripgrep","ref":"14.1.1","query":"how are glob overrides applied"}}}}}},"/x402/v1/sym/read":{"get":{"summary":"sym read (GET)","operationId":"read_get_x402","responses":{"200":{"description":"{ok, text, data, tokens_est, charged_usd, repo, ref}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"Function source from a GitHub repo — one symbol with its doc comment, by name. GET ?repo=&file=&symbol=","free":"none: the /x402 mirror always answers 402 until paid","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"}},"description":"One symbol's source (a function, struct, impl or method) from a file in a public git repository, with the doc comment above it: the function, not the file. `symbol` is a leaf name or the qualified path as sym ls lists it (`Type::method`, `impl Trait for Type`, `Type as Trait` are accepted). $0.005 per call. Query parameters: repo, ref, file, symbol. Docs: https://s2ar.dev/examples/read-the-function.html","tags":["sym"],"parameters":[{"name":"repo","in":"query","required":true,"schema":{"type":"string"},"description":"a public GitHub, GitLab or Codeberg repository: owner/repo, github.com/owner/repo or its https URL","example":"BurntSushi/ripgrep"},{"name":"ref","in":"query","required":false,"schema":{"type":"string"},"description":"branch, tag or commit; the default branch when omitted","example":"14.1.1"},{"name":"file","in":"query","required":true,"schema":{"type":"string"},"description":"path inside the repository","example":"crates/core/flags/defs.rs"},{"name":"symbol","in":"query","required":true,"schema":{"type":"string"},"description":"a name as sym ls lists it","example":"Glob as Flag"}]},"post":{"summary":"sym read","operationId":"read_post_x402","responses":{"200":{"description":"{ok, text, data, tokens_est, charged_usd, repo, ref}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"Function source from a GitHub repo — one symbol with its doc comment, by name. GET ?repo=&file=&symbol=","free":"none: the /x402 mirror always answers 402 until paid","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"}},"description":"One symbol's source (a function, struct, impl or method) from a file in a public git repository, with the doc comment above it: the function, not the file. `symbol` is a leaf name or the qualified path as sym ls lists it (`Type::method`, `impl Trait for Type`, `Type as Trait` are accepted). $0.005 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/read-the-function.html","tags":["sym"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"repo":{"type":"string","description":"a public GitHub, GitLab or Codeberg repository: owner/repo, github.com/owner/repo or its https URL","examples":["BurntSushi/ripgrep"]},"ref":{"type":"string","description":"branch, tag or commit; the default branch when omitted"},"file":{"type":"string","description":"path inside the repository"},"symbol":{"type":"string","description":"a name as sym ls lists it"}},"required":["repo","file","symbol"]},"example":{"repo":"BurntSushi/ripgrep","ref":"14.1.1","file":"crates/core/flags/defs.rs","symbol":"Glob as Flag"}}}}}},"/x402/v1/sym/ls":{"get":{"summary":"sym ls (GET)","operationId":"ls_get_x402","responses":{"200":{"description":"{ok, text, data, tokens_est, charged_usd, repo, ref}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"File skeleton from a GitHub repo — every function, type and method with line ranges, no bodies. GET ?repo=&file=","free":"none: the /x402 mirror always answers 402 until paid","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"}},"description":"The symbol skeleton of one file in a public git repository: what is defined where, with line ranges and signatures, without the bodies (tree-sitter; Rust, Python, TypeScript/TSX, JavaScript, Go, Lua, C, C++, Java, Ruby). Read this before reading the file. $0.005 per call. Query parameters: repo, ref, file. Docs: https://s2ar.dev/examples/read-the-function.html","tags":["sym"],"parameters":[{"name":"repo","in":"query","required":true,"schema":{"type":"string"},"description":"a public GitHub, GitLab or Codeberg repository: owner/repo, github.com/owner/repo or its https URL","example":"BurntSushi/ripgrep"},{"name":"ref","in":"query","required":false,"schema":{"type":"string"},"description":"branch, tag or commit; the default branch when omitted","example":"14.1.1"},{"name":"file","in":"query","required":true,"schema":{"type":"string"},"description":"path inside the repository","example":"crates/core/main.rs"}]},"post":{"summary":"sym ls","operationId":"ls_post_x402","responses":{"200":{"description":"{ok, text, data, tokens_est, charged_usd, repo, ref}","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required: x402 v1 body and v2 PAYMENT-REQUIRED header (USDC on Base), how_to_pay, the card packs; nothing is charged until the answer exists"}},"x-payment-info":{"intent":"charge","amount":"0.005","currency":"USD","description":"File skeleton from a GitHub repo — every function, type and method with line ranges, no bodies. GET ?repo=&file=","free":"none: the /x402 mirror always answers 402 until paid","protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005","unit":"per call"}},"description":"The symbol skeleton of one file in a public git repository: what is defined where, with line ranges and signatures, without the bodies (tree-sitter; Rust, Python, TypeScript/TSX, JavaScript, Go, Lua, C, C++, Java, Ruby). Read this before reading the file. $0.005 per call. JSON body; the same fields as the GET form. Docs: https://s2ar.dev/examples/read-the-function.html","tags":["sym"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"repo":{"type":"string","description":"a public GitHub, GitLab or Codeberg repository: owner/repo, github.com/owner/repo or its https URL","examples":["BurntSushi/ripgrep"]},"ref":{"type":"string","description":"branch, tag or commit; the default branch when omitted"},"file":{"type":"string","description":"path inside the repository"}},"required":["repo","file"]},"example":{"repo":"BurntSushi/ripgrep","ref":"14.1.1","file":"crates/core/main.rs"}}}}}}},"components":{"schemas":{"Body_app_compress_app_compress_post":{"properties":{"image":{"type":"string","contentMediaType":"application/octet-stream","title":"Image"}},"type":"object","required":["image"],"title":"Body_app_compress_app_compress_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PackBody":{"properties":{"usd":{"type":"number","title":"Usd","default":5.0}},"type":"object","title":"PackBody"},"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"}}}}