{"openapi":"3.1.0","info":{"title":"WAI quantum service","version":"0.1.0","summary":"Run quantum programs: counts, expectation values and amplitudes, each with the method that produced it, its accuracy and a signed receipt. No account and no key.","license":{"name":"Apache-2.0"}},"servers":[{"url":"https://wai.transaction.science/quantum-jobs"}],"components":{"schemas":{"JobRequest":{"type":"object","required":["qasm"],"properties":{"qasm":{"type":"string","description":"The program: OpenQASM 3, or OpenQASM 2. Registers, standard gates (h, x, y, z, s, sdg, t, tdg, sx, rx, ry, rz, p, u, cx, cy, cz, ch, swap, iswap, cp, crx, cry, crz, ccx, ccz, cswap, rxx, ryy, rzz), the control modifiers ctrl @, ctrl(n) @ and negctrl @ on x y z h s sdg t tdg p and the controlled names, user gate definitions, measurement anywhere, reset anywhere, and `if (c[0]) …` / `if (c == 3) { … } else { … }` on measured bits (OpenQASM 2's `if(c==n) gate;` too). A program that measures in the middle, resets after a gate or acts on measured bits runs on statevector or stabilizer: counts split their shots at each measurement, expectation values are the exact mixture over the branches, of the state before the final measurements. Loops, inv @ and pow @ are refused, with the line."},"method":{"type":"string","enum":["auto","exact","statevector","statevector_single","stabilizer","pauli","mps","tensor_network","cutrank","cutrank_single","density_matrix","trajectories"],"default":"auto"},"shots":{"type":"integer","minimum":0,"maximum":1000000,"description":"Measurement shots (default 1024 when nothing else is asked for)."},"seed":{"type":"integer","default":1,"description":"The sampling seed: the same job and seed give the same counts."},"observables":{"type":"array","items":{"oneOf":[{"type":"string","description":"A Pauli string: factors such as `Z0`, `X3`, `Y12`, separated by spaces; qubit indices count from 0.","examples":["Z0 Z1","X3 Y4"]},{"type":"object","required":["pauli"],"properties":{"pauli":{"type":"string"},"coeff":{"type":"number","default":1.0}}}]}},"amplitudes":{"type":"array","items":{"type":"string","pattern":"^[01]+$"},"description":"Bit strings, one character per qubit, qubit n−1 first."},"noise":{"type":"object","properties":{"depolarizing_1q":{"type":"number","minimum":0,"maximum":1},"depolarizing_2q":{"type":"number","minimum":0,"maximum":1},"amplitude_damping":{"type":"number","minimum":0,"maximum":1},"dephasing":{"type":"number","minimum":0,"maximum":1},"readout":{"type":"number","minimum":0,"maximum":1}},"description":"Each a probability, applied after every gate on the qubits it touched (readout: each measured bit)."},"options":{"type":"object","description":"Per method: threshold, max_weight, ladder, max_terms (pauli); max_bond, cutoff (mps); fusion (statevector); trajectories; memory_gb."}}},"Job":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","running","done","failed","cancelled"]},"method":{"type":"string"},"why":{"type":"string","description":"Why this method: what it is, and what the circuit is."},"request":{"$ref":"#/components/schemas/JobRequest","description":"The request as submitted: the receipt is checked against it."},"result":{"type":"object","description":"counts (highest classical bit first), expectations, amplitudes, accuracy, elapsed_ms, energy and a receipt. energy is the CPU energy of the job's process: joules_micro with its class (energy_provenance), declared uncertainty (energy_uncertainty: relative_ppm, window_us) and counter filtering state, its coverage and what it excludes; or unmetered, saying why. It is inside the signed body."},"error":{"type":"string"}}},"Error":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1":{"get":{"summary":"The service: methods, limits, load and receipt key","responses":{"200":{"description":"The service"}}}},"/v1/methods":{"get":{"summary":"The methods and what each takes","responses":{"200":{"description":"The methods"}}}},"/v1/examples":{"get":{"summary":"Ready-to-run example jobs","responses":{"200":{"description":"The examples"}}}},"/v1/run":{"post":{"summary":"Submit a job and wait up to 25 s for it","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobRequest"}}}},"responses":{"200":{"description":"The finished job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"202":{"description":"Still running: poll GET /v1/jobs/{id}","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"A program or job that does not read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Larger than one job may be"},"429":{"description":"Past the per-client limits"},"503":{"description":"The queue is full"}}}},"/v1/jobs":{"post":{"summary":"Submit a job","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobRequest"}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}}}}},"/v1/jobs/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"A job: its status, and its result when done","responses":{"200":{"description":"The job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"404":{"description":"No such job"}}},"delete":{"summary":"Cancel a queued or running job","responses":{"200":{"description":"Cancelled"},"409":{"description":"Already finished"}}}},"/v1/verify":{"post":{"summary":"Whether a result's receipt seals that request and that result","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["request","result"],"properties":{"request":{"$ref":"#/components/schemas/JobRequest"},"result":{"type":"object"}}}}}},"responses":{"200":{"description":"{\"valid\": bool}"}}}},"/mcp":{"post":{"summary":"The Model Context Protocol endpoint (streamable HTTP, JSON responses): tools to run circuits, read jobs, verify receipts and list examples","responses":{"200":{"description":"A JSON-RPC response"}}}}}}