Create confidential chat completion
This handler processes chat completion requests in a confidential manner, providing additional encryption and security measures for sensitive data processing. It supports both streaming and non-streaming responses while maintaining data confidentiality through AEAD encryption and TEE hardware, for full private AI compute.
Returns
Returns a Result
containing either:
- An HTTP response with the chat completion result
- A streaming SSE connection for real-time completions
- An
AtomaProxyError
error if the request processing fails
Errors
Returns AtomaProxyError::InvalidBody
if:
- The ‘stream’ field is missing or invalid in the payload
Returns AtomaProxyError::InternalError
if:
- The inference service request fails
- Response processing encounters errors
- State manager updates fail
Security Features
- Utilizes AEAD encryption for request/response data
- Supports TEE (Trusted Execution Environment) processing
- Implements secure key exchange using X25519
- Maintains confidentiality throughout the request lifecycle
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
A request for confidential computation that includes encrypted data and associated cryptographic parameters
The encrypted payload that needs to be processed (base64 encoded)
Client's public key for Diffie-Hellman key exchange (base64 encoded)
Model name
Node's public key for Diffie-Hellman key exchange (base64 encoded)
Cryptographic nonce used for encryption (base64 encoded)
Hash of the original plaintext body for integrity verification (base64 encoded)
Salt value used in key derivation (base64 encoded)
Unique identifier for the small stack being used
x > 0
Number of compute units to be used for the request, for image generations, as this value is known in advance (the number of pixels to generate)
x > 0
Indicates whether this is a streaming request
Response
Represents a response from a confidential compute request
Encrypted response body (base64 encoded)
Nonce used for encryption (base64 encoded)
Hash of the response body (base64 encoded)
Signature of the response body (base64 encoded)
Usage statistics for the request