POST /api/v1/keys/upload
Upload a client-generated public + evaluation key. The server stores no
secret key — this is the FHE-blind path.
Auth: TRIAL+
Request
| Field | Type | Required | Notes |
|---|---|---|---|
public_key | string (base64) | Yes | ≤2 MB |
eval_key | string (base64) | Yes | ≤10 MB |
scheme | string | No | "ckks" or "rns-ckks" (default) |
params | object | Yes | See below |
Response — 200 OK
POST /api/v1/keys/generate
Generate keys server-side. Deprecated for production — the secret key
briefly exists on the server during keygen. Prefer /keys/upload.
Auth: TRIAL+
Request
Parameter constraints
| Field | Type | Allowed values |
|---|---|---|
poly_degree | int | 64, 256, 4096, 8192, 16384, 32768 |
scale_bits | int | 10–50 (default 15) |
security_level | string | "testing", "128-bit", "192-bit", "256-bit" |
max_depth | int | 1–14 (default 5) |
poly_degree of 64 or 256 yields keys below 128-bit security and triggers
a X-Security-Warning response header.
Response — 200 OK
secret_key is always null in production. To enable returning it (for
local testing only), set WAVIS_ALLOW_SK_IN_RESPONSE=true on the server.
Response — 400 Bad Request
GET /api/v1/keys/{key_id}
Fetch metadata about a key. Does not return the secret key, ever.
Auth: READ+ (viewer, developer, or account_admin)
Request
Response — 200 OK
DELETE /api/v1/keys/{key_id}
Delete a key and all ciphertexts encrypted under it.
Auth: WRITE+ (developer or account_admin)
Request
Response — 200 OK
GET /api/v1/keys
List all keys for the authenticated account. Cursor-paginated.
Auth: READ+
Request
| Query param | Type | Default | Range |
|---|---|---|---|
limit | int | 20 | 1–100 |
cursor | string | — | opaque base64 from prior response |
Response — 200 OK
Common errors
| Code | Status | Meaning |
|---|---|---|
INVALID_PARAMS | 400 | Parameter out of range or wrong type |
INSUFFICIENT_SECURITY | 400 | Selected params give <128-bit security with security_level=128-bit |
KEY_NOT_FOUND | 404 | key_id doesn’t exist or belongs to another account |
PAYLOAD_TOO_LARGE | 413 | Public key >2 MB or eval key >10 MB |
QUOTA_EXCEEDED | 402 | Account is over its plan quota |
Best practices
- Always use
/keys/uploadfor production. The endpoint that touches the secret key (/keys/generate) is for demos. - One key per security boundary. Don’t reuse a key across users — if one user is compromised, they can decrypt the others.
- Delete keys when done. Active keys count against your storage quota and consume server memory for cached eval keys.
- Cache the
key_idclient-side. Avoid round-tripping/keysto look it up. - Set parameters once and stick with them. Switching
poly_degreemeans re-encrypting everything.
Next Steps
TFHE API
Boolean gate evaluation
Compute API
CKKS arithmetic on ciphertexts