> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atoma.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create node

> This endpoint allows nodes to register or update their public address in the system.
When a node comes online or changes its address, it can use this endpoint to ensure
the system has its current address for routing requests.

## Errors

Returns various `AtomaProxyError` variants:
* `MissingHeader` - If the signature header is missing
* `InvalidHeader` - If the signature header is malformed
* `InvalidBody` - If:
  - The request body cannot be read
  - The signature is invalid
  - The body cannot be parsed
  - The sui address doesn't match the signature
* `InternalError` - If:
  - The state manager channel is closed
  - The registration event cannot be sent
  - Node Sui address lookup fails



## OpenAPI

````yaml cloud-api-reference/openapi.yml post /v1/nodes
openapi: 3.1.0
info:
  title: atoma-proxy
  description: ''
  license:
    name: Apache-2.0
    identifier: Apache-2.0
  version: 0.1.0
servers:
  - url: https://api.atoma.network
security: []
tags:
  - name: Completions
    description: OpenAI's API completions v1 endpoint
  - name: Confidential Completions
    description: Atoma's API confidential completions v1 endpoint
  - name: Chat
    description: OpenAI's API chat completions v1 endpoint
  - name: Confidential Chat
    description: Atoma's API confidential chat completions v1 endpoint
  - name: Confidential Embeddings
    description: Atoma's API confidential embeddings v1 endpoint
  - name: Confidential Images
    description: Atoma's API confidential images v1 endpoint
  - name: Embeddings
    description: OpenAI's API embeddings v1 endpoint
  - name: Health
    description: Health check
  - name: Images
    description: OpenAI's API images v1 endpoint
  - name: Models
    description: OpenAI's API models v1 endpoint
  - name: Nodes
    description: Nodes Management
  - name: Node Public Key Selection
    description: Node public key selection
paths:
  /v1/nodes:
    post:
      tags:
        - Nodes
      summary: Create node
      description: >-
        This endpoint allows nodes to register or update their public address in
        the system.

        When a node comes online or changes its address, it can use this
        endpoint to ensure

        the system has its current address for routing requests.


        ## Errors


        Returns various `AtomaProxyError` variants:

        * `MissingHeader` - If the signature header is missing

        * `InvalidHeader` - If the signature header is malformed

        * `InvalidBody` - If:
          - The request body cannot be read
          - The signature is invalid
          - The body cannot be parsed
          - The sui address doesn't match the signature
        * `InternalError` - If:
          - The state manager channel is closed
          - The registration event cannot be sent
          - Node Sui address lookup fails
      operationId: nodes_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NodesCreateRequest'
        required: true
      responses:
        '200':
          description: Node public address registered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NodesCreateResponse'
        '500':
          description: Failed to register node public address
      x-codeSamples:
        - lang: typescript
          label: nodes_create
          source: |-
            import { AtomaSDK } from "atoma-sdk";

            const atomaSDK = new AtomaSDK({
              bearerAuth: process.env["ATOMASDK_BEARER_AUTH"] ?? "",
            });

            async function run() {
              const result = await atomaSDK.nodes.nodesCreate({
                data: {
                  country: "Andorra",
                  nodeSmallId: 3665,
                  publicAddress: "<value>",
                },
                signature: "<value>",
              });

              // Handle the result
              console.log(result);
            }

            run();
        - lang: python
          label: nodes_create
          source: |-
            from atoma_sdk import AtomaSDK
            import os

            with AtomaSDK(
                bearer_auth=os.getenv("ATOMASDK_BEARER_AUTH", ""),
            ) as atoma_sdk:

                res = atoma_sdk.nodes.nodes_create(data={
                    "country": "Andorra",
                    "node_small_id": 3665,
                    "public_address": "<value>",
                }, signature="<value>")

                # Handle response
                print(res)
components:
  schemas:
    NodesCreateRequest:
      type: object
      description: Represents the payload for the node public address registration request.
      required:
        - data
        - signature
      properties:
        data:
          $ref: '#/components/schemas/NodePublicAddressAssignment'
          description: The data required to register a node's public address
        signature:
          type: string
          description: The signature of the data base 64 encoded
    NodesCreateResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: The message of the response
    NodePublicAddressAssignment:
      type: object
      description: >-
        Represents the payload for the node public address registration request.


        This struct represents the payload for the node public address
        registration request.
      required:
        - node_small_id
        - public_address
        - country
      properties:
        country:
          type: string
          description: The country of the node
        node_small_id:
          type: integer
          format: int64
          description: Unique small integer identifier for the node
          minimum: 0
        public_address:
          type: string
          description: The public address of the node

````