import json
from pyodide.http import pyfetch
response = await pyfetch(
"https://api.reductionofstates.com/v1/demo/inference",
method="POST",
headers={"Content-Type": "application/json"},
body=json.dumps({"prompt": "Explain KV caching."}),
credentials="omit",
)
response.raise_for_status()
result = await response.json()
print(result["choices"][0]["message"]["content"])const response = await fetch(
"https://api.reductionofstates.com/v1/demo/inference",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ prompt: "Explain KV caching." }),
credentials: "omit",
},
);
if (!response.ok) throw new Error(`Gateway returned ${response.status}`);
const result = await response.json();
console.log(result.choices[0].message.content);curl https://api.reductionofstates.com/v1/demo/inference \
-H 'Content-Type: application/json' \
-d '{"prompt":"Explain KV caching."}'Model response
A single inference request. Savings require a workload-specific comparison.