curl --request POST \
--url https://console.gmicloud.ai/api/v2/sandboxes/{id}/resume \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"timeout": 123
}'import requests
url = "https://console.gmicloud.ai/api/v2/sandboxes/{id}/resume"
payload = { "timeout": 123 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({timeout: 123})
};
fetch('https://console.gmicloud.ai/api/v2/sandboxes/{id}/resume', 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://console.gmicloud.ai/api/v2/sandboxes/{id}/resume",
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([
'timeout' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://console.gmicloud.ai/api/v2/sandboxes/{id}/resume"
payload := strings.NewReader("{\n \"timeout\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://console.gmicloud.ai/api/v2/sandboxes/{id}/resume")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"timeout\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.gmicloud.ai/api/v2/sandboxes/{id}/resume")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"timeout\": 123\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": "pausing"
}
}{
"code": "Parameter.Invalid",
"message": "Invalid request parameters",
"request_id": "req-xxxx"
}{
"code": "Auth.Unauthorized",
"message": "Authentication required",
"request_id": "req-xxxx"
}{
"code": "Resource.QuotaExceeded",
"message": "The resource quota is not enough.",
"request_id": "req-xxxx",
"trace_id": "<string>",
"details": {}
}{
"code": "Resource.NotFound",
"message": "The requested resource was not found",
"request_id": "req-xxxx"
}{
"code": "Resource.QuotaExceeded",
"message": "The resource quota is not enough.",
"request_id": "req-xxxx",
"trace_id": "<string>",
"details": {}
}{
"code": "Request.Canceled",
"message": "Request canceled",
"request_id": "req-xxxx"
}{
"code": "System.Internal",
"message": "An internal server error occurred",
"request_id": "req-xxxx"
}{
"code": "Request.Timeout",
"message": "Request timed out",
"request_id": "req-xxxx"
}Resume a paused sandbox
Wakes a paused sandbox. This is the only way to wake one — /connect no longer wakes an instance as a side effect. Only a paused instance can be resumed; any other state returns 409.
Acceptance returns 202. The state in the response is the state on the row at submission time (resuming, or running when the backing infrastructure settles within the request); poll GET /sandboxes/{id} for the final outcome.
timeout (seconds) defaults to the runtime that was left at the moment of the pause (paused time is not counted) when omitted or 0 or less; when provided, it replaces that value. Either way the account’s maximum lifetime cap applies, and exceeding it returns 400. A resume re-signs the sandbox_access_token (its validity is bound to end_at), so call /connect again for a fresh token once the state is running.
If the resume fails the instance returns to paused with its files intact and can be retried. The one exception is an instance the backing infrastructure reports as gone: the paused data is lost with it, the instance moves to reclamation, and polling will show deleting.
Resume restores disk, memory, and process state. Existing processes continue without re-running the template startup command. Reconnect network and shell connections after resume; instance readiness and endpoint availability are checked separately.
curl --request POST \
--url https://console.gmicloud.ai/api/v2/sandboxes/{id}/resume \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"timeout": 123
}'import requests
url = "https://console.gmicloud.ai/api/v2/sandboxes/{id}/resume"
payload = { "timeout": 123 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({timeout: 123})
};
fetch('https://console.gmicloud.ai/api/v2/sandboxes/{id}/resume', 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://console.gmicloud.ai/api/v2/sandboxes/{id}/resume",
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([
'timeout' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://console.gmicloud.ai/api/v2/sandboxes/{id}/resume"
payload := strings.NewReader("{\n \"timeout\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://console.gmicloud.ai/api/v2/sandboxes/{id}/resume")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"timeout\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.gmicloud.ai/api/v2/sandboxes/{id}/resume")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"timeout\": 123\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": "pausing"
}
}{
"code": "Parameter.Invalid",
"message": "Invalid request parameters",
"request_id": "req-xxxx"
}{
"code": "Auth.Unauthorized",
"message": "Authentication required",
"request_id": "req-xxxx"
}{
"code": "Resource.QuotaExceeded",
"message": "The resource quota is not enough.",
"request_id": "req-xxxx",
"trace_id": "<string>",
"details": {}
}{
"code": "Resource.NotFound",
"message": "The requested resource was not found",
"request_id": "req-xxxx"
}{
"code": "Resource.QuotaExceeded",
"message": "The resource quota is not enough.",
"request_id": "req-xxxx",
"trace_id": "<string>",
"details": {}
}{
"code": "Request.Canceled",
"message": "Request canceled",
"request_id": "req-xxxx"
}{
"code": "System.Internal",
"message": "An internal server error occurred",
"request_id": "req-xxxx"
}{
"code": "Request.Timeout",
"message": "Request timed out",
"request_id": "req-xxxx"
}Authorizations
API Key or Access Token, always sent as Authorization: Bearer <token>. The gateway recognizes the token type automatically.
Path Parameters
Unique sandbox resource ID (UUID; the id field of the create response). The data-plane key (sandbox_key) cannot be used here.
Body
The whole body may be omitted; omitting it keeps the runtime that was left at the moment of the pause.
Time-to-live after the resume, in seconds. When omitted or 0 or less, the runtime left at the moment of the pause is kept (paused time is not counted). Subject to the account's maximum lifetime cap; exceeding it returns 400.