Skip to main content

Reference Clients

The Zeq compute API is exposed as a single REST endpoint. The wire contract is fixed and language-independent: any HTTP client capable of issuing an authenticated POST with a JSON body and parsing a JSON response can invoke it.

Wire Contract

FieldValue
EndpointPOST https://www.zeq.dev/api/zeq/compute
AuthenticationAuthorization: Bearer <api_key>
Request bodyapplication/json{ "domain": "<domain>", "operators": ["<id>", ...], "inputs": { ... } }
Response bodyapplication/json — signed ZeqState envelope (HMAC-SHA256 ZeqProof, hash-chained zeq.compliance.v1)
PhaseAll responses are timestamped to the 1.287 Hz HulyaPulse and the τ=0.777s Zeqond

The reference snippets below are provided for convenience. They are not SDKs — they are minimal, idiomatic invocations of the same REST endpoint in each language's standard HTTP client.

Python

import requests
r = requests.post("https://www.zeq.dev/api/zeq/compute",
headers={"Authorization": "Bearer YOUR_KEY"},
json={"domain": "quantum mechanics", "operators": ["QM1"]})
print(r.json())

JavaScript

const r = await fetch("https://www.zeq.dev/api/zeq/compute", {
method: "POST",
headers: { "Authorization": "Bearer YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ domain: "quantum mechanics", operators: ["QM1"] })
});
console.log(await r.json());

TypeScript

type ZeqRes = { result: number; zeqProof: string };
const res: ZeqRes = await fetch(
"https://www.zeq.dev/api/zeq/compute",
{ method: "POST",
headers: { Authorization: "Bearer YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ domain: "quantum mechanics" }) }
).then(r => r.json());

Java

HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://www.zeq.dev/api/zeq/compute"))
.header("Authorization", "Bearer YOUR_KEY")
.header("Content-Type", "application/json")
.POST(BodyPublishers.ofString("{\"domain\":\"quantum mechanics\"}"))
.build();

C#

using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_KEY");
var body = new StringContent("{\"domain\":\"quantum mechanics\"}",
Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://www.zeq.dev/api/zeq/compute", body);

C++ (libcurl)

CURL* c = curl_easy_init();
curl_easy_setopt(c, CURLOPT_URL, "https://www.zeq.dev/api/zeq/compute");
curl_easy_setopt(c, CURLOPT_POSTFIELDS, "{\"domain\":\"quantum mechanics\"}");
curl_easy_perform(c);

Go

body := strings.NewReader(`{"domain":"quantum mechanics"}`)
req, _ := http.NewRequest("POST", "https://www.zeq.dev/api/zeq/compute", body)
req.Header.Set("Authorization", "Bearer YOUR_KEY")
res, _ := http.DefaultClient.Do(req)

Rust (reqwest)

let res = reqwest::Client::new()
.post("https://www.zeq.dev/api/zeq/compute")
.bearer_auth("YOUR_KEY")
.json(&serde_json::json!({"domain": "quantum mechanics"}))
.send().await?;

Ruby

require 'net/http'; require 'json'
uri = URI("https://www.zeq.dev/api/zeq/compute")
req = Net::HTTP::Post.new(uri, "Authorization" => "Bearer YOUR_KEY")
req.body = { domain: "quantum mechanics" }.to_json
Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }

PHP

$ch = curl_init("https://www.zeq.dev/api/zeq/compute");
curl_setopt_array($ch, [
CURLOPT_POST => 1,
CURLOPT_HTTPHEADER => ["Authorization: Bearer YOUR_KEY"],
CURLOPT_POSTFIELDS => '{"domain":"quantum mechanics"}',
CURLOPT_RETURNTRANSFER => 1]);
echo curl_exec($ch);

Kotlin

val req = Request.Builder()
.url("https://www.zeq.dev/api/zeq/compute")
.header("Authorization", "Bearer YOUR_KEY")
.post("""{"domain":"quantum mechanics"}"""
.toRequestBody("application/json".toMediaType()))
.build()
val res = OkHttpClient().newCall(req).execute()

Swift

var req = URLRequest(url: URL(string: "https://www.zeq.dev/api/zeq/compute")!)
req.httpMethod = "POST"
req.setValue("Bearer YOUR_KEY", forHTTPHeaderField: "Authorization")
req.httpBody = #"{"domain":"quantum mechanics"}"#.data(using: .utf8)
let (data, _) = try await URLSession.shared.data(for: req)

…and every other language with an HTTPS client. The contract is JSON. The endpoint is POST /api/zeq/compute. That's it.

Next: see the full API Reference and the ZeqState object shape.