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

# Getting started with Serverless AI endpoints: Deploy an nginx server with authentication

export const resource_0 = "endpoint"

Serverless AI lets you deploy and manage endpoints without handling infrastructure yourself. This quickstart shows how to validate basic endpoint functionality with minimal setup. In the web console, **Quick start Serverless endpoint** deploys a ready-made example with preconfigured settings.

## Prerequisites

<Tabs group="interfaces">
  <Tab title="Web console">
    * Make sure you are in a [group](/iam/authorization/groups/index) that has at least the `editor` role within your tenant or project; for example, the default `editors` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.

    * In the [Administration → Limits → Quotas](https://console.nebius.com/quota) section, check the following quotas:

      * **Number of virtual machines** (VMs) under **Compute**: make sure that at least one VM is available.
      * **Total number of allocations** under **Virtual Private Cloud**: make sure that at least one allocation is available.

      If necessary, [increase the quotas](/overview/quotas#change-quotas).
  </Tab>

  <Tab title="CLI">
    * Make sure you are in a [group](/iam/authorization/groups/index) that has at least the `editor` role within your tenant or project; for example, the default `editors` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.

    * In the [Administration → Limits → Quotas](https://console.nebius.com/quota) section, check the following quotas:

      * **Number of virtual machines** (VMs) under **Compute**: make sure that at least one VM is available.
      * **Total number of allocations** under **Virtual Private Cloud**: make sure that at least one allocation is available.

      If necessary, [increase the quotas](/overview/quotas#change-quotas).

    * [Install](/cli/install) and [configure](/cli/configure) the Nebius AI Cloud CLI.

      Check that your project ID is saved in the Nebius AI Cloud CLI profile configuration:

      ```bash theme={null}
      cat ~/.nebius/config.yaml
      ```

    * Install [jq](https://jqlang.org/) to parse JSON output:

          <CodeGroup>
            ```bash Ubuntu theme={null}
            sudo apt-get install jq
            ```

            ```bash macOS theme={null}
            brew install jq
            ```
          </CodeGroup>
  </Tab>
</Tabs>

## Steps

### Create an endpoint

<Tabs group="interfaces">
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/rOlLZ_MFvrheaI-h/_assets/sidebar/serverless-ai.svg?fit=max&auto=format&n=rOlLZ_MFvrheaI-h&q=85&s=4c90b50c6c33e6bff000b87b8e37765a" width="16" height="16" data-path="_assets/sidebar/serverless-ai.svg" /> **Serverless AI** → **Endpoints**.
    2. Click **Quick start Serverless endpoint**. The flow uses a preconfigured container image and default settings.
    3. Click **Create endpoint**.

    Wait for the endpoint to start running.
  </Tab>

  <Tab title="CLI">
    Use `nebius ai create` to create a {resource_0} step by step in the terminal. The command prompts you to enter values to pass as parameters, shows the resulting configuration and then creates the {resource_0}.

    1. Create a token for authorization and save it to an environment variable:

       ```bash theme={null}
       export AUTH_TOKEN=$(openssl rand -hex 32)
       ```

       Use this token in the `--token` parameter when you create the endpoint. You will also need it later to test access to the endpoint.

    2. Run the following command:

       ```bash theme={null}
       nebius ai endpoint create \
         --name qs-endpoint-nginx \
         --image nginx:alpine \
         --platform cpu-d3 \
         --preset 4vcpu-16gb \
         --public \
         --container-port 80 \
         --auth token \
         --token "$AUTH_TOKEN" \
         --subnet-id <subnet_ID>
       ```

       Alternatively, you can run `nebius ai create` and specify each value step by step with CLI prompts. The command pre-fills the following values:

       * `--name`: Endpoint name.
       * `--image`: Container image to run. In the given example, the `nginx:alpine` image is used.
       * `--platform`: VM platform for the endpoint. As Serverless AI endpoints are based on containers over VMs, every endpoint uses [Compute platforms and presets](/compute/virtual-machines/types).
       * `--preset`: Number of vCPUs and RAM allocated to the container. The preset must match the selected platform.
       * `--container-port`: Port on which the application listens in the container. Each HTTP port is available through the endpoint's managed HTTPS URL.
       * `--auth`: Authentication method for the endpoint.
       * `--token`: Token used for endpoint authentication.
       * `--public`: Assigns a public IP address to the endpoint. Not required to reach the endpoint from the internet, because each HTTP port is available through the endpoint's managed HTTPS URL.

    3. When the CLI prompts you to select a project, region or subnet, select from the values that are available.

    4. Review the resulting configuration, then confirm creation.

    Wait for the endpoint to start running.
  </Tab>
</Tabs>

### Test the endpoint

<Tabs group="interfaces">
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/rOlLZ_MFvrheaI-h/_assets/sidebar/serverless-ai.svg?fit=max&auto=format&n=rOlLZ_MFvrheaI-h&q=85&s=4c90b50c6c33e6bff000b87b8e37765a" width="16" height="16" data-path="_assets/sidebar/serverless-ai.svg" /> **Serverless AI** → **Endpoints**.
    2. Click the endpoint name to open its details. Wait until the endpoint is running. Then copy its managed HTTPS URL (`https://...`) from the **Public endpoints** field.
    3. In a terminal, send a request to the endpoint:

       ```bash theme={null}
       curl -v <endpoint_URL>
       ```

       In the command, specify the managed HTTPS URL that you copied earlier.

       The response should have HTTP status `200 OK`. The body is the default nginx welcome page, which confirms that the endpoint is serving traffic over the managed HTTPS URL.
  </Tab>

  <Tab title="CLI">
    1. Save the endpoint ID to an environment variable:

       ```bash theme={null}
       export ENDPOINT_ID=$(nebius ai endpoint get-by-name \
         --name qs-endpoint-nginx --format jsonpath='{.metadata.id}')
       ```

    2. Get the endpoint's managed HTTPS URL from the **Public endpoints** field:

       ```bash theme={null}
       export ENDPOINT_URL=$(nebius ai endpoint get "$ENDPOINT_ID" --format json \
         | jq -r '.status.public_endpoints[] | select(startswith("https://"))' | head -1)
       ```

    3. Test the endpoint with authentication:

       ```bash theme={null}
       curl -v "$ENDPOINT_URL" -H "Authorization: Bearer $AUTH_TOKEN"
       ```

    4. Test the endpoint without a token:

       ```bash theme={null}
       curl -v "$ENDPOINT_URL"
       ```

       The test should fail with the error `401 Unauthorized` or `403 Forbidden`.
  </Tab>
</Tabs>

### View logs

<Tabs group="interfaces">
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/rOlLZ_MFvrheaI-h/_assets/sidebar/serverless-ai.svg?fit=max&auto=format&n=rOlLZ_MFvrheaI-h&q=85&s=4c90b50c6c33e6bff000b87b8e37765a" width="16" height="16" data-path="_assets/sidebar/serverless-ai.svg" /> **Serverless AI** → **Endpoints**.
    2. In the endpoint list, next to the endpoint, click **View logs**. Alternatively, click <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/button-vellipsis.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=e80b8e57c43bfd117679262e6a1334ad" width="12" height="24" data-path="_assets/button-vellipsis.svg" /> → **View logs**.
  </Tab>

  <Tab title="CLI">
    View endpoint logs:

    ```bash theme={null}
    nebius ai endpoint logs $ENDPOINT_ID
    ```
  </Tab>
</Tabs>

### Delete the endpoint

If you no longer need the endpoint, delete it. Once you delete the endpoint, you will not be charged for it.

<Tabs group="interfaces">
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/rOlLZ_MFvrheaI-h/_assets/sidebar/serverless-ai.svg?fit=max&auto=format&n=rOlLZ_MFvrheaI-h&q=85&s=4c90b50c6c33e6bff000b87b8e37765a" width="16" height="16" data-path="_assets/sidebar/serverless-ai.svg" /> **Serverless AI** → **Endpoints**.
    2. In the endpoint list, find the endpoint and click <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/button-vellipsis.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=e80b8e57c43bfd117679262e6a1334ad" width="12" height="24" data-path="_assets/button-vellipsis.svg" /> → **Delete**.
    3. Confirm the endpoint deletion.
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    nebius ai endpoint delete $ENDPOINT_ID
    ```
  </Tab>
</Tabs>

## Expected results

* The endpoint is reachable over its managed HTTPS URL.
* A request without a token in the web console returns `200 OK`.
* A request without a token in the CLI returns `401 Unauthorized` or `403 Forbidden`.
* An endpoint can be deleted successfully.

## See also

* [Deploying a large language model and chatting with it by using Serverless AI endpoints](/serverless/tutorials/deploy-model)
