POST
/v1/batch
QuBitLang
Bulk request up to 100,000 random values in a single API call. Supports integers, floats, bytes, and UUIDs. Optimised for high-throughput applications requiring large volumes of quantum entropy.
Request Body
POST BodyJSON
{
"type": "integers", // integers | floats | bytes | uuid
"count": 100000, // Up to 100,000
"params": {
"min": 1,
"max": 1000000
}
}
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Value type: integers, floats, bytes, uuid |
| count | integer | Yes | Number of values (1–100,000) |
| params | object | No | Type-specific parameters (min, max, precision, encoding) |
Code Examples
batch.py
from trueentropy import TrueEntropy
client = TrueEntropy(api_key="te_live_YOUR_KEY")
result = client.batch(
type="integers",
count=100000,
params={"min": 1, "max": 1000000}
)
print(len(result.values))
# 100000
print(result.metadata.processing_time_ms)
# 342
batch.js
import { TrueEntropy } from '@trueentropy/sdk';
const client = new TrueEntropy('te_live_YOUR_KEY');
const result = await client.batch({
type: 'integers',
count: 100000,
params: { min: 1, max: 1000000 }
});
console.log(result.data.values.length);
// 100000
batch.php
use TrueEntropy\Client;
$client = new Client('te_live_YOUR_KEY');
$result = $client->batch([
'type' => 'integers',
'count' => 100000,
'params' => ['min' => 1, 'max' => 1000000],
]);
echo count($result->values);
// 100000
Terminal
curl -X POST https://api.trueentropy.net/v1/batch \
-H "Authorization: Bearer te_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"integers","count":100000,"params":{"min":1,"max":1000000}}'
Response
200 OKJSON
{
"data": {
"values": [472193, 829105, 134782, ... 99,997 more],
"count": 100000,
"type": "integers"
},
"metadata": {
"request_id": "req_a7b8c9d0e1f2",
"timestamp": "2026-03-09T15:42:17Z",
"processing_time_ms": 342,
"entropy_consumed_bytes": 400000,
"qubitlang_circuit": "qrng_hadamard_v2.3",
"qubitlang_version": "1.4.0",
"quantum_backend": "ibm_fez",
"nist_verified": true,
"certificate_id": "cert_a7b8c9d0e1f2",
"powered_by": "QuBitLang"
}
}
Response Headers
X-QuBitLang-Circuit: qrng_hadamard_v2.3
X-QuBitLang-Version: 1.4.0
X-Quantum-Backend: ibm_fez
X-NIST-Verified: true
X-RateLimit-Remaining: 47
X-RateLimit-Reset: 1741536180
Errors
| Status | Code | Description |
|---|---|---|
| 400 | invalid_type | type must be integers, floats, bytes, or uuid |
| 400 | invalid_count | count must be between 1 and 100,000 |
| 400 | invalid_range | min must be less than max (integers) |
| 401 | auth_missing | No API key provided |
| 401 | auth_invalid | API key is invalid or revoked |
| 403 | auth_scope | API key lacks entropy:batch scope |
| 429 | rate_limited | Rate limit exceeded |