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, the nginx quick-start configuration deploys a ready-made example with preconfigured settings.
Prerequisites
-
Make sure you are in a group 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 section of the web console.
-
In the Administration → Limits → Quotas 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.
-
Install and configure the Nebius AI Cloud CLI.
Check that your project ID is saved in the Nebius AI Cloud CLI profile configuration:
-
Install jq to parse JSON output:
-
Make sure you are in a group 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 section of the web console.
-
In the Administration → Limits → Quotas 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.
-
Get an access token to authenticate to the REST API.
-
Make sure you are in a group 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 section of the web console.
-
In the Administration → Limits → Quotas 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.
Steps
Create an endpoint
- In the sidebar, go to
Serverless AI → Endpoints.
- Select the nginx quick start card.
The quick start configuration autofills the container image, entrypoint command and default settings.
- Click Create endpoint.
Wait for the endpoint to start running.Use nebius ai create to create a 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 .
-
Create a token for authorization and save it to an environment variable:
Use this token in the
--token parameter when you create the endpoint. You will also need it later to test access to the endpoint.
-
Run the following command:
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 container VMs, every endpoint uses Compute platforms and presets.
--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 managed HTTPS URL of the endpoint.
--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.
-
When the CLI prompts you to select a project, region or subnet, select from the values that are available.
-
Review the resulting configuration, then confirm creation.
Wait for the endpoint to start running.
-
Create a token for endpoint authentication:
Save the token: it is different from the access token that authorizes REST API requests, and you need it to create and test the endpoint.
-
Send the following request. Specify the endpoint authentication token from the previous step in
spec.authToken:
In the Authorization header, replace <access_token> with the access token that you got in the prerequisites.
The request includes the following parameters:
metadata.parentId: Project ID.
metadata.name: Endpoint name.
spec.image: Container image to run.
spec.platform: VM platform for the endpoint. As Serverless AI endpoints are based on containers over VMs, every endpoint uses Compute platforms and presets.
spec.preset: Number of vCPUs and RAM allocated to the container. The preset must match the selected platform.
spec.ports[].containerPort: Port on which the application listens in the container.
spec.ports[].protocol: Protocol used by the exposed port. An HTTP port is available through the endpoint’s managed HTTPS URL.
spec.authToken: Token used for endpoint authentication.
spec.publicIp: Whether to assign a public IP address to the endpoint. A public IP address isn’t required to reach the endpoint through its managed HTTPS URL.
spec.subnetId: Subnet ID.
spec.disk.type: Disk type for the container over VM.
spec.disk.sizeBytes: Disk size in bytes. The specified value is 250 GiB.
The response returns the endpoint ID in the resourceId parameter. Save this value because you need it in later steps.
Wait for the endpoint to start running.
Test the endpoint
-
In the sidebar, go to
Serverless AI → Endpoints.
-
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.
-
In a terminal, send a request to the endpoint:
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.
-
Save the endpoint ID to an environment variable:
-
Get the endpoint’s managed HTTPS URL from the Public endpoints field:
-
Test the endpoint with authentication:
-
Test the endpoint without a token:
The test should fail with the error
401 Unauthorized or 403 Forbidden.
-
Get the endpoint:
In the request, specify:
- Your access token in the
Authorization header.
- In the request path, the endpoint ID returned in the
resourceId parameter when you created the endpoint.
Check the status.state parameter in the response. If the state isn’t RUNNING, wait a few seconds and send the request again.
-
Copy a managed HTTPS URL (
https://...) from the status.publicEndpoints parameter in the response.
-
Test the endpoint with authentication:
-
Test the endpoint without a token:
The test should fail with the error
401 Unauthorized or 403 Forbidden.
View logs
Viewing endpoint logs is available only in the web console and CLI.
- In the sidebar, go to
Serverless AI → Endpoints.
- In the endpoint list, next to the endpoint, click View logs. Alternatively, click
→ View logs.
Delete the endpoint
If you no longer need the endpoint, delete it. Once you delete the endpoint, you will not be charged for it.
- In the sidebar, go to
Serverless AI → Endpoints.
- In the endpoint list, find the endpoint and click
→ Delete.
- Confirm the endpoint deletion.
Send the following request:In the request, specify:
- Your access token in the
Authorization header.
- In the request path, the endpoint ID returned in the
resourceId parameter when you created the endpoint.
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 or REST API returns
401 Unauthorized or 403 Forbidden.
- An endpoint can be deleted successfully.
See also