← Back to site

API reference

Base URL https://api.kronoseal.com · JSON in, JSON out · all numbers of arbitrary size travel as strings. Every call needs an X-API-Key header (free Sandbox keys at kronoseal.com/#precios). Every response returns X-RateLimit-Plan, X-RateLimit-Remaining, X-Quota-Used, X-Quota-Limit and X-Quota-Reset.

POST /api/v1/kronoseal/generate

Resolves an index, or an exact size, to a certified prime. Same input, same prime.

Request

n_targetstringDecimal index, 1 to 1,000 digits. Exclusive with bits/digits.
bitsintegerExact bit length of the prime, 16 to 3300. Exclusive with n_target and digits.
digitsintegerExact decimal length of the prime, 5 to 994. Exclusive with n_target and bits.
seedstringOptional with bits/digits, up to 128 characters. Same (seed, size) → same prime. Omitted: the server picks one and returns it.

Response

primestringThe certified prime.
prime_digits · bitsintegerDecimal and binary length of the prime.
kstringComposite mass associated with the index.
foundbooleanfalse means the bounded search did not converge; prime is then NOT certified. Does not occur in practice with the current engine.
n_target · n_digits · seedstringThe index actually used (derived in size mode) and the seed, when applicable.
request_id · processed_atstringReceipt identifier and RFC 3339 UTC time.
engine_ns · server_nsintegerEngine and total server time in nanoseconds.
signatureobjectEd25519 receipt, see Signatures.

POST /api/v1/kronoseal/validate

Certifies whether a candidate is prime.

Request

x_candidatestringDecimal candidate, 1 to 1,010 digits.

Response

verdictstringVERIFIED: the number is a certified prime. FAIL: it is not prime.
validbooleanverdict === VERIFIED.
digits · engine_ns · server_ns · request_id · processed_at · signatureAs in generate.

GET /api/v1/kronoseal/stream (WebSocket)

Persistent session. Send {id, op: "generate" | "validate", n_target | bits | digits | seed | x_candidate}; receive {id, event: "accepted"} immediately and {id, event: "result", data} or {id, event: "error", error} when done. Up to 10 minutes per session.

GET /.well-known/kronoseal-keys.json

Public keys for signature verification: keys[] with key_id, alg (Ed25519), public_key (base64url) and public_key_hex. Cache for 5 minutes. Keys may rotate; always match on key_id.

Signatures (receipts)

Every generate/validate response includes signature = { alg: "Ed25519", key_id, signed, sig }. signed is the exact canonical string that was signed, so verification never depends on JSON serialization: verify sig over signed with the public key, then rebuild the canonical string from the response and your input and compare. The canonical string binds input, output, verdict, time and request id.

kronoseal/v1/generate
<request_id>
<processed_at>
input_sha256=<sha256 hex of n_target>
prime_sha256=<sha256 hex of prime>
prime_digits=<n>
found=<true|false>
engine_ns=<n>
kronoseal/v1/validate
<request_id>
<processed_at>
input_sha256=<sha256 hex of x_candidate>
digits=<n>
verdict=<VERIFIED|FAIL>
engine_ns=<n>

Errors and limits

400Malformed JSON or unknown fields.
415Content-Type must be application/json.
422Input rejected: empty, non-decimal, longer than your plan allows (Sandbox 300 digits / 1024 bits, Growth 500 / 1700, Enterprise 1,000 / 3300), or both n_target and bits/digits.
401Missing, unknown, revoked or expired X-API-Key.
403Feature not in your plan (e.g. WebSocket stream on Sandbox).
429Rate limit (per second) or quota (per window) exceeded; the body says which. Retry-After in seconds. Sandbox: 5/s, 10,000/month. Growth: 500/s, 1M/month. Enterprise: 20,000/s, 50M/month.
503Engine saturated. Retry-After header. Bounded concurrency per instance.
BodyMaximum 64 KiB. Server write timeout 100 s: 1,000-digit indices can exceed it on the demo instance.

What to expect by size

Up to 100 digits: milliseconds anywhere. 300 digits: ≈ 20 ms on a dedicated instance, ≈ 0.5 s on the demo. 500 digits: ≈ 0.2 s dedicated, ≈ 6 s demo. 1,000 digits: 1-1.5 s dedicated, tens of seconds and possible timeouts on the demo. Measured 2026-09-11; the Performance section on the home page keeps the full table.