---
title: "Create a node lock for confidential compute"
method: POST
path: "/v1/nodes/lock"
tags: ["Nodes"]
---

# Create a node lock for confidential compute

`POST /v1/nodes/lock`

This endpoint attempts to find a suitable node and retrieve its public key for encryption
through a two-step process:

1. First, it tries to select an existing node with a public key directly.
2. If no node is immediately available, it falls back to finding the cheapest compatible node
   and acquiring a new stack entry for it.

This endpoint is specifically designed for confidential compute scenarios where
requests need to be encrypted before being processed by nodes.

## Errors
  - `INTERNAL_SERVER_ERROR` - Communication errors or missing node public keys
  - `SERVICE_UNAVAILABLE` - No nodes available for confidential compute

## Request body

- NodesCreateLockRequest — Request body for creating a node lock
  - `max_num_tokens` integer, nullable — The number of tokens to be processed for confidential compute (including input and output tokens)
  - `model` string, required — The model to lock a node for
  - `timeout` integer, nullable — An optional timeout period for the locked compute units, in seconds

## Response `200`

Node DH public key requested successfully

- NodesCreateLockResponse — The response body for selecting a node's public key for encryption from a client. The client will use the provided public key to encrypt the request and send it back to the proxy. The proxy will then route this request to the selected node.
  - `node_small_id` integer, required — The node small id for the selected node
  - `public_key` string, required — The public key for the selected node, base64 encoded
  - `stack_entry_digest` string, nullable — Transaction digest for the transaction that acquires the stack entry, if any
  - `stack_small_id` integer, required — The stack small id to which an available stack entry was acquired, for the selected node

## Other responses

- `500` — Failed to request node DH public key
- `503` — No node found for model with confidential compute enabled for requested model

---

[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)
