curl --request POST \
--url https://compute.x402layer.cc/compute/provision \
--header 'Content-Type: application/json' \
--data '
{
"plan": "<string>",
"region": "<string>",
"os_id": 123,
"label": "<string>",
"hostname": "<string>",
"prepaid_hours": 25,
"use_credits": true,
"ssh_public_key": "<string>",
"user_data": "<string>"
}
'import requests
url = "https://compute.x402layer.cc/compute/provision"
payload = {
"plan": "<string>",
"region": "<string>",
"os_id": 123,
"label": "<string>",
"hostname": "<string>",
"prepaid_hours": 25,
"use_credits": True,
"ssh_public_key": "<string>",
"user_data": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
plan: '<string>',
region: '<string>',
os_id: 123,
label: '<string>',
hostname: '<string>',
prepaid_hours: 25,
use_credits: true,
ssh_public_key: '<string>',
user_data: '<string>'
})
};
fetch('https://compute.x402layer.cc/compute/provision', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://compute.x402layer.cc/compute/provision",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'plan' => '<string>',
'region' => '<string>',
'os_id' => 123,
'label' => '<string>',
'hostname' => '<string>',
'prepaid_hours' => 25,
'use_credits' => true,
'ssh_public_key' => '<string>',
'user_data' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://compute.x402layer.cc/compute/provision"
payload := strings.NewReader("{\n \"plan\": \"<string>\",\n \"region\": \"<string>\",\n \"os_id\": 123,\n \"label\": \"<string>\",\n \"hostname\": \"<string>\",\n \"prepaid_hours\": 25,\n \"use_credits\": true,\n \"ssh_public_key\": \"<string>\",\n \"user_data\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://compute.x402layer.cc/compute/provision")
.header("Content-Type", "application/json")
.body("{\n \"plan\": \"<string>\",\n \"region\": \"<string>\",\n \"os_id\": 123,\n \"label\": \"<string>\",\n \"hostname\": \"<string>\",\n \"prepaid_hours\": 25,\n \"use_credits\": true,\n \"ssh_public_key\": \"<string>\",\n \"user_data\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.x402layer.cc/compute/provision")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan\": \"<string>\",\n \"region\": \"<string>\",\n \"os_id\": 123,\n \"label\": \"<string>\",\n \"hostname\": \"<string>\",\n \"prepaid_hours\": 25,\n \"use_credits\": true,\n \"ssh_public_key\": \"<string>\",\n \"user_data\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"x402Version": 123,
"accepts": [
{
"scheme": "<string>",
"network": "<string>",
"maxAmountRequired": "<string>",
"resource": "<string>",
"description": "<string>",
"payTo": "<string>",
"asset": "<string>"
}
],
"api_schema": {
"version": 1,
"baseUrl": "<string>",
"routes": [
{
"path": "/users/{id}",
"method": "GET",
"summary": "<string>",
"parameters": [
{
"name": "<string>",
"in": "query",
"type": "string",
"required": true,
"description": "<string>",
"example": "<string>"
}
],
"requestBody": {
"contentType": "application/json",
"fields": [
{
"name": "<string>",
"in": "query",
"type": "string",
"required": true,
"description": "<string>",
"example": "<string>"
}
],
"example": "<string>"
},
"responseExample": "<string>"
}
]
}
}Provision a compute instance
Returns x402 and MPP 402 payment challenges when no payment credential is supplied, or provisions a Vultr or DigitalOcean instance after x402 or MPP payment settlement.
curl --request POST \
--url https://compute.x402layer.cc/compute/provision \
--header 'Content-Type: application/json' \
--data '
{
"plan": "<string>",
"region": "<string>",
"os_id": 123,
"label": "<string>",
"hostname": "<string>",
"prepaid_hours": 25,
"use_credits": true,
"ssh_public_key": "<string>",
"user_data": "<string>"
}
'import requests
url = "https://compute.x402layer.cc/compute/provision"
payload = {
"plan": "<string>",
"region": "<string>",
"os_id": 123,
"label": "<string>",
"hostname": "<string>",
"prepaid_hours": 25,
"use_credits": True,
"ssh_public_key": "<string>",
"user_data": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
plan: '<string>',
region: '<string>',
os_id: 123,
label: '<string>',
hostname: '<string>',
prepaid_hours: 25,
use_credits: true,
ssh_public_key: '<string>',
user_data: '<string>'
})
};
fetch('https://compute.x402layer.cc/compute/provision', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://compute.x402layer.cc/compute/provision",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'plan' => '<string>',
'region' => '<string>',
'os_id' => 123,
'label' => '<string>',
'hostname' => '<string>',
'prepaid_hours' => 25,
'use_credits' => true,
'ssh_public_key' => '<string>',
'user_data' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://compute.x402layer.cc/compute/provision"
payload := strings.NewReader("{\n \"plan\": \"<string>\",\n \"region\": \"<string>\",\n \"os_id\": 123,\n \"label\": \"<string>\",\n \"hostname\": \"<string>\",\n \"prepaid_hours\": 25,\n \"use_credits\": true,\n \"ssh_public_key\": \"<string>\",\n \"user_data\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://compute.x402layer.cc/compute/provision")
.header("Content-Type", "application/json")
.body("{\n \"plan\": \"<string>\",\n \"region\": \"<string>\",\n \"os_id\": 123,\n \"label\": \"<string>\",\n \"hostname\": \"<string>\",\n \"prepaid_hours\": 25,\n \"use_credits\": true,\n \"ssh_public_key\": \"<string>\",\n \"user_data\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.x402layer.cc/compute/provision")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan\": \"<string>\",\n \"region\": \"<string>\",\n \"os_id\": 123,\n \"label\": \"<string>\",\n \"hostname\": \"<string>\",\n \"prepaid_hours\": 25,\n \"use_credits\": true,\n \"ssh_public_key\": \"<string>\",\n \"user_data\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"x402Version": 123,
"accepts": [
{
"scheme": "<string>",
"network": "<string>",
"maxAmountRequired": "<string>",
"resource": "<string>",
"description": "<string>",
"payTo": "<string>",
"asset": "<string>"
}
],
"api_schema": {
"version": 1,
"baseUrl": "<string>",
"routes": [
{
"path": "/users/{id}",
"method": "GET",
"summary": "<string>",
"parameters": [
{
"name": "<string>",
"in": "query",
"type": "string",
"required": true,
"description": "<string>",
"example": "<string>"
}
],
"requestBody": {
"contentType": "application/json",
"fields": [
{
"name": "<string>",
"in": "query",
"type": "string",
"required": true,
"description": "<string>",
"example": "<string>"
}
],
"example": "<string>"
},
"responseExample": "<string>"
}
]
}
}Body
Prepaid runtime in hours (minimum 24). Provision uses prepaid_hours; the extend endpoint uses extend_hours.
x >= 24Pay from prepaid USD credits instead of an x402 wallet payment. Supported for bare and grid machines. NOT supported for ai_machine (private AI Machines require an x402 wallet payment).
Optional provider hint. Plan IDs with do: prefix resolve to DigitalOcean.
vultr, digitalocean x402 payment network. Robinhood Chain settles in USDG; Base and MegaETH settle in USDC; Solana settles in USDC. MPP clients use Authorization: Payment and do not need this field.
base, solana, megaeth, robinhood Optional cloud-init user data run at first boot.
Private AI Machine (Standard tier). When present, the machine self-installs the pinned LLM behind your own OpenAI-compatible endpoint (URL + API key), running llama-server (llama.cpp) on port 8080 exposing /v1 (/v1/chat/completions and /v1/models). Supports x402, MPP, or prepaid credits. Mutually exclusive with deploy_node.
Show child attributes
Show child attributes
Join the grid. When present, the machine self-installs as a network node owned by the paying wallet, earning USDC + SGL (requires 50,000 SGL staked). Requires an x402 Solana payment. Mutually exclusive with ai_machine.
Show child attributes
Show child attributes
Response
Provisioning started
Was this page helpful?
