Z-Script API Reference
Siliqun Rotor exposes endpoints for checking and running Z-Script programs.
1. Check Script: POST /v1/scripts/check
Performs ahead-of-time parsing, unbound variable detection, arity checks, and recursion verification.
Request Body:
{
"script": "(define (clean s) (trim (lower s)))\n(clean (get input :name))"
}
Response:
{
"ok": true,
"hash": "ab78447ba074d194",
"canonical": "(define (clean s) (trim (lower s)))\n(clean (get input :name))",
"defines": ["clean"],
"builtins": ["+", "-", "*", "/", "trim", "lower", ...]
}
2. Run Script: POST /v1/scripts/run
Executes the compiled AST with an exact step-budgeted fuel limit.
Request Body:
{
"script": "(define (clean s) (trim (lower s)))\n(clean (get input :name))",
"input": {
"name": " MUHAMMAD AHMED "
},
"fuel": 50000
}
Response:
{
"output": "muhammad ahmed",
"steps": 8,
"hash": "ab78447ba074d194"
}
steps: The exact number of abstract evaluation steps taken (deterministic across machines).hash: Canonical program hash verifying reproducible termination.