{"openapi":"3.1.0","info":{"title":"Grant Compliance API","version":"1.0.0","description":"Read supplied grant guidelines, application text, budgets, and evidence. Requirements, eligibility, totals, and reporting gaps are checked only against rules and documents in the request. Nothing is marked officially approved or compliant. Paid with x402 exact USDC on Base. No account is required.","contact":{"email":"support@brainiac.software"},"x-guidance":"BRAINIAC.software is a pay-per-call API for software agents. No account or API key is required.\nPayment uses the x402 protocol with exact USDC on Base (chain id 8453). Each POST operation has a fixed USD price.\nHow to call an operation:\n1. POST a JSON body matching the operation's requestBody schema to the operation path. Include an Idempotency-Key header (64 hex characters, 32 random bytes).\n2. If you have not paid, the server responds 402 with payment requirements in the body. Pay the exact amount to the payTo address on Base.\n3. Retry the identical request with the same Idempotency-Key and add a payment-signature header containing the x402 payment payload. On success (200) the operation result is returned.\n4. Reuse the same Idempotency-Key only for retries of the same operation and request body; it will not be charged twice.\nAll outputs are compliance prechecks, drafts, or data lookups for human review. They are not official determinations, legal advice, identity confirmation, or certified filings. Verify time-sensitive or official data with the cited source before acting."},"servers":[{"url":"https://www.brainiac.software"}],"paths":{"/api/v1/grant-compliance/requirements-extract":{"post":{"operationId":"extract_grant_requirements","summary":"Extract grant requirements","description":"Read Requirement lines and structured requirements. Other prose is not turned into a grant rule.","tags":["grant-compliance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"guidelines":{"type":"string","minLength":1,"maxLength":50000},"requirements":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}}},"additionalProperties":false},"example":{"guidelines":"Requirement: R1 | The applicant must be a registered charity.\nRequirement: R2 | The project must serve London.\nApplicants should consider a strong title.\n"}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"officialApproval":{"type":"boolean"},"complianceDetermined":{"type":"boolean"},"status":{"type":"string"},"requirements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"source":{"type":"string"}},"additionalProperties":true}},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-02T19:00:00.000Z","officialApproval":false,"complianceDetermined":false,"status":"extracted","requirements":[{"id":"R1","text":"The applicant must be a registered charity.","source":"guidelines"},{"id":"R2","text":"The project must serve London.","source":"guidelines"}],"findings":[],"limitations":["This is not an official approval, and compliance was not determined.","Rules, eligibility criteria, budgets, and evidence are used only when they are supplied in the request.","Labeled lines are read as written. Unlabeled prose is not turned into a grant rule.","A matching evidence id does not judge whether the evidence is sufficient."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/grant-compliance/eligibility-check":{"post":{"operationId":"check_supplied_eligibility_rules","summary":"Check supplied eligibility rules","description":"Compare each supplied rule with the supplied fact of the same name. A match is not an approval, and missing facts are not filled in.","tags":["grant-compliance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rules":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"fact":{"type":"string","minLength":1,"maxLength":80},"operator":{"type":"string","enum":["equals","includes","number_at_least","number_at_most","boolean_is"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["id","fact","operator","value"],"additionalProperties":false}},"facts":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"value":{"type":"string","minLength":1,"maxLength":500}},"required":["name","value"],"additionalProperties":false}}},"required":["rules"],"additionalProperties":false},"example":{"rules":[{"id":"org","fact":"organisationType","operator":"equals","value":"charity"},{"id":"years","fact":"yearsOperating","operator":"number_at_least","value":"2"}],"facts":[{"name":"organisationType","value":"charity"},{"name":"yearsOperating","value":"1"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"officialApproval":{"type":"boolean"},"complianceDetermined":{"type":"boolean"},"status":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fact":{"type":"string"},"operator":{"type":"string"},"value":{"type":"string"},"factValue":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"findings":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-02T19:00:00.000Z","officialApproval":false,"complianceDetermined":false,"status":"not_met","results":[{"id":"org","fact":"organisationType","operator":"equals","value":"charity","factValue":"charity","status":"met","detail":"The supplied fact matches the supplied value. This is not an approval."},{"id":"years","fact":"yearsOperating","operator":"number_at_least","value":"2","factValue":"1","status":"not_met","detail":"The supplied number does not meet the supplied comparison."}],"findings":[{"kind":"observed","code":"rules_only","detail":"Each rule was supplied in the request. No eligibility criterion was added."}],"limitations":["This is not an official approval, and compliance was not determined.","Rules, eligibility criteria, budgets, and evidence are used only when they are supplied in the request.","Labeled lines are read as written. Unlabeled prose is not turned into a grant rule.","A matching evidence id does not judge whether the evidence is sufficient."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/grant-compliance/application-completeness":{"post":{"operationId":"check_application_completeness","summary":"Check application completeness","description":"Mark a requirement present only when an application section cites its id. The answer is not scored, and a complete set is not compliance.","tags":["grant-compliance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"guidelines":{"type":"string","minLength":1,"maxLength":50000},"requirements":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}},"applicationText":{"type":"string","minLength":1,"maxLength":50000},"sections":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"requirementId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":20000}},"required":["requirementId","text"],"additionalProperties":false}}},"additionalProperties":false},"example":{"requirements":[{"id":"R1","text":"The applicant must be a registered charity."},{"id":"R2","text":"The project must serve London."}],"sections":[{"requirementId":"R1","text":"We are a registered charity."}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"officialApproval":{"type":"boolean"},"complianceDetermined":{"type":"boolean"},"status":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-02T19:00:00.000Z","officialApproval":false,"complianceDetermined":false,"status":"incomplete","items":[{"id":"R1","text":"The applicant must be a registered charity.","status":"present","detail":"An application section cited this requirement id. The answer was not scored."},{"id":"R2","text":"The project must serve London.","status":"missing","detail":"No application section cited this requirement id."}],"findings":[],"limitations":["This is not an official approval, and compliance was not determined.","Rules, eligibility criteria, budgets, and evidence are used only when they are supplied in the request.","Labeled lines are read as written. Unlabeled prose is not turned into a grant rule.","A matching evidence id does not judge whether the evidence is sufficient."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/grant-compliance/budget-validate":{"post":{"operationId":"validate_a_grant_budget","summary":"Validate a grant budget","description":"Sum the supplied lines, compare that sum with a supplied total, and check supplied category amount or percent caps. No cap is assumed.","tags":["grant-compliance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Za-z]{3}$"},"lines":{"minItems":1,"maxItems":80,"type":"array","items":{"type":"object","properties":{"category":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","minLength":1,"maxLength":200},"amount":{"type":"number","minimum":0,"maximum":1000000000000}},"required":["category","description","amount"],"additionalProperties":false}},"total":{"type":"number","minimum":0,"maximum":1000000000000},"limits":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"category":{"type":"string","minLength":1,"maxLength":80},"maxAmount":{"type":"number","minimum":0,"maximum":1000000000000},"maxPercent":{"type":"number","minimum":0,"maximum":100}},"required":["category"],"additionalProperties":false}}},"required":["lines"],"additionalProperties":false},"example":{"currency":"GBP","lines":[{"category":"staff","description":"Coordinator","amount":4000},{"category":"equipment","description":"Laptop","amount":1000}],"total":5000,"limits":[{"category":"staff","maxPercent":40}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"officialApproval":{"type":"boolean"},"complianceDetermined":{"type":"boolean"},"status":{"type":"string"},"currency":{"type":"string"},"calculatedTotal":{"type":"number"},"statedTotal":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"description":{"type":"string"},"amount":{"type":"number"}},"additionalProperties":true}},"limits":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"spent":{"type":"number"},"maxAmount":{"type":"null"},"maxPercent":{"type":"number"},"percent":{"type":"number"},"status":{"type":"string"}},"additionalProperties":true}},"findings":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-02T19:00:00.000Z","officialApproval":false,"complianceDetermined":false,"status":"inconsistent","currency":"GBP","calculatedTotal":5000,"statedTotal":5000,"lines":[{"category":"staff","description":"Coordinator","amount":4000},{"category":"equipment","description":"Laptop","amount":1000}],"limits":[{"category":"staff","spent":4000,"maxAmount":null,"maxPercent":40,"percent":80,"status":"over_limit"}],"findings":[{"kind":"observed","code":"total_matches","detail":"The line amounts sum to 5000, which matches the supplied total."},{"kind":"conflict","code":"category_over_limit","detail":"staff spent 4000, 80 percent of 5000. The supplied limit was not met. This is not a funding decision."}],"limitations":["This is not an official approval, and compliance was not determined.","Rules, eligibility criteria, budgets, and evidence are used only when they are supplied in the request.","Labeled lines are read as written. Unlabeled prose is not turned into a grant rule.","A matching evidence id does not judge whether the evidence is sufficient."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}]}}},"/api/v1/grant-compliance/expense-eligibility-check":{"post":{"operationId":"check_expenses_against_supplied_rules","summary":"Check expenses against supplied rules","description":"Apply only the supplied category decisions. A category with no rule stays not supplied, and an eligible rule is not a funder decision.","tags":["grant-compliance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"expenses":{"minItems":1,"maxItems":80,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","minLength":1,"maxLength":200},"category":{"type":"string","minLength":1,"maxLength":80},"amount":{"type":"number","minimum":0,"maximum":1000000000000}},"required":["id","description","category","amount"],"additionalProperties":false}},"rules":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"category":{"type":"string","minLength":1,"maxLength":80},"decision":{"type":"string","enum":["eligible","ineligible"]}},"required":["category","decision"],"additionalProperties":false}}},"required":["expenses","rules"],"additionalProperties":false},"example":{"expenses":[{"id":"E1","description":"Coordinator salary","category":"staff","amount":4000},{"id":"E2","description":"Alcohol for launch","category":"hospitality","amount":200}],"rules":[{"category":"staff","decision":"eligible"},{"category":"hospitality","decision":"ineligible"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"officialApproval":{"type":"boolean"},"complianceDetermined":{"type":"boolean"},"status":{"type":"string"},"expenses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"amount":{"type":"number"},"status":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"findings":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-02T19:00:00.000Z","officialApproval":false,"complianceDetermined":false,"status":"excluded_by_rule","expenses":[{"id":"E1","description":"Coordinator salary","category":"staff","amount":4000,"status":"matches_rule","detail":"A supplied rule says this category is eligible. This is not a funder decision."},{"id":"E2","description":"Alcohol for launch","category":"hospitality","amount":200,"status":"excluded_by_rule","detail":"A supplied rule says this category is ineligible. This is not a funder decision."}],"findings":[{"kind":"observed","code":"expense_rules_only","detail":"An expense is excluded only when a supplied rule says that category is ineligible. Other categories stay not supplied."}],"limitations":["This is not an official approval, and compliance was not determined.","Rules, eligibility criteria, budgets, and evidence are used only when they are supplied in the request.","Labeled lines are read as written. Unlabeled prose is not turned into a grant rule.","A matching evidence id does not judge whether the evidence is sufficient."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/grant-compliance/evidence-match":{"post":{"operationId":"match_evidence_to_requirements","summary":"Match evidence to requirements","description":"Attach evidence that cites a requirement id. Evidence with no id is not matched, and the strength of the evidence is not judged.","tags":["grant-compliance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"requirements":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}},"evidence":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"requirementId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":20000}},"required":["id","text"],"additionalProperties":false}}},"required":["requirements"],"additionalProperties":false},"example":{"requirements":[{"id":"R1","text":"The applicant must be a registered charity."},{"id":"R2","text":"The project must serve London."}],"evidence":[{"id":"EV1","requirementId":"R1","text":"Charity Commission number 1234567."}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"officialApproval":{"type":"boolean"},"complianceDetermined":{"type":"boolean"},"status":{"type":"string"},"requirements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"status":{"type":"string"},"evidenceIds":{"type":"array","items":{"type":"string"}}},"additionalProperties":true}},"findings":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-02T19:00:00.000Z","officialApproval":false,"complianceDetermined":false,"status":"incomplete","requirements":[{"id":"R1","text":"The applicant must be a registered charity.","status":"matched","evidenceIds":["EV1"]},{"id":"R2","text":"The project must serve London.","status":"missing","evidenceIds":[]}],"findings":[{"kind":"observed","code":"evidence_by_id","detail":"Evidence matches a requirement only when it cites that requirement id. The text was not judged."}],"limitations":["This is not an official approval, and compliance was not determined.","Rules, eligibility criteria, budgets, and evidence are used only when they are supplied in the request.","Labeled lines are read as written. Unlabeled prose is not turned into a grant rule.","A matching evidence id does not judge whether the evidence is sufficient."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}]}}},"/api/v1/grant-compliance/deliverable-track":{"post":{"operationId":"track_supplied_deliverables","summary":"Track supplied deliverables","description":"Repeat the status supplied for each deliverable and compare an update date with a supplied due date. accepted_by_caller is not an official acceptance.","tags":["grant-compliance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deliverables":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"name":{"type":"string","minLength":1,"maxLength":200},"dueDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["id","name"],"additionalProperties":false}},"updates":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"deliverableId":{"type":"string","minLength":1,"maxLength":80},"status":{"type":"string","enum":["not_started","in_progress","submitted","accepted_by_caller"]},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"note":{"type":"string","minLength":1,"maxLength":2000}},"required":["deliverableId","status"],"additionalProperties":false}}},"required":["deliverables"],"additionalProperties":false},"example":{"deliverables":[{"id":"D1","name":"Workshop series","dueDate":"2026-12-01"},{"id":"D2","name":"Evaluation note","dueDate":"2027-01-15"}],"updates":[{"deliverableId":"D1","status":"submitted","date":"2026-12-20","note":"Workshops delivered."}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"officialApproval":{"type":"boolean"},"complianceDetermined":{"type":"boolean"},"status":{"type":"string"},"deliverables":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"dueDate":{"type":"string"},"status":{"type":"string"},"updateDate":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"findings":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-02T19:00:00.000Z","officialApproval":false,"complianceDetermined":false,"status":"incomplete","deliverables":[{"id":"D1","name":"Workshop series","dueDate":"2026-12-01","status":"submitted","updateDate":"2026-12-20","detail":"The supplied update says submitted."},{"id":"D2","name":"Evaluation note","dueDate":"2027-01-15","status":"not_supplied","updateDate":"","detail":"No update was supplied for this deliverable."}],"findings":[{"kind":"observed","code":"caller_updates","detail":"Deliverable status comes only from the supplied updates. accepted_by_caller is not an official acceptance."},{"kind":"observed","code":"late_against_supplied_date","detail":"D1 has update date 2026-12-20 after the supplied due date 2026-12-01. No penalty was decided."}],"limitations":["This is not an official approval, and compliance was not determined.","Rules, eligibility criteria, budgets, and evidence are used only when they are supplied in the request.","Labeled lines are read as written. Unlabeled prose is not turned into a grant rule.","A matching evidence id does not judge whether the evidence is sufficient."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{}}]}}},"/api/v1/grant-compliance/report-validate":{"post":{"operationId":"validate_a_grant_report","summary":"Validate a grant report","description":"Mark a reporting obligation present only when the report cites its id. A present section is not accepted by a funder.","tags":["grant-compliance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"guidelines":{"type":"string","minLength":1,"maxLength":50000},"obligations":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}},"reportText":{"type":"string","minLength":1,"maxLength":50000},"reportSections":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"obligationId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":20000}},"required":["obligationId","text"],"additionalProperties":false}}},"additionalProperties":false},"example":{"obligations":[{"id":"REP1","text":"State the number of participants."},{"id":"REP2","text":"Attach the budget variance."}],"reportSections":[{"obligationId":"REP1","text":"120 participants attended."}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"officialApproval":{"type":"boolean"},"complianceDetermined":{"type":"boolean"},"status":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-02T19:00:00.000Z","officialApproval":false,"complianceDetermined":false,"status":"incomplete","items":[{"id":"REP1","text":"State the number of participants.","status":"present","detail":"The report cites this obligation id. The answer was not accepted."},{"id":"REP2","text":"Attach the budget variance.","status":"missing","detail":"The report has no section citing this obligation id."}],"findings":[],"limitations":["This is not an official approval, and compliance was not determined.","Rules, eligibility criteria, budgets, and evidence are used only when they are supplied in the request.","Labeled lines are read as written. Unlabeled prose is not turned into a grant rule.","A matching evidence id does not judge whether the evidence is sufficient."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/grant-compliance/deadline-extract":{"post":{"operationId":"extract_grant_deadlines","summary":"Extract grant deadlines","description":"Read Deadline lines that contain a YYYY-MM-DD date. Other dates in the guidelines are not turned into deadlines.","tags":["grant-compliance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"guidelines":{"type":"string","minLength":1,"maxLength":50000}},"required":["guidelines"],"additionalProperties":false},"example":{"guidelines":"Deadline: application | 2026-06-30 | Application closes\nDeadline: report | 2027-03-31 | Final report is due\nThe narrative mentions 1 January 2020 in passing.\n"}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"officialApproval":{"type":"boolean"},"complianceDetermined":{"type":"boolean"},"status":{"type":"string"},"deadlines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-02T19:00:00.000Z","officialApproval":false,"complianceDetermined":false,"status":"extracted","deadlines":[{"id":"application","date":"2026-06-30","detail":"Application closes"},{"id":"report","date":"2027-03-31","detail":"Final report is due"}],"findings":[],"limitations":["This is not an official approval, and compliance was not determined.","Rules, eligibility criteria, budgets, and evidence are used only when they are supplied in the request.","Labeled lines are read as written. Unlabeled prose is not turned into a grant rule.","A matching evidence id does not judge whether the evidence is sufficient."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{}}]}}},"/api/v1/grant-compliance/report":{"post":{"operationId":"prepare_a_grant_compliance_report","summary":"Prepare a grant compliance report","description":"Combine the supplied requirement, eligibility, budget, evidence, deliverable, and reporting checks. The report does not approve the application or determine compliance.","tags":["grant-compliance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"guidelines":{"type":"string","minLength":1,"maxLength":50000},"requirements":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}},"rules":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"fact":{"type":"string","minLength":1,"maxLength":80},"operator":{"type":"string","enum":["equals","includes","number_at_least","number_at_most","boolean_is"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["id","fact","operator","value"],"additionalProperties":false}},"facts":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"value":{"type":"string","minLength":1,"maxLength":500}},"required":["name","value"],"additionalProperties":false}},"applicationText":{"type":"string","minLength":1,"maxLength":50000},"sections":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"requirementId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":20000}},"required":["requirementId","text"],"additionalProperties":false}},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$"},"lines":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"category":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","minLength":1,"maxLength":200},"amount":{"type":"number","minimum":0,"maximum":1000000000000}},"required":["category","description","amount"],"additionalProperties":false}},"total":{"type":"number","minimum":0,"maximum":1000000000000},"limits":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"category":{"type":"string","minLength":1,"maxLength":80},"maxAmount":{"type":"number","minimum":0,"maximum":1000000000000},"maxPercent":{"type":"number","minimum":0,"maximum":100}},"required":["category"],"additionalProperties":false}},"expenses":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","minLength":1,"maxLength":200},"category":{"type":"string","minLength":1,"maxLength":80},"amount":{"type":"number","minimum":0,"maximum":1000000000000}},"required":["id","description","category","amount"],"additionalProperties":false}},"expenseRules":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"category":{"type":"string","minLength":1,"maxLength":80},"decision":{"type":"string","enum":["eligible","ineligible"]}},"required":["category","decision"],"additionalProperties":false}},"evidence":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"requirementId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":20000}},"required":["id","text"],"additionalProperties":false}},"deliverables":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"name":{"type":"string","minLength":1,"maxLength":200},"dueDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["id","name"],"additionalProperties":false}},"updates":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"deliverableId":{"type":"string","minLength":1,"maxLength":80},"status":{"type":"string","enum":["not_started","in_progress","submitted","accepted_by_caller"]},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"note":{"type":"string","minLength":1,"maxLength":2000}},"required":["deliverableId","status"],"additionalProperties":false}},"obligations":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}},"reportText":{"type":"string","minLength":1,"maxLength":50000},"reportSections":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"obligationId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":20000}},"required":["obligationId","text"],"additionalProperties":false}}},"additionalProperties":false},"example":{"guidelines":"Requirement: R1 | The applicant must be a registered charity.\nRequirement: R2 | The project must serve London.\nDeadline: application | 2026-06-30 | Application closes\nReporting: REP1 | State the number of participants.\nReporting: REP2 | Attach the budget variance.\nApplicants should consider a strong title.\nThe narrative mentions 1 January 2020 in passing.\n","rules":[{"id":"org","fact":"organisationType","operator":"equals","value":"charity"},{"id":"years","fact":"yearsOperating","operator":"number_at_least","value":"2"}],"facts":[{"name":"organisationType","value":"charity"},{"name":"yearsOperating","value":"1"}],"sections":[{"requirementId":"R1","text":"We are a registered charity."}],"currency":"GBP","lines":[{"category":"staff","description":"Coordinator","amount":4000},{"category":"equipment","description":"Laptop","amount":1000}],"total":5000,"limits":[{"category":"staff","maxPercent":40}],"expenses":[{"id":"E1","description":"Coordinator salary","category":"staff","amount":4000},{"id":"E2","description":"Alcohol for launch","category":"hospitality","amount":200}],"expenseRules":[{"category":"staff","decision":"eligible"},{"category":"hospitality","decision":"ineligible"}],"evidence":[{"id":"EV1","requirementId":"R1","text":"Charity Commission number 1234567."}],"deliverables":[{"id":"D1","name":"Workshop series","dueDate":"2026-12-01"},{"id":"D2","name":"Evaluation note","dueDate":"2027-01-15"}],"updates":[{"deliverableId":"D1","status":"submitted","date":"2026-12-20","note":"Workshops delivered."}],"reportSections":[{"obligationId":"REP1","text":"120 participants attended."}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"officialApproval":{"type":"boolean"},"complianceDetermined":{"type":"boolean"},"summary":{"type":"string"},"requirements":{"type":"object","properties":{"status":{"type":"string"},"count":{"type":"number"}},"additionalProperties":true},"eligibility":{"type":"object","properties":{"status":{"type":"string"},"met":{"type":"number"},"notMet":{"type":"number"},"notSupplied":{"type":"number"}},"additionalProperties":true},"application":{"type":"object","properties":{"status":{"type":"string"},"missing":{"type":"number"}},"additionalProperties":true},"budget":{"type":"object","properties":{"status":{"type":"string"},"currency":{"type":"string"},"calculatedTotal":{"type":"number"},"statedTotal":{"type":"number"},"overLimit":{"type":"number"}},"additionalProperties":true},"expenses":{"type":"object","properties":{"status":{"type":"string"},"excluded":{"type":"number"}},"additionalProperties":true},"evidence":{"type":"object","properties":{"status":{"type":"string"},"unmatched":{"type":"number"}},"additionalProperties":true},"deliverables":{"type":"object","properties":{"status":{"type":"string"},"late":{"type":"number"},"notSupplied":{"type":"number"}},"additionalProperties":true},"reporting":{"type":"object","properties":{"status":{"type":"string"},"missing":{"type":"number"}},"additionalProperties":true},"deadlines":{"type":"object","properties":{"status":{"type":"string"},"count":{"type":"number"}},"additionalProperties":true},"findings":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-02T19:00:00.000Z","officialApproval":false,"complianceDetermined":false,"summary":"This report repeats supplied rules and documents. It is not an official approval and does not determine compliance.","requirements":{"status":"extracted","count":2},"eligibility":{"status":"not_met","met":1,"notMet":1,"notSupplied":0},"application":{"status":"incomplete","missing":1},"budget":{"status":"inconsistent","currency":"GBP","calculatedTotal":5000,"statedTotal":5000,"overLimit":1},"expenses":{"status":"excluded_by_rule","excluded":1},"evidence":{"status":"incomplete","unmatched":1},"deliverables":{"status":"incomplete","late":1,"notSupplied":1},"reporting":{"status":"incomplete","missing":1},"deadlines":{"status":"extracted","count":1},"findings":[{"kind":"observed","code":"rules_only","detail":"Each rule was supplied in the request. No eligibility criterion was added."},{"kind":"observed","code":"total_matches","detail":"The line amounts sum to 5000, which matches the supplied total."},{"kind":"conflict","code":"category_over_limit","detail":"staff spent 4000, 80 percent of 5000. The supplied limit was not met. This is not a funding decision."},{"kind":"observed","code":"expense_rules_only","detail":"An expense is excluded only when a supplied rule says that category is ineligible. Other categories stay not supplied."},{"kind":"observed","code":"evidence_by_id","detail":"Evidence matches a requirement only when it cites that requirement id. The text was not judged."},{"kind":"observed","code":"caller_updates","detail":"Deliverable status comes only from the supplied updates. accepted_by_caller is not an official acceptance."},{"kind":"observed","code":"late_against_supplied_date","detail":"D1 has update date 2026-12-20 after the supplied due date 2026-12-01. No penalty was decided."},{"kind":"unavailable","code":"not_an_approval","detail":"No grant rule, eligibility result, or approval outcome was invented. This report does not determine compliance."}],"limitations":["This is not an official approval, and compliance was not determined.","Rules, eligibility criteria, budgets, and evidence are used only when they are supplied in the request.","Labeled lines are read as written. Unlabeled prose is not turned into a grant rule.","A matching evidence id does not judge whether the evidence is sufficient."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.12"},"protocols":[{"x402":{}}]}}}},"components":{"schemas":{"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}}}}}