E2EE decrypts inside the attested gateway so the gateway can process the request. It proves the decryption key belongs to the verified gateway; it does not hide plaintext from that gateway. Use confidential models when the upstream model provider must also be attested.
Get the Gateway E2EE Key
Fetch and verify the gateway attestation report, then read the E2EE key from the attested keyset:secp256k1-aes-256-gcm-hkdf-sha256. The gateway advertises supported E2EE versions in service_capabilities.supported_e2ee_versions.
Request Headers
Include these headers when sending an E2EE request:| 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 the attested keyset. |
X-E2EE-Nonce | Unique per-request nonce. |
X-E2EE-Timestamp | Unix seconds, close to gateway time. |
X-Signing-Algo with E2EE. That header selects the legacy signature compatibility path.
Ciphertext Format
Each encrypted field is lowercase hex encoding of:Receipts with E2EE
Receipts work the same way for E2EE requests. The response still includesx-receipt-id, and you still verify the receipt with Get Receipt.
For E2EE, request.received.body_hash is the hash of the gateway-observed decrypted body, not the encrypted wire body. Compare it with the decrypted request body your client holds.

