# Run the built-in sandbox runtime self-test POST https://api.chaser.sh/v1/sessions/{id}/self-test Execute a built-in diagnostic inside an existing sandbox session and return structured runtime details for troubleshooting PTY/exec/MCP environment parity. Reference: https://docs.chaser.sh/api-reference/chaser-core-api/sessions/self-test-session ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: Chaser Core API version: 1.0.0 paths: /v1/sessions/{id}/self-test: post: operationId: self-test-session summary: Run the built-in sandbox runtime self-test description: >- Execute a built-in diagnostic inside an existing sandbox session and return structured runtime details for troubleshooting PTY/exec/MCP environment parity. tags: - subpackage_sessions parameters: - name: id in: path description: Session ID required: true schema: type: string - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: Sandbox runtime self-test completed content: application/json: schema: $ref: '#/components/schemas/SessionSelfTestResponse' '400': description: Invalid request or non-sandbox session content: application/json: schema: description: Any type '404': description: Session not found content: application/json: schema: description: Any type servers: - url: https://api.chaser.sh - url: http://localhost:8000 components: schemas: SessionRuntimeChaserInfo: type: object properties: agent_brief_path: type: - string - 'null' agent_impl: type: - string - 'null' image: type: - string - 'null' runtime_env: type: - string - 'null' session_id: type: - string - 'null' toolchain_attached: type: boolean toolchain_root: type: - string - 'null' workspace_id: type: - string - 'null' workspace_root: type: - string - 'null' required: - toolchain_attached title: SessionRuntimeChaserInfo SessionRuntimeProxyInfo: type: object properties: all_proxy: type: - string - 'null' http_proxy: type: - string - 'null' https_proxy: type: - string - 'null' no_proxy: type: - string - 'null' title: SessionRuntimeProxyInfo SessionRuntimeToolVersionsInfo: type: object properties: bun: type: - string - 'null' cargo: type: - string - 'null' git: type: - string - 'null' go: type: - string - 'null' node: type: - string - 'null' python3: type: - string - 'null' rustc: type: - string - 'null' title: SessionRuntimeToolVersionsInfo SessionRuntimeToolsInfo: type: object properties: bun: type: - string - 'null' cargo: type: - string - 'null' git: type: - string - 'null' go: type: - string - 'null' node: type: - string - 'null' python3: type: - string - 'null' rustc: type: - string - 'null' title: SessionRuntimeToolsInfo SessionRuntimeInfo: type: object properties: chaser: $ref: '#/components/schemas/SessionRuntimeChaserInfo' chaser_agent: type: boolean chaser_exec: type: boolean chaser_mode: type: - string - 'null' cwd: type: string home: type: string lang: type: - string - 'null' path: type: string path_entries: type: array items: type: string proxy: $ref: '#/components/schemas/SessionRuntimeProxyInfo' shell: type: - string - 'null' term: type: - string - 'null' tool_versions: $ref: '#/components/schemas/SessionRuntimeToolVersionsInfo' tools: $ref: '#/components/schemas/SessionRuntimeToolsInfo' user: type: string workspace_root_present: type: boolean required: - chaser - chaser_agent - chaser_exec - cwd - home - path - path_entries - proxy - tool_versions - tools - user - workspace_root_present title: SessionRuntimeInfo SessionSelfTestResponse: type: object properties: kind: type: string runtime: $ref: '#/components/schemas/SessionRuntimeInfo' session_id: type: string status: type: string workspace_id: type: - string - 'null' required: - kind - runtime - session_id - status title: SessionSelfTestResponse securitySchemes: BearerAuth: type: http scheme: bearer ``` ## SDK Code Examples ```python import requests url = "https://api.chaser.sh/v1/sessions/id/self-test" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.chaser.sh/v1/sessions/id/self-test'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.chaser.sh/v1/sessions/id/self-test" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.chaser.sh/v1/sessions/id/self-test") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.chaser.sh/v1/sessions/id/self-test") .header("Authorization", "Bearer ") .asString(); ``` ```php request('POST', 'https://api.chaser.sh/v1/sessions/id/self-test', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.chaser.sh/v1/sessions/id/self-test"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.chaser.sh/v1/sessions/id/self-test")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```