curl --request POST \
--url https://compute.x402layer.cc/pods/v1/pods/{id}/chat-ticket \
--header 'X-API-Key: <api-key>'import requests
url = "https://compute.x402layer.cc/pods/v1/pods/{id}/chat-ticket"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://compute.x402layer.cc/pods/v1/pods/{id}/chat-ticket', 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/v1/pods/{id}/chat-ticket",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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/v1/pods/{id}/chat-ticket"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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/v1/pods/{id}/chat-ticket")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.x402layer.cc/pods/v1/pods/{id}/chat-ticket")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"chat": {
"ticket": "<string>",
"expires_in_seconds": 60,
"scope": "chat",
"shared_session": "<string>",
"websocket_url": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Mint a chat ticket for the streaming socket
Base URL https://compute.x402layer.cc/pods/v1. Auth is X-API-Key only. This is the PROGRAMMATIC surface and is NOT the same as the dashboard pod routes (POST /pods, PATCH /pods/{id}/settings, …), which take a wallet signature or a browser session and are free to change. Every response carries x-request-id.
A short-lived (about 60 second) ticket for the pod’s streaming WebSocket. The socket is not proxied through this API; you connect to it directly with the returned websocket_url. The ticket is the auth boundary, which is why it is minted here rather than letting you hand an API key to a browser.
Scope matters. The socket’s frame set is not just chat - it also dispatches file read/write, skill install and backup create/restore. An ordinary API key therefore gets a chat-scoped ticket and the channel drops every other frame type. full scope needs a key minted with pods:control:write. Attachments and interruption are full only. The response states which scope was issued rather than letting you find out by rejected frame.
A chat ticket still shares a conversation. The pod runs ONE session, so an end user can ask the agent about earlier turns and be told. Replies are routed per turn id, so nobody passively reads someone else’s stream, but the history is common ground. Issue tickets to your own server or a signed-in user, not to the anonymous public.
The ticket rides in the query string, which is fine for 60 seconds but IS captured in request logs. Treat the URL as the secret and do not persist it. Most integrations do not need this at all: the OpenAI-compatible endpoint covers request/response chat and is per-request isolated in a way this socket is not. Rate limit: the shared write bucket, 60 requests/minute per account.
curl --request POST \
--url https://compute.x402layer.cc/pods/v1/pods/{id}/chat-ticket \
--header 'X-API-Key: <api-key>'import requests
url = "https://compute.x402layer.cc/pods/v1/pods/{id}/chat-ticket"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://compute.x402layer.cc/pods/v1/pods/{id}/chat-ticket', 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/v1/pods/{id}/chat-ticket",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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/v1/pods/{id}/chat-ticket"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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/v1/pods/{id}/chat-ticket")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.x402layer.cc/pods/v1/pods/{id}/chat-ticket")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"chat": {
"ticket": "<string>",
"expires_in_seconds": 60,
"scope": "chat",
"shared_session": "<string>",
"websocket_url": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Authorizations
A compute API key (x402c_...). Mint one in the dashboard under Settings -> API Keys. This is the ONLY auth /pods/v1/* accepts - wallet signatures are bound to method+path+body and do not survive the internal hop, so signature callers must use the dashboard routes instead. Two extra scopes gate the dangerous powers: pods:wallet:write (pod wallet money, backup passphrase) and pods:control:write (connectors, full-power control socket).
Path Parameters
Pod id, as returned by create/list.
Response
Ticket issued.
Show child attributes
Show child attributes
Was this page helpful?
