Integration Guide
TrueEntropy is a standard REST API. Integrate directly with any HTTP client in any language. No SDK required — just send authenticated HTTP requests and parse the JSON response.
Note: Dedicated SDK packages (trueentropy, @trueentropy/sdk, trueentropy/sdk) are planned but not yet published. Use direct HTTP calls as shown below.
🐍
Python
via requests library example.py
import requests
resp = requests.get(
"https://api.trueentropy.net/v1/integers",
params={"count": 10, "min": 1, "max": 100},
headers={"Authorization": "Bearer te_live_YOUR_KEY"},
)
data = resp.json()
print(data["data"]["values"])
print(data["metadata"]["qubitlang_circuit"]) # qrng_hadamard_v2.3
⚡
JavaScript / Node.js
via fetch API example.js
const params = new URLSearchParams({ count: 10, min: 1, max: 100 });
const resp = await fetch(
`https://api.trueentropy.net/v1/integers?${params}`,
{ headers: { "Authorization": "Bearer te_live_YOUR_KEY" } }
);
const { data, metadata } = await resp.json();
console.log(data.values);
console.log(metadata.qubitlang_circuit); // qrng_hadamard_v2.3
🐘
PHP
via file_get_contents example.php
$url = "https://api.trueentropy.net/v1/integers?"
. http_build_query(['count' => 10, 'min' => 1, 'max' => 100]);
$ctx = stream_context_create(['http' => [
'header' => "Authorization: Bearer te_live_YOUR_KEY",
]]);
$json = file_get_contents($url, false, $ctx);
$data = json_decode($json, true);
print_r($data['data']['values']);
Every Response Includes
- QuBitLang metadata — Circuit ID, compiler version, and quantum backend in every JSON response
- Response headers —
X-QuBitLang-Circuit,X-QuBitLang-Version,X-Quantum-Backend,X-NIST-Verified - Entropy source transparency —
X-Entropy-Sourceheader indicates quantum pool vs CSPRNG fallback - Sandbox support — Use
te_test_prefixed keys for sandbox environment