v1

latestOpenAPI 3.1.0Apache-2.02026-07-13136499.6 KB
Confidential Chat

Create confidential chat completions

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
post/v1/confidential/chat/completions

Request body

ciphertextstring required

The encrypted payload that needs to be processed (base64 encoded)

client_dh_public_keystring required

Client's public key for Diffie-Hellman key exchange (base64 encoded)

model_namestring required

Model name

node_dh_public_keystring required

Node's public key for Diffie-Hellman key exchange (base64 encoded)

noncestring required

Cryptographic nonce used for encryption (base64 encoded)

num_compute_unitsinteger nullable

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)

plaintext_body_hashstring required

Hash of the original plaintext body for integrity verification (base64 encoded)

saltstring required

Salt value used in key derivation (base64 encoded)

stack_small_idinteger required

Unique identifier for the small stack being used

streamboolean nullable

Indicates whether this is a streaming request

Response

Confidential chat completions

ciphertextstring required

Encrypted response body (base64 encoded)

noncestring required

Nonce used for encryption (base64 encoded)

response_hashstring nullable

Hash of the response body (base64 encoded)

signaturestring nullable

Signature of the response body (base64 encoded)

Example response

{
  "usage": {
    "completion_tokens": 10,
    "completion_tokens_details": {
      "accepted_prediction_tokens": 10,
      "reasoning_tokens": 10
    },
    "prompt_tokens": 10,
    "prompt_tokens_details": {
      "cached_tokens": 10
    },
    "total_tokens": 20
  }
}