Program

Download

Download a solved problem and run it again with different values.

After the problem solves, Download Script and Try inputs sit at the top of the solution. They stay there while the solution scrolls, unless the screen is short. Try inputs, under the solution, stays collapsed until you open it and rebuilds on the next solve. The engine switch is the Engine button at the bottom of the problem. Pick JavaScript, C, Go, Rust, Java, or Ruby. A program does the same download with the account key at POST /api/v1/download. An agent uses the download tool on the MCP page. The same key, the same quota, and the same errors as solve. The download is available only after the problem solves.

The file solves the equations on its own. It does not call this site and it does not contain the compiler. Call it with no values and you get the downloaded solution. Pass a bag of names to change any of them. Omit a name to keep its default. The response field guide lists every name, whether it is an input, a derived value, or an unknown, and the default. An input is a fixed value from the sheet. A derived value is recomputed unless you set it. An unknown is solved unless you set it, which holds it fixed and solves the rest. Holding an unknown fixed can make the problem impossible. That comes back as an error, not a crash. Matrix sizes may change. A number, a complex value written {re, im}, or a matrix written as an array of rows are the values you can pass. Indexes inside the equations stay 1-based. The arrays you pass are ordinary rows.

Errors use a code. unknown_name means that name is not in the guide. type means the value is not a number, a complex value, or a matrix. shape means a matrix is empty, jagged, or the wrong size for the equations. inconsistent means the values disagree with the equations. unsolved means there is not a single solution for the names left to solve. A comparison such as x > 0 is reported under checks and does not, by itself, reject the result. Integration, derivatives, minimum, maximum, random, and a loop inside a function cannot be downloaded for new inputs yet. Save source under filename. For Java that name is Solution.java.

Download

POST /api/v1/download { "equations": [ "k = 2", "x + y = k", "x - y = 0" ], "language": "javascript" }

language is javascript, the default, or c, go, rust, java, or ruby. The call always uses the compiler. A 200 with Solved true includes source, filename, and guide. A 200 with Solved false means the problem did not solve, or it uses something the file cannot recompute. Check Solved before saving the file. This spends one request, the same as solve.

Response

{ "Solved": true, "api": "compiler", "language": "javascript", "filename": "solution.js", "guide": { "variables": [ { "name": "k", "role": "input", "kind": "real", "default": 2 }, { "name": "x", "role": "unknown", "kind": "real", "default": 1 }, { "name": "y", "role": "unknown", "kind": "real", "default": 1 } ] }, "source": "// QED solution…", "request_id": "req_…" }

Write source to filename. Read guide.variables before you invent a name. The errors, limits, and Idempotency-Key rules on the API page apply here. A different language is a different body, so reuse an idempotency key only for the same lines and the same language.

curl

curl -s https://development.qedsolver.com/api/v1/download \ -H "Authorization: Bearer $QED_API_KEY" \ -H "Content-Type: application/json" \ -d '{"equations":["k = 2","x + y = k","x - y = 0"],"language":"javascript"}' \ | python -c 'import json,sys; body=json.load(sys.stdin); open("solution.js","w").write(body["source"]); print(body["guide"]["variables"])'

QED_API_KEY is the secret from the Account page, the one that starts with qed_live_. Keep it in the environment, not in source. Change language and the output file for the other examples.

JavaScript is the file to run today. solve is the call, in the browser on Try inputs and in Node. C, Go, Rust, Java, and Ruby will use the same guide and the same result shape. Until a download in one of those languages succeeds, use JavaScript.

JavaScript

import { guide, solve } from "./solution.js"; console.log(guide.variables.map((v) => v.name)); console.log(solve()); console.log(solve({ k: 10 })); console.log(solve({ x: 3 }));

Save the download as solution.js and this caller as check.mjs. node check.mjs. solve() with no argument is the downloaded solution. Pass any name from guide. A number, {re, im}, or an array of rows. Each call returns {ok:true, solution} or {ok:false, error}. It does not throw.

© 2026 QED Solverworks LLC