{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"Dollar Checker","version":"0.1.0","description":"Deterministic deliverable checks with objective defects, evidence, and repair instructions. This public pilot uses the Coinbase CDP Facilitator on Base Sepolia only; no mainnet, listing, uptime, customers, or earnings are claimed.","x-owner-contact":"Masen Bates — mailto:masen@serviceflow.space","x-service-terms":"https://earnest-creation-production-b041847a.up.railway.app/service-terms.md","x-deterministic-rules":["Strict UTF-8 JSON and duplicate-key rejection","JSON Schema Draft 2020-12 validation with remote references rejected","Required-section presence","Exact contiguous source-evidence spans","Decimal line-item and expected-total consistency","Duplicate sections, source IDs, line-item IDs, and content","Placeholder and forbidden-claim detection","Instruction-like prompt-injection detection without execution","HTTPS URL syntax and opt-in allowlisted reachability checks"],"x-scope-exclusions":["No subjective quality score or guarantee of acceptance","No external fact-checking beyond supplied sources","No URL availability claim unless reachability is explicitly enabled","No AI, LLM, code execution, legal review, or compliance certification"],"x-deployment-mode":"Railway Trial/Hobby; CDP Base Sepolia only; mainnet disabled"},"servers":[{"url":"https://earnest-creation-production-b041847a.up.railway.app","description":"Assigned Railway HTTPS endpoint for the CDP_BASE_SEPOLIA pilot; no uptime or listing claim"}],"tags":[{"name":"Health","description":"Public service health"},{"name":"Checks","description":"Paid deterministic deliverable checks"},{"name":"Samples","description":"Free fixed demonstration checks"},{"name":"Metrics","description":"Aggregate privacy-safe request counters"}],"paths":{"/v1/health":{"get":{"tags":["Health"],"operationId":"getHealth","summary":"Public marketplace-compatible health response","security":[],"responses":{"200":{"description":"Adapter and deterministic checker are reachable locally","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"},"example":{"status":"ok","service":"dollar-checker","checker_version":"1.0.0","checker_available":true,"payment_mode":"SIMULATED","simulated_payments":true,"testnet_payments_enabled":false,"real_payments_enabled":false,"network":"eip155:5042002","price":{"usd":"$1.00","amount":"1000000","asset":"USDC"},"payment_finality":"NONE_SIMULATED","live_payment_proof":false}}}},"503":{"description":"The checker upstream is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/sample":{"post":{"tags":["Samples"],"operationId":"runFixedSample","summary":"Run a free fixed PASS or known-defect demonstration","description":"No arbitrary deliverable is accepted. The adapter sends only a fixed demonstration input to the deterministic checker. The request is limited to 1024 bytes, 5 calls per minute per IP, and 30 calls per minute globally. Submitted content and IP addresses are not persisted.","security":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"scenario":{"type":"string","enum":["pass","defect"],"default":"pass"}}},"examples":{"pass":{"value":{"scenario":"pass"}},"defect":{"value":{"scenario":"defect"}}}}}},"responses":{"200":{"description":"Completed free demonstration; PASS and FAIL are both expected outcomes and no charge occurs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SampleResponse"},"examples":{"pass":{"$ref":"#/components/examples/SamplePass"},"defect":{"$ref":"#/components/examples/SampleDefect"}}}}},"400":{"description":"Invalid sample request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Sample request exceeds 1024 bytes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Per-IP or global sample rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The checker upstream is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/metrics":{"get":{"tags":["Metrics"],"operationId":"getRequestMetrics","summary":"Read aggregate request counters","description":"Counters are in-memory, reset on process restart, and contain no deliverable bodies, IP addresses, payment headers, or secret data. Paid-call attempts are not proof of payment or demand.","security":[],"responses":{"200":{"description":"Current process aggregate counters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestMetrics"},"example":{"process_started_at":"2026-11-22T00:00:00.000Z","captured_at":"2026-11-22T00:00:00.000Z","counters":{"sample_calls":0,"sample_pass":0,"sample_fail":0,"sample_invalid":0,"sample_rate_limited":0,"paid_route_requests":0,"paid_call_attempts":0,"health_checks":0,"discovery_crawl_requests":0},"storage":"Aggregate in-memory counters only; reset on process restart","definitions":{"paid_route_requests":"All POST /v1/check requests, including unpaid probes","paid_call_attempts":"POST /v1/check requests carrying a Payment-Signature header; not proof of payment or demand","discovery_crawl_requests":"GET requests for the x402 manifest or OpenAPI document"}}}}}}}},"/v1/check":{"post":{"tags":["Checks"],"operationId":"checkDeliverable","summary":"Run one deterministic check after exact upfront payment","description":"The target CDP configuration uses the x402 exact scheme with upfront settlement on Base Sepolia. Successful CDP settlement precedes checker execution. PASS and FAIL are both completed, chargeable checks under the live terms.","security":[],"x-circle-payment":{"protocol":"x402","x402_version":2,"circle_rail":"Coinbase CDP Facilitator","scheme":"exact","flow":"upfront","price_usd":"1.00","amount_atomic":"1000000","asset":"USDC","network":"eip155:84532","testnet_only":true,"mainnet_enabled":false,"live_payment_proof":false,"simulated":false,"asset_address_base_sepolia":"0x036CbD53842c5426634e7929541eC2318f3dCF7e"},"parameters":[{"name":"Payment-Signature","in":"header","required":false,"description":"x402 v2 payment obtained after the initial 402. Never log this signed value.","schema":{"type":"string","maxLength":16384}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional 1-128 character request key. Reuse only with the identical body and original payment.","schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckRequest"},"examples":{"pass":{"$ref":"#/components/requestBodies/CheckBody/content/application~1json/examples/pass"},"fail":{"$ref":"#/components/requestBodies/CheckBody/content/application~1json/examples/fail"}}}}},"responses":{"200":{"description":"A completed PASS or FAIL verdict. Both are chargeable after live settlement.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckResponse"},"examples":{"pass":{"summary":"CDP Base Sepolia PASS example; not payment proof","value":{"verdict":"PASS","defects":[],"evidence":[{"rule":"EXACT_SPAN_EVIDENCE","status":"PASS","detail":{"span_count":1}},{"rule":"ARITHMETIC","status":"PASS","detail":{"calculated_total":"2.50","expected_total":"2.50"}},{"rule":"DUPLICATE_CONTENT","status":"PASS","detail":{}},{"rule":"CONTENT_RULES","status":"PASS","detail":{}},{"rule":"URL_CHECKS","status":"PASS","detail":{"reachability_enabled":false,"results":[]}}],"processing_duration_seconds":0.001,"checker_version":"1.0.0","check_id":"chk_cdp_pass_example","checked":true,"payment":{"state":"FACILITATOR_COMPLETED","simulated":false,"charged":true,"real_payment":false,"usd_price":"$1.00","amount":"1000000","currency":"USDC","asset":"0x036CbD53842c5426634e7929541eC2318f3dCF7e","network":"eip155:84532","payer":"0x1111111111111111111111111111111111111111","pay_to":"0x124dd23De3a91f7271ab3Ce54F36B9ed69469CB0","transaction":"0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc","payment_id":"pay_cdp_pass_example","nonce":"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","finality":"CDP_FACILITATOR_COMPLETED_REORG_RISK","settlement_attempts":1},"settlement_evidence":{"accepted_us":1,"handler_started_us":2,"handler_completed_us":3,"settlement_precedes_handler":true,"evidence_type":"CDP_FACILITATOR_SETTLE_SUCCESS","final_onchain_confirmation":false},"replayed":false}},"fail":{"summary":"CDP Base Sepolia FAIL example; not payment proof","value":{"verdict":"FAIL","defects":[{"rule":"REQUIRED_SECTION_MISSING","evidence":{"section":"Missing"},"repair":"Add the required section 'Missing'."}],"evidence":[{"rule":"REQUIRED_SECTIONS","status":"FAIL","detail":{"actual_sections":["Summary"]}},{"rule":"EXACT_SPAN_EVIDENCE","status":"PASS","detail":{"span_count":1}},{"rule":"ARITHMETIC","status":"PASS","detail":{"calculated_total":"2.50","expected_total":"2.50"}},{"rule":"DUPLICATE_CONTENT","status":"PASS","detail":{}},{"rule":"CONTENT_RULES","status":"PASS","detail":{}},{"rule":"URL_CHECKS","status":"PASS","detail":{"reachability_enabled":false,"results":[]}}],"processing_duration_seconds":0.001,"checker_version":"1.0.0","check_id":"chk_cdp_fail_example","checked":true,"payment":{"state":"FACILITATOR_COMPLETED","simulated":false,"charged":true,"real_payment":false,"usd_price":"$1.00","amount":"1000000","currency":"USDC","asset":"0x036CbD53842c5426634e7929541eC2318f3dCF7e","network":"eip155:84532","payer":"0x1111111111111111111111111111111111111111","pay_to":"0x124dd23De3a91f7271ab3Ce54F36B9ed69469CB0","transaction":"0xdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd","payment_id":"pay_cdp_fail_example","nonce":"0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","finality":"CDP_FACILITATOR_COMPLETED_REORG_RISK","settlement_attempts":1},"settlement_evidence":{"accepted_us":4,"handler_started_us":5,"handler_completed_us":6,"settlement_precedes_handler":true,"evidence_type":"CDP_FACILITATOR_SETTLE_SUCCESS","final_onchain_confirmation":false},"replayed":false}}}}}},"400":{"description":"Invalid request or malformed payment header; no checker evaluation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Payment required, invalid, or not settled; no checker evaluation","headers":{"PAYMENT-REQUIRED":{"description":"Base64 x402 v2 payment requirements on an unpaid response","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Replay, idempotency, or reconciliation conflict; no additional settlement or delivery","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Request exceeds 262,144 bytes; no payment processing or evaluation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Settlement or delivery is unresolved; reconcile the original payment without a replacement authorization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-circle-payment-rails":[{"circle_rail":"Coinbase CDP Facilitator","scheme":"exact","flow":"upfront","amount_atomic":"1000000","network":"eip155:84532","asset_address":"0x036CbD53842c5426634e7929541eC2318f3dCF7e","recipient":"0x124dd23De3a91f7271ab3Ce54F36B9ed69469CB0","maxTimeoutSeconds":300,"testnet_only":true,"mainnet_enabled":false}]}}},"components":{"examples":{"SamplePass":{"value":{"verdict":"PASS","defects":[],"evidence":[{"rule":"REQUIRED_SECTIONS","status":"PASS","detail":{"actual_sections":["Summary"]}}],"processing_duration_seconds":0.001,"checker_version":"1.0.0","check_id":"chk_sample_pass","checked":true,"payment":{"state":"FREE_SAMPLE","simulated":false,"charged":false,"real_payment":false,"amount":"0","currency":"USDC","network":"eip155:5042002"},"replayed":false,"free_sample":true,"scenario":"pass"}},"SampleDefect":{"value":{"verdict":"FAIL","defects":[{"rule":"REQUIRED_SECTION_MISSING","evidence":{"section":"Missing"},"repair":"Add the required section 'Missing'."}],"evidence":[{"rule":"REQUIRED_SECTIONS","status":"FAIL","detail":{"actual_sections":["Summary"],"required_sections":["Missing"]}}],"processing_duration_seconds":0.001,"checker_version":"1.0.0","check_id":"chk_sample_defect","checked":true,"payment":{"state":"FREE_SAMPLE","simulated":false,"charged":false,"real_payment":false,"amount":"0","currency":"USDC","network":"eip155:5042002"},"replayed":false,"free_sample":true,"scenario":"defect"}}},"requestBodies":{"CheckBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckRequest"},"examples":{"pass":{"value":{"deliverable_format":"text","deliverable":"# Summary\nThe measured total is 2.50.","required_sections":["Summary"],"source_text":"Source states the measured total is 2.50.","evidence_spans":["measured total is 2.50"],"line_items":[{"id":"a","amount":"1.25"},{"id":"b","amount":"1.25"}],"expected_total":"2.50","urls":[],"acceptance_rules":{"check_urls":false,"allowed_hosts":[]}}},"fail":{"value":{"deliverable_format":"text","deliverable":"# Summary\nThe measured total is 2.50.","required_sections":["Missing"],"source_text":"Source states the measured total is 2.50.","evidence_spans":["measured total is 2.50"],"line_items":[{"id":"a","amount":"1.25"},{"id":"b","amount":"1.25"}],"expected_total":"2.50","urls":[],"acceptance_rules":{"check_urls":false,"allowed_hosts":[]}}}}}}}},"schemas":{"CheckRequest":{"type":"object","required":["deliverable"],"properties":{"deliverable_format":{"type":"string","enum":["text","json"],"default":"text"},"deliverable":{"description":"Text or structured JSON deliverable"},"schema":{"type":["object","null"],"description":"Local JSON Schema Draft 2020-12; remote references are rejected"},"required_sections":{"type":["array","null"],"maxItems":50,"items":{"type":"string"}},"source_text":{"type":"string"},"sources":{"oneOf":[{"type":"array","items":{"type":"object","required":["id","text"],"properties":{"id":{"type":"string"},"text":{"type":"string"}}}},{"type":"object","additionalProperties":{"type":"string"}}]},"evidence_spans":{"type":"array","maxItems":100,"items":{"oneOf":[{"type":"string"},{"type":"object","required":["source_id","span"],"properties":{"source_id":{"type":"string"},"span":{"type":"string"}}}]}},"evidence":{"type":"array","items":{"type":"object","required":["source_id","span"],"properties":{"source_id":{"type":"string"},"span":{"type":"string"}}}},"line_items":{"type":"array","maxItems":1000,"items":{"type":"object","required":["id","amount"],"properties":{"id":{"type":"string"},"amount":{"oneOf":[{"type":"string"},{"type":"number"}]}}}},"expected_total":{"oneOf":[{"type":"string"},{"type":"number"}]},"urls":{"type":"array","maxItems":5,"items":{"type":"string","format":"uri"}},"acceptance_rules":{"type":"object","properties":{"check_urls":{"type":"boolean","default":false},"allowed_hosts":{"type":"array","items":{"type":"string"}},"placeholders":{"type":"array","items":{"type":"string"}},"forbidden_claims":{"type":"array","items":{"type":"string"}}}}}},"Defect":{"type":"object","required":["rule","evidence","repair"],"properties":{"rule":{"type":"string"},"evidence":{"type":"object"},"repair":{"type":"string"}}},"RuleEvidence":{"type":"object","required":["rule","status","detail"],"properties":{"rule":{"type":"string"},"status":{"type":"string","enum":["PASS","FAIL"]},"detail":{"type":"object"}}},"PaymentEvidence":{"type":"object","required":["state","simulated","charged","real_payment","usd_price","amount","currency","asset","network","payer","pay_to","transaction","payment_id","nonce","finality","settlement_attempts"],"properties":{"state":{"type":"string","enum":["FACILITATOR_COMPLETED"]},"simulated":{"type":"boolean"},"charged":{"type":"boolean"},"real_payment":{"type":"boolean","const":false},"usd_price":{"const":"$1.00"},"amount":{"const":"1000000"},"currency":{"const":"USDC"},"asset":{"const":"0x036CbD53842c5426634e7929541eC2318f3dCF7e"},"network":{"const":"eip155:84532"},"payer":{"type":"string"},"pay_to":{"type":"string"},"transaction":{"type":["string","null"]},"payment_id":{"type":"string"},"nonce":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"finality":{"type":"string","enum":["CDP_FACILITATOR_COMPLETED_REORG_RISK"]},"settlement_attempts":{"type":"integer","minimum":1}}},"SettlementEvidence":{"type":"object","required":["accepted_us","handler_started_us","handler_completed_us","settlement_precedes_handler","evidence_type","final_onchain_confirmation"],"properties":{"accepted_us":{"type":"integer"},"handler_started_us":{"type":"integer"},"handler_completed_us":{"type":"integer"},"settlement_precedes_handler":{"const":true},"evidence_type":{"type":"string","enum":["SIMULATED_NO_VALUE","CIRCLE_GATEWAY_SETTLE_SUCCESS"]},"final_onchain_confirmation":{"const":false}}},"CheckResponse":{"type":"object","required":["verdict","defects","evidence","processing_duration_seconds","checker_version","check_id","checked","payment","replayed","settlement_evidence"],"properties":{"verdict":{"type":"string","enum":["PASS","FAIL"]},"defects":{"type":"array","items":{"$ref":"#/components/schemas/Defect"}},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/RuleEvidence"}},"processing_duration_seconds":{"type":"number","minimum":0},"checker_version":{"type":"string"},"check_id":{"type":"string"},"checked":{"const":true},"payment":{"$ref":"#/components/schemas/PaymentEvidence"},"replayed":{"type":"boolean"},"settlement_evidence":{"$ref":"#/components/schemas/SettlementEvidence"}}},"SampleResponse":{"type":"object","required":["verdict","defects","evidence","processing_duration_seconds","checker_version","check_id","checked","payment","replayed","free_sample","scenario"],"properties":{"verdict":{"type":"string","enum":["PASS","FAIL"]},"defects":{"type":"array","items":{"$ref":"#/components/schemas/Defect"}},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/RuleEvidence"}},"processing_duration_seconds":{"type":"number","minimum":0},"checker_version":{"type":"string"},"check_id":{"type":"string"},"checked":{"const":true},"payment":{"type":"object","required":["state","simulated","charged","real_payment","amount","currency","network"],"properties":{"state":{"const":"FREE_SAMPLE"},"simulated":{"const":false},"charged":{"const":false},"real_payment":{"const":false},"amount":{"const":"0"},"currency":{"const":"USDC"},"network":{"type":"string"}}},"replayed":{"const":false},"free_sample":{"const":true},"scenario":{"type":"string","enum":["pass","defect"]}}},"RequestMetrics":{"type":"object","required":["process_started_at","captured_at","counters","storage","definitions"],"properties":{"process_started_at":{"type":"string"},"captured_at":{"type":"string"},"counters":{"type":"object","required":["sample_calls","sample_pass","sample_fail","sample_invalid","sample_rate_limited","paid_route_requests","paid_call_attempts","health_checks","discovery_crawl_requests"],"properties":{"sample_calls":{"type":"integer","minimum":0},"sample_pass":{"type":"integer","minimum":0},"sample_fail":{"type":"integer","minimum":0},"sample_invalid":{"type":"integer","minimum":0},"sample_rate_limited":{"type":"integer","minimum":0},"paid_route_requests":{"type":"integer","minimum":0},"paid_call_attempts":{"type":"integer","minimum":0},"health_checks":{"type":"integer","minimum":0},"discovery_crawl_requests":{"type":"integer","minimum":0}}},"storage":{"type":"string"},"definitions":{"type":"object"}}},"HealthResponse":{"type":"object","required":["status","service","checker_version","checker_available","payment_mode","simulated_payments","testnet_payments_enabled","real_payments_enabled","network","price","payment_finality","live_payment_proof"],"properties":{"status":{"const":"ok"},"service":{"const":"dollar-checker"},"checker_version":{"type":"string"},"checker_available":{"const":true},"payment_mode":{"type":"string","enum":["SIMULATED","ARC_TESTNET"]},"simulated_payments":{"type":"boolean"},"testnet_payments_enabled":{"type":"boolean"},"real_payments_enabled":{"const":false},"network":{"const":"eip155:5042002"},"price":{"type":"object","required":["usd","amount","asset"],"properties":{"usd":{"const":"$1.00"},"amount":{"const":"1000000"},"asset":{"const":"USDC"}}},"payment_finality":{"type":"string"},"live_payment_proof":{"const":false}}},"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"status":{"type":"string"},"checked":{"type":"boolean"},"charged":{"type":["boolean","null"]},"checker_available":{"type":"boolean"},"payment_id":{"type":"string"},"nonce":{"type":"string"},"repair":{"type":"string"},"payment":{"type":"object"}}}}}}