{"openapi":"3.1.0","info":{"title":"Ohmsville","version":"1.0.0","description":"The kit's authored content, a JSON format for a circuit, and a simulator that runs it on the same solver the player's bench uses. Everything here is keyless except POST /api/ask, which needs an X-Api-Key from POST /api/keys. A circuit document is described by /api/schema/circuit.json; read /llms.txt first if you are a model."},"servers":[{"url":"https://ohmsville.com"}],"paths":{"/api/experiments":{"get":{"summary":"The manual's 25 experiments","responses":{"200":{"description":"every experiment with its level, goal, parts and bench link","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/experiments/{id}":{"get":{"summary":"One experiment, with its circuit, hash and schematic","parameters":[{"name":"id","in":"path","required":true,"description":"1…20","schema":{"type":"string"}}],"responses":{"200":{"description":"the experiment","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"no experiment with that id","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/recipes":{"get":{"summary":"Short circuits that show what one part does","responses":{"200":{"description":"every recipe","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/recipes/{id}":{"get":{"summary":"One recipe, with its circuit, hash and schematic","parameters":[{"name":"id","in":"path","required":true,"description":"a recipe id, e.g. night-light","schema":{"type":"string"}}],"responses":{"200":{"description":"the recipe","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"no recipe with that id","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/lessons":{"get":{"summary":"The classroom's course","responses":{"200":{"description":"every lesson","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/lessons/{id}":{"get":{"summary":"One lesson, with its full body","parameters":[{"name":"id","in":"path","required":true,"description":"a lesson id","schema":{"type":"string"}}],"responses":{"200":{"description":"the lesson","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"no lesson with that id","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/parts":{"get":{"summary":"The standard board, the drawer, and the pin names of every kind","responses":{"200":{"description":"board, drawer, pins","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/schema/circuit.json":{"get":{"summary":"JSON Schema for a circuit document","responses":{"200":{"description":"the schema","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/openapi.json":{"get":{"summary":"This document","responses":{"200":{"description":"this document","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/docs":{"get":{"summary":"This document, rendered","responses":{"200":{"description":"HTML","content":{"text/html":{}}}}}},"/api/links":{"post":{"summary":"A bench link for a circuit document, plus the canonical document the link carries","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["circuit"],"properties":{"circuit":{"$ref":"https://ohmsville.com/api/schema/circuit.json"}}}}}},"responses":{"200":{"description":"url (null without a configured origin), hash, circuit, warnings","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"not a circuit document","content":{"application/json":{"schema":{"type":"object"}}}},"422":{"description":"a field is wrong; the message names it","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/circuit":{"get":{"summary":"The circuit a bench link describes","parameters":[{"name":"url","in":"query","required":true,"description":"a full bench URL or a bare #a=…&w=… fragment, up to 4 KB","schema":{"type":"string"}}],"responses":{"200":{"description":"circuit, hash, activity, campaign, warnings","content":{"application/json":{"schema":{"type":"object"}}}},"422":{"description":"nothing decoded from that link","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/simulate":{"post":{"summary":"Run a circuit on the same solver the bench uses and read it","description":"Caps: 40 wired parts, 120 wires, 3000 ms of circuit time, a 6 s wall clock. Over the wall clock the reply is a 200 with \"complete\": false and the steps that finished.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["circuit"],"properties":{"circuit":{"$ref":"https://ohmsville.com/api/schema/circuit.json"}}}}}},"responses":{"200":{"description":"complete, simulatedMs, steps[] with readings, summary, describe and samples","content":{"application/json":{"schema":{"type":"object"}}}},"422":{"description":"a field is wrong, or a cap was passed","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"per-IP limit or another simulation is running","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/keys":{"post":{"summary":"Mail an API key for POST /api/ask","description":"Always answers 202, whether or not the address already had one. Asking again revokes the key before it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"}}}}}},"responses":{"202":{"description":"the key is on its way if the address can receive it","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"that does not look like an email address","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"too many key requests","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"this deployment cannot send mail","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/ask":{"post":{"summary":"Ask the shop teacher about a circuit","description":"Needs an X-Api-Key from POST /api/keys: 50 questions per UTC day per key, plus the shared per-IP limit. The circuit is settled and read first, so the answer is about the real readings. The teacher explains; it has no tools here.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question","circuit"],"properties":{"question":{"type":"string","maxLength":2000},"circuit":{"$ref":"https://ohmsville.com/api/schema/circuit.json"},"settleMs":{"type":"integer","minimum":0,"maximum":3000,"default":200,"description":"milliseconds of circuit time to run from cold before the first reading"}}}}}},"responses":{"200":{"description":"answer, model, summary, budget","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"no key, or not one of ours","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"that key was replaced","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"per-IP limit or the daily budget","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"the model returned nothing usable","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"this deployment has no model key","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}