---
title: "Create confidential embeddings"
method: POST
path: "/v1/confidential/embeddings"
tags: ["Confidential Embeddings"]
---

# Create confidential embeddings

`POST /v1/confidential/embeddings`

This endpoint follows the OpenAI API format for generating vector embeddings from input text,
but with confidential processing (through AEAD encryption and TEE hardware).
The handler receives pre-processed metadata from middleware and forwards the request to
the selected node.

## Returns
* `Ok(Response)` - The embeddings response from the processing node
* `Err(AtomaProxyError)` - An error status code if any step fails

## Errors
* `INTERNAL_SERVER_ERROR` - Processing or node communication failures

## Request body

- ConfidentialComputeRequest — 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)
  - `num_compute_units` integer, 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_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, required — Unique identifier for the small stack being used
  - `stream` boolean, nullable — Indicates whether this is a streaming request

## Response `200`

Confidential embeddings generated successfully

- ConfidentialComputeResponse — 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, nullable — Hash of the response body (base64 encoded)
  - `signature` string, nullable — Signature of the response body (base64 encoded)
  - `usage` Usage
    - `completion_tokens` integer, required — The number of completion tokens used
    - `completion_tokens_details` CompletionTokensDetails, required — The details of the completion tokens
      - `accepted_prediction_tokens` integer, required — The number of tokens in the completion
      - `audio_tokens` integer, required — The number of audio tokens
      - `reasoning_tokens` integer, required — The number of reasoning tokens
      - `rejected_prediction_tokens` integer, required — The number of rejected prediction tokens
    - `prompt_tokens` integer, required — The number of prompt tokens used
    - `prompt_tokens_details` PromptTokensDetails, required
      - `audio_tokens` integer, required — The number of audio tokens
      - `cached_tokens` integer, required — The number of cached tokens
    - `total_tokens` integer, required — The total number of tokens used

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `500` — Internal server error

---

[API](https://skmtc.net/atomaai/apis/atoma-proxy.md) · [All operations](https://skmtc.net/atomaai/apis/atoma-proxy/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atomaai/atoma-proxy/revisions/07694b7228b0/schema)
