QuBitLang
QuBitLang in API Responses
Every TrueEntropy API response includes QuBitLang provenance metadata - both in the JSON body and as HTTP response headers. This gives you a complete audit trail of exactly how your random values were generated.
JSON Metadata
Every successful response includes a metadata object with QuBitLang fields:
200 OKJSON
{
"data": { ... your random values ... },
"metadata": {
"request_id": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-09T15:42:17Z",
"qubitlang_circuit": "qrng_hadamard_v2.3",
"qubitlang_version": "1.4.0",
"quantum_backend": "ibm_fez",
"nist_verified": true,
"certificate_id": "cert_a1b2c3d4e5f6",
"powered_by": "QuBitLang"
}
}
Metadata Fields
| Field | Type | Description |
|---|---|---|
qubitlang_circuit | string | The exact QuBitLang circuit used to generate the entropy (e.g. qrng_hadamard_v2.3) |
qubitlang_version | string | Version of the QuBitLang compiler/runtime that executed the circuit |
quantum_backend | string | IBM quantum hardware used (e.g. ibm_fez, ibm_marrakesh) |
nist_verified | boolean | Whether the output passed NIST SP800-22 statistical tests |
certificate_id | string | Unique ID to retrieve the full provenance certificate |
powered_by | string | Always "QuBitLang" - confirms quantum origin |
request_id | string | Unique request identifier for support and debugging |
timestamp | string | ISO 8601 timestamp of the request |
Response Headers
The same QuBitLang provenance data is also available as HTTP response headers, making it accessible without parsing JSON - useful for logging, monitoring, and compliance pipelines.
X-QuBitLang-Circuit: qrng_hadamard_v2.3
X-QuBitLang-Version: 1.4.0
X-Quantum-Backend: ibm_fez
X-NIST-Verified: true
X-Certificate-Id: cert_a1b2c3d4e5f6
X-RateLimit-Remaining: 47
X-RateLimit-Reset: 1741536180
Header Reference
| Header | Description |
|---|---|
X-QuBitLang-Circuit | Circuit identifier (matches qubitlang_circuit in JSON) |
X-QuBitLang-Version | Compiler version (matches qubitlang_version in JSON) |
X-Quantum-Backend | IBM quantum hardware identifier |
X-NIST-Verified | true if output passed NIST SP800-22 tests |
X-Certificate-Id | Provenance certificate ID for the request |
X-RateLimit-Remaining | Requests remaining in current rate window |
X-RateLimit-Reset | Unix timestamp when the rate window resets |
Accessing Metadata in SDKs
result = client.integers(count=10)
# JSON metadata
print(result.metadata.qubitlang_circuit) # qrng_hadamard_v2.3
print(result.metadata.qubitlang_version) # 1.4.0
print(result.metadata.quantum_backend) # ibm_fez
print(result.metadata.nist_verified) # True
print(result.metadata.certificate_id) # cert_a1b2c3d4e5f6
const result = await client.integers({ count: 10 });
// JSON metadata (camelCase in JS SDK)
console.log(result.metadata.qubitlangCircuit); // qrng_hadamard_v2.3
console.log(result.metadata.qubitlangVersion); // 1.4.0
console.log(result.metadata.quantumBackend); // ibm_fez
console.log(result.metadata.nistVerified); // true
console.log(result.metadata.certificateId); // cert_a1b2c3d4e5f6
$result = $client->integers(['count' => 10]);
// JSON metadata
echo $result->metadata->qubitlang_circuit; // qrng_hadamard_v2.3
echo $result->metadata->qubitlang_version; // 1.4.0
echo $result->metadata->quantum_backend; // ibm_fez
echo $result->metadata->nist_verified; // true
echo $result->metadata->certificate_id; // cert_a1b2c3d4e5f6
Use Cases
- Audit compliance - Log the circuit version and backend for every entropy request to satisfy regulators
- Monitoring - Track which quantum backends are serving your requests via response headers
- Certificate retrieval - Use
certificate_idto fetch the full provenance certificate for any request - NIST verification - Confirm every response has passed SP800-22 statistical tests