{"slug":"brain-usebrainchain-com-x402-grades-7aff81","title":"BrainChain grades a result against your brief and records the decision on chain","host":"brain.usebrainchain.com","method":"POST","resource":"https://brain.usebrainchain.com/x402/grades","category":"other","description":"BrainChain grades a result against your brief and records the decision on chain. For work done anywhere.","price_listed":0.25,"price_asked":0.25,"state":"answering","state_label":"Answering","checks_7d":6,"answered_7d":5,"latency_ms_median":866,"reported_calls_30d":36,"reported_payers_30d":4,"networks":["eip155:4663","eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"brief":"Report this week's trading in at most 300 words: each asset and how its price moved.","result":"Three assets traded this week: ...","title":"Weekly market report"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"properties":{"brief":{"description":"What the work had to do. BrainChain reads nothing else about the job.","maxLength":32000,"minLength":1,"type":"string"},"checks":{"description":"Code that tests the delivered code. Optional. BrainChain appends it to the code blocks of result in that language and runs the whole as one program in its sandbox before any model grades; with data, it runs alone and reads DELIVERY. Work whose run fails or times out, or that has no code in that language, is rejected at full confidence. The code blocks of result in that language and code together can be at most 64,000 characters, and 128,000 escaped as JSON. The checks are published with the brief. Sent without checks, a block in brief fenced as python checks or javascript checks is run the same way.","properties":{"code":{"description":"The checks, with no ``` in them.","maxLength":32000,"minLength":1,"type":"string"},"language":{"enum":["python","javascript"],"type":"string"}},"required":["language","code"],"type":"object"},"data":{"description":"A delivery that is data, not code, at most 100,000 bytes. Optional, only with checks and never with a schema. The checks then run alone, in a fresh interpreter where DELIVERY is this string (a str in Python, a string in JavaScript), and no code from result runs. The decision record publishes data once the work is accepted, as it does result.","type":"string"},"levels":{"description":"Quality levels, best first. Optional; the default is: Does everything the brief asks, correctly and completely / Does what the brief asks, with minor gaps / Misses what the brief asks.","items":{"maxLength":200,"minLength":1,"type":"string"},"maxItems":5,"minItems":2,"type":"array"},"pass":{"description":"Index of the lowest level that passes, 0 being the best; the last level never passes. Optional; the default is 1, or 0 with two levels.","minimum":0,"type":"integer"},"result":{"description":"The delivered work, as text, at most 100,000 bytes.","minLength":1,"type":"string"},"schema":{"description":"A JSON Schema the result must match, for structured data. Optional. BrainChain checks the result against it before any model grades: the result must be one JSON value, bare or in one fenced block. A result that does not match is rejected at full confidence, and the grade names every field that does not. BrainChain checks type, properties, required, additionalProperties, items, enum, minimum, maximum, minLength and maxLength; a schema with any other keyword is refused before payment. At most 8,000 characters as JSON, published with the brief. Sent without schema, a block in brief fenced as json schema is checked the same way; send one or the other.","type":"object"},"title":{"description":"One line naming the deliverable. Optional.","maxLength":120,"type":"string"}},"required":["brief","result"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"properties":{"accepted":{"description":"The work is accepted: passProbability is at or above bar.","type":"boolean"},"answer":{"description":"The answer recorded on chain.","enum":["accept","reject"],"type":"string"},"bar":{"description":"The probability of a passing level the work needs to be accepted, 0 to 1.","type":"number"},"checks":{"description":"How the request's checks ran, when it sent any. Work whose run did not pass is rejected with passProbability 0.","properties":{"error":{"description":"The exception that stopped the run. Only in the reply to a request that carries the result.","type":"string"},"language":{"enum":["python","javascript"],"type":"string"},"outcome":{"enum":["passed","failed","timed out"],"type":"string"},"output":{"description":"Up to 4,000 characters of what the run printed. Only in the reply to a request that carries the result.","type":"string"}},"type":"object"},"confidence":{"description":"How sure the recorded answer is, 0 to 1.","type":"number"},"decision":{"properties":{"id":{"type":"string"},"page":{"type":"string"},"record":{"type":"string"}},"type":"object"},"grade":{"type":"string"},"levels":{"description":"BrainChain's probability for each level, best first.","items":{"properties":{"level":{"type":"string"},"passes":{"type":"boolean"},"probability":{"type":"number"}},"type":"object"},"type":"array"},"passProbability":{"description":"The probability that the work reaches a passing level, 0 to 1. The panel's rule decides it from BrainChain's and the other judges' answers.","type":"number"},"receipt":{"description":"Signed by the brain key that records BrainChain's decisions: what was paid, by whom and in which transaction, the decision the outcome stands on, its subject and its evidence hash. EIP-712, domain BrainChain receipt version 2 on the decision log; a receipt signed before subjects were named is version 1. Check it offline against the log's brain.","properties":{"format":{"enum":["eip712"],"type":"string"},"payload":{"type":"object"},"signature":{"type":"string"}},"required":["format","payload","signature"],"type":"object"},"second":{"description":"The second grader's probability of a passing level, when it was asked.","properties":{"model":{"type":"string"},"passProbability":{"type":"number"}},"type":"object"},"shape":{"description":"How the result matched the request's JSON schema, when it sent one or the brief fenced one. A result that does not match is rejected with passProbability 0.","properties":{"outcome":{"enum":["passed","failed"],"type":"string"},"problems":{"description":"What does not match, by path. Only in the reply to a request that carries the result.","items":{"type":"string"},"type":"array"}},"type":"object"},"state":{"enum":["paying","unconfirmed","failed","paid","graded"],"type":"string"},"status":{"description":"Where to read this grade again.","type":"string"}},"required":["grade","state","status"],"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-11-26","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.25,"price_match":true,"latency_ms":718,"error":null},{"day":"2026-11-25","reachable":true,"status":503,"valid_402":false,"asked_usdc":null,"price_match":null,"latency_ms":322,"error":null},{"day":"2026-11-24","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.25,"price_match":true,"latency_ms":972,"error":null},{"day":"2026-11-23","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.25,"price_match":true,"latency_ms":866,"error":null},{"day":"2026-11-22","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.25,"price_match":true,"latency_ms":664,"error":null},{"day":"2026-11-21","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.25,"price_match":true,"latency_ms":874,"error":null}],"description_full":"BrainChain grades a result against your brief and records the decision on chain. For work done anywhere.","last_updated":"2026-11-26T12:00:14.897Z","schemes":["exact"]}