E2EE is decrypted inside the attested gateway so it can process your request. It proves the
decryption key belongs to the attested workload; it does not hide the request from that workload. For
the upstream to be attested too, use a confidential model.
When to use it
Use E2EE when you want field-level encryption bound to a key you can trace to the attestation report, in addition to TLS. If TLS is sufficient for your threat model, you can call the API normally without these headers.1. Get the gateway E2EE key
Fetch the attestation report and read the E2EE public key from the attested keyset. Verify the report first (see Verify a response) so you know the key is bound to a genuine TEE.secp256k1-aes-256-gcm-hkdf-sha256 algorithm.
2. Send E2EE headers
Include these headers on your request. Do not sendX-Signing-Algo; that selects the legacy path.
| Header | Value |
|---|---|
X-E2EE-Version | 2 |
X-Client-Pub-Key | Your secp256k1 public key, hex encoded. |
X-Model-Pub-Key | The gateway E2EE public key from step 1. |
X-E2EE-Nonce | A unique per-request nonce. |
X-E2EE-Timestamp | Unix seconds, close to gateway time. |
3. Encrypt the selected fields
Each encrypted field is the lowercase hex encoding of:Receipts with E2EE
The response still carries anx-receipt-id. For an E2EE request, request.received.body_hash is the
hash of the gateway-observed decrypted body. When you verify, compare request hashes against the
decrypted body your client holds, not the encrypted bytes you sent. See
Receipts.