Extend compute instance expiry
curl --request POST \
--url https://compute.x402layer.cc/compute/instances/{id}/extend \
--header 'Content-Type: application/json' \
--data '
{
"extend_hours": 25
}
'import requests
url = "https://compute.x402layer.cc/compute/instances/{id}/extend"
payload = { "extend_hours": 25 }
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({extend_hours: 25})
};
fetch('https://compute.x402layer.cc/compute/instances/{id}/extend', 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/instances/{id}/extend",
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([
'extend_hours' => 25
]),
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/instances/{id}/extend"
payload := strings.NewReader("{\n \"extend_hours\": 25\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/instances/{id}/extend")
.header("Content-Type", "application/json")
.body("{\n \"extend_hours\": 25\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.x402layer.cc/compute/instances/{id}/extend")
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 \"extend_hours\": 25\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>"
}
]
}
}Singularity Compute
Extend compute instance
POST
/
compute
/
instances
/
{id}
/
extend
Extend compute instance expiry
curl --request POST \
--url https://compute.x402layer.cc/compute/instances/{id}/extend \
--header 'Content-Type: application/json' \
--data '
{
"extend_hours": 25
}
'import requests
url = "https://compute.x402layer.cc/compute/instances/{id}/extend"
payload = { "extend_hours": 25 }
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({extend_hours: 25})
};
fetch('https://compute.x402layer.cc/compute/instances/{id}/extend', 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/instances/{id}/extend",
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([
'extend_hours' => 25
]),
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/instances/{id}/extend"
payload := strings.NewReader("{\n \"extend_hours\": 25\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/instances/{id}/extend")
.header("Content-Type", "application/json")
.body("{\n \"extend_hours\": 25\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.x402layer.cc/compute/instances/{id}/extend")
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 \"extend_hours\": 25\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>"
}
]
}
}Path Parameters
Body
application/json
Additional prepaid runtime in hours (minimum 24). This endpoint uses extend_hours; provision uses prepaid_hours.
Required range:
x >= 24x402 payment network. MPP clients use Authorization: Payment and do not need this field.
Available options:
base, solana Response
Instance extended
Was this page helpful?
⌘I
