import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const devboxView = await client.devboxes.shutdown('id');
console.log(devboxView.id);import os
from runloop_api_client import Runloop
client = Runloop(
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
)
devbox_view = client.devboxes.shutdown(
id="id",
)
print(devbox_view.id)curl --request POST \
--url https://api.runloop.ai/v1/devboxes/{id}/shutdown \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runloop.ai/v1/devboxes/{id}/shutdown",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.runloop.ai/v1/devboxes/{id}/shutdown"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.runloop.ai/v1/devboxes/{id}/shutdown")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runloop.ai/v1/devboxes/{id}/shutdown")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "scheduled",
"create_time_ms": 123,
"end_time_ms": 123,
"metadata": {},
"launch_parameters": {
"launch_commands": [
"<string>"
],
"resource_size_request": "X_SMALL",
"available_ports": [
123
],
"keep_alive_time_seconds": 123,
"after_idle": {
"idle_time_seconds": 123,
"on_idle": "shutdown"
},
"custom_cpu_cores": 123,
"custom_gb_memory": 123,
"custom_disk_size": 123,
"architecture": "x86_64",
"user_parameters": {
"username": "<string>",
"uid": 123
},
"required_services": [
"<string>"
],
"network_policy_id": "<string>",
"lifecycle": {
"after_idle": {
"idle_time_seconds": 123,
"on_idle": "shutdown"
},
"resume_triggers": {
"http": true,
"axon_event": true
},
"lifecycle_hooks": {
"suspend_commands": [
"<string>"
],
"suspend_deadline_ms": 123
}
},
"provisioning_tier": "standard"
},
"capabilities": [
"unknown"
],
"state_transitions": [
{
"status": "scheduled",
"transition_time_ms": {},
"failure_reason": "<string>"
}
],
"name": "<string>",
"initiator_type": "unknown",
"initiator_id": "<string>",
"blueprint_id": "<string>",
"snapshot_id": "<string>",
"failure_reason": "out_of_memory",
"shutdown_reason": "api_shutdown",
"tunnel": {
"tunnel_key": "<string>",
"auth_mode": "open",
"create_time_ms": 123,
"http_keep_alive": true,
"wake_on_http": true,
"auth_token": "<string>"
},
"gateway_specs": {},
"mcp_specs": {}
}Shutdown a running Devbox.
Shutdown a running Devbox. This will permanently stop the Devbox. If you want to save the state of the Devbox, you should take a snapshot before shutting down or should suspend the Devbox instead of shutting down. If the Devbox has any in-progress snapshots, the shutdown will be rejected with a 409 Conflict unless force=true is specified.
import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const devboxView = await client.devboxes.shutdown('id');
console.log(devboxView.id);import os
from runloop_api_client import Runloop
client = Runloop(
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
)
devbox_view = client.devboxes.shutdown(
id="id",
)
print(devbox_view.id)curl --request POST \
--url https://api.runloop.ai/v1/devboxes/{id}/shutdown \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runloop.ai/v1/devboxes/{id}/shutdown",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.runloop.ai/v1/devboxes/{id}/shutdown"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.runloop.ai/v1/devboxes/{id}/shutdown")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runloop.ai/v1/devboxes/{id}/shutdown")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "scheduled",
"create_time_ms": 123,
"end_time_ms": 123,
"metadata": {},
"launch_parameters": {
"launch_commands": [
"<string>"
],
"resource_size_request": "X_SMALL",
"available_ports": [
123
],
"keep_alive_time_seconds": 123,
"after_idle": {
"idle_time_seconds": 123,
"on_idle": "shutdown"
},
"custom_cpu_cores": 123,
"custom_gb_memory": 123,
"custom_disk_size": 123,
"architecture": "x86_64",
"user_parameters": {
"username": "<string>",
"uid": 123
},
"required_services": [
"<string>"
],
"network_policy_id": "<string>",
"lifecycle": {
"after_idle": {
"idle_time_seconds": 123,
"on_idle": "shutdown"
},
"resume_triggers": {
"http": true,
"axon_event": true
},
"lifecycle_hooks": {
"suspend_commands": [
"<string>"
],
"suspend_deadline_ms": 123
}
},
"provisioning_tier": "standard"
},
"capabilities": [
"unknown"
],
"state_transitions": [
{
"status": "scheduled",
"transition_time_ms": {},
"failure_reason": "<string>"
}
],
"name": "<string>",
"initiator_type": "unknown",
"initiator_id": "<string>",
"blueprint_id": "<string>",
"snapshot_id": "<string>",
"failure_reason": "out_of_memory",
"shutdown_reason": "api_shutdown",
"tunnel": {
"tunnel_key": "<string>",
"auth_mode": "open",
"create_time_ms": 123,
"http_keep_alive": true,
"wake_on_http": true,
"auth_token": "<string>"
},
"gateway_specs": {},
"mcp_specs": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The Devbox ID.
Query Parameters
If true, force shutdown even if snapshots are in progress. Defaults to false.
Response
OK
A Devbox represents a virtual development environment. It is an isolated sandbox that can be given to agents and used to run arbitrary code such as AI generated code.
The ID of the Devbox.
The current status of the Devbox.
scheduled, queued, provisioning, initializing, running, suspending, suspended, resuming, failure, shutdown Creation time of the Devbox (Unix timestamp milliseconds).
The time the Devbox finished execution (Unix timestamp milliseconds). Present if the Devbox is in a terminal state.
The user defined Devbox metadata.
Show child attributes
Show child attributes
The launch parameters used to create the Devbox.
Show child attributes
Show child attributes
A list of capability groups this devbox has access to.
unknown, docker_in_docker A list of state transitions in order with durations
Show child attributes
Show child attributes
The name of the Devbox.
The type of initiator that created the Devbox.
unknown, api, scenario, scoring_validation, reflex The ID of the initiator that created the Devbox.
The Blueprint ID used in creation of the Devbox, if the devbox was created from a Blueprint.
The Snapshot ID used in creation of the Devbox, if the devbox was created from a Snapshot.
The failure reason if the Devbox failed, if the Devbox has a 'failure' status.
out_of_memory, out_of_disk, execution_failed, health_check_failed The shutdown reason if the Devbox shutdown, if the Devbox has a 'shutdown' status.
api_shutdown, keep_alive_timeout, entrypoint_exit, idle, ttl_expired V2 tunnel information if a tunnel was created at launch time or via the createTunnel API.
Show child attributes
Show child attributes
Gateway specifications configured for this devbox. Map key is the environment variable prefix (e.g., 'GWS_ANTHROPIC').
Show child attributes
Show child attributes
[Beta] MCP specifications configured for this devbox. Map key is the environment variable name for the MCP token envelope. Each spec links an MCP config to a secret for MCP server access through the MCP hub.
Show child attributes
Show child attributes
Was this page helpful?
