Docs / QuBitLang / In API Responses
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

FieldTypeDescription
qubitlang_circuitstringThe exact QuBitLang circuit used to generate the entropy (e.g. qrng_hadamard_v2.3)
qubitlang_versionstringVersion of the QuBitLang compiler/runtime that executed the circuit
quantum_backendstringIBM quantum hardware used (e.g. ibm_fez, ibm_marrakesh)
nist_verifiedbooleanWhether the output passed NIST SP800-22 statistical tests
certificate_idstringUnique ID to retrieve the full provenance certificate
powered_bystringAlways "QuBitLang" - confirms quantum origin
request_idstringUnique request identifier for support and debugging
timestampstringISO 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

HeaderDescription
X-QuBitLang-CircuitCircuit identifier (matches qubitlang_circuit in JSON)
X-QuBitLang-VersionCompiler version (matches qubitlang_version in JSON)
X-Quantum-BackendIBM quantum hardware identifier
X-NIST-Verifiedtrue if output passed NIST SP800-22 tests
X-Certificate-IdProvenance certificate ID for the request
X-RateLimit-RemainingRequests remaining in current rate window
X-RateLimit-ResetUnix 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_id to fetch the full provenance certificate for any request
  • NIST verification - Confirm every response has passed SP800-22 statistical tests