{"slug":"api-onhub-ai-v1-code-d1d2e9","title":"Writes and runs Python to compute or verify an answer, returning the code, its o","host":"api.onhub.ai","method":"POST","resource":"https://api.onhub.ai/v1/code","category":"code","description":"Writes and runs Python to compute or verify an answer, returning the code, its output, and a final answer.","price_listed":0.015,"price_asked":0.015,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":227,"reported_calls_30d":3,"reported_payers_30d":1,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"query":"What is the sum of the first 50 prime numbers?"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"additionalProperties":false,"properties":{"query":{"description":"A computational question to answer by writing and running Python code, e.g. a calculation, data-processing, or verification task.","maxLength":2000,"minLength":3,"type":"string"}},"required":["query"],"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":{"answer":{"type":"string"},"billing":{"type":"object"},"object":{"const":"code.result","type":"string"},"query":{"type":"string"},"steps":{"description":"The code that ran and its output, in execution order, for independent verification.","items":{"properties":{"content":{"type":"string"},"language":{"type":"string"},"outcome":{"type":"string"},"type":{"enum":["code","result"],"type":"string"}},"required":["type","content"],"type":"object"},"type":"array"}},"required":["object","query","answer","steps"],"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-09-25","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.015,"price_match":true,"latency_ms":227,"error":null}],"description_full":"Writes and runs Python to compute or verify an answer, returning the code, its output, and a final answer.","last_updated":"2026-09-24T19:50:08.264Z","schemes":["exact"]}