curl --request POST \
--url https://compute.x402layer.cc/pods/{id}/coding/terminalimport requests
url = "https://compute.x402layer.cc/pods/{id}/coding/terminal"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://compute.x402layer.cc/pods/{id}/coding/terminal', 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/pods/{id}/coding/terminal",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://compute.x402layer.cc/pods/{id}/coding/terminal"
req, _ := http.NewRequest("POST", url, nil)
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/pods/{id}/coding/terminal")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.x402layer.cc/pods/{id}/coding/terminal")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"ticket": "<string>",
"ttl_seconds": 60,
"path": "/pods/screen/<ticket>"
}Open a Coding sandbox terminal
Mints a single-use ticket for the terminal of a Coding sandbox (an Agent Pod running Claude Code, Codex, OpenCode or Pi). It is the same path the browser terminal uses: the WebSocket is relayed through the sandbox’s own outbound connection, with no SSH and no open port.
Open wss://compute.x402layer.cc + path within ttl_seconds (60). The ticket works once. On the socket, send a text frame {"cols": N, "rows": M} to set the terminal size; binary frames you send are keystrokes and binary frames you receive are terminal output. Close code 4006 means the terminal closed after 10 idle minutes.
Auth: a compute API key (X-API-Key) with pods:control:write, or a wallet signature, same as /compute/*. Keys from a Google, GitHub or X login work here. A sleeping sandbox wakes when you connect.
curl --request POST \
--url https://compute.x402layer.cc/pods/{id}/coding/terminalimport requests
url = "https://compute.x402layer.cc/pods/{id}/coding/terminal"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://compute.x402layer.cc/pods/{id}/coding/terminal', 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/pods/{id}/coding/terminal",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://compute.x402layer.cc/pods/{id}/coding/terminal"
req, _ := http.NewRequest("POST", url, nil)
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/pods/{id}/coding/terminal")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.x402layer.cc/pods/{id}/coding/terminal")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"ticket": "<string>",
"ttl_seconds": 60,
"path": "/pods/screen/<ticket>"
}Was this page helpful?
