Skip to main content
POST
/
v1
/
confidential
/
completions
import { AtomaSDK } from "atoma-sdk"; const atomaSDK = new AtomaSDK({ bearerAuth: process.env["ATOMASDK_BEARER_AUTH"] ?? "", }); async function run() { const completion = await atomaSDK.confidentialCompletions.create({ model: "meta-llama/Llama-3.3-70B-Instruct", prompt: "Hello, world!", }); console.log(completion.choices[0]); } run();
{
  "ciphertext": "<string>",
  "nonce": "<string>",
  "response_hash": "<string>",
  "signature": "<string>",
  "usage": {
    "completion_tokens": 10,
    "completion_tokens_details": {
      "accepted_prediction_tokens": 10,
      "audio_tokens": 0,
      "reasoning_tokens": 10,
      "rejected_prediction_tokens": 0
    },
    "prompt_tokens": 10,
    "prompt_tokens_details": {
      "audio_tokens": 0,
      "cached_tokens": 10
    },
    "total_tokens": 20
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

A request for confidential computation that includes encrypted data and associated cryptographic parameters

ciphertext
string
required

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

client_dh_public_key
string
required

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

model_name
string
required

Model name

node_dh_public_key
string
required

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

nonce
string
required

Cryptographic nonce used for encryption (base64 encoded)

plaintext_body_hash
string
required

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

salt
string
required

Salt value used in key derivation (base64 encoded)

stack_small_id
integer<int64>
required

Unique identifier for the small stack being used

Required range: x >= 0
num_compute_units
integer<int64> | null

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)

Required range: x >= 0
stream
boolean | null

Indicates whether this is a streaming request

Response

Confidential chat completions

Represents a response from a confidential compute request

ciphertext
string
required

Encrypted response body (base64 encoded)

nonce
string
required

Nonce used for encryption (base64 encoded)

response_hash
string | null

Hash of the response body (base64 encoded)

signature
string | null

Signature of the response body (base64 encoded)

usage
object

Usage statistics for the request