curl --request POST \
--url https://api.hyperbrowser.ai/api/sandbox/{id}/processes \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"command": "<string>",
"cwd": "<string>",
"env": {},
"timeoutMs": 43200000,
"runAs": "<string>",
"vault": "<string>",
"secrets": {
"OPENAI_API_KEY": {
"name": "openai-key"
}
}
}
'import requests
url = "https://api.hyperbrowser.ai/api/sandbox/{id}/processes"
payload = {
"command": "<string>",
"cwd": "<string>",
"env": {},
"timeoutMs": 43200000,
"runAs": "<string>",
"vault": "<string>",
"secrets": { "OPENAI_API_KEY": { "name": "openai-key" } }
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
command: '<string>',
cwd: '<string>',
env: {},
timeoutMs: 43200000,
runAs: '<string>',
vault: '<string>',
secrets: {OPENAI_API_KEY: {name: 'openai-key'}}
})
};
fetch('https://api.hyperbrowser.ai/api/sandbox/{id}/processes', 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://api.hyperbrowser.ai/api/sandbox/{id}/processes",
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([
'command' => '<string>',
'cwd' => '<string>',
'env' => [
],
'timeoutMs' => 43200000,
'runAs' => '<string>',
'vault' => '<string>',
'secrets' => [
'OPENAI_API_KEY' => [
'name' => 'openai-key'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hyperbrowser.ai/api/sandbox/{id}/processes"
payload := strings.NewReader("{\n \"command\": \"<string>\",\n \"cwd\": \"<string>\",\n \"env\": {},\n \"timeoutMs\": 43200000,\n \"runAs\": \"<string>\",\n \"vault\": \"<string>\",\n \"secrets\": {\n \"OPENAI_API_KEY\": {\n \"name\": \"openai-key\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.hyperbrowser.ai/api/sandbox/{id}/processes")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"command\": \"<string>\",\n \"cwd\": \"<string>\",\n \"env\": {},\n \"timeoutMs\": 43200000,\n \"runAs\": \"<string>\",\n \"vault\": \"<string>\",\n \"secrets\": {\n \"OPENAI_API_KEY\": {\n \"name\": \"openai-key\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperbrowser.ai/api/sandbox/{id}/processes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"command\": \"<string>\",\n \"cwd\": \"<string>\",\n \"env\": {},\n \"timeoutMs\": 43200000,\n \"runAs\": \"<string>\",\n \"vault\": \"<string>\",\n \"secrets\": {\n \"OPENAI_API_KEY\": {\n \"name\": \"openai-key\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"process": {
"id": "<string>",
"status": "queued",
"command": "<string>",
"cwd": "<string>",
"started_at": 123,
"pid": 123,
"exit_code": 123,
"completed_at": 123
},
"secrets": [
{
"env": "<string>",
"source": {
"type": "vault",
"name": "<string>"
},
"name": "<string>",
"secretId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"secretType": "totp",
"reference": "<string>",
"tokenSecret": "<string>",
"overrides": [
{
"type": "vault",
"name": "<string>"
}
]
}
]
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}Start a sandbox process with secrets
Run a command in a sandbox with secrets or a vault as environment variables for that process only.
curl --request POST \
--url https://api.hyperbrowser.ai/api/sandbox/{id}/processes \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"command": "<string>",
"cwd": "<string>",
"env": {},
"timeoutMs": 43200000,
"runAs": "<string>",
"vault": "<string>",
"secrets": {
"OPENAI_API_KEY": {
"name": "openai-key"
}
}
}
'import requests
url = "https://api.hyperbrowser.ai/api/sandbox/{id}/processes"
payload = {
"command": "<string>",
"cwd": "<string>",
"env": {},
"timeoutMs": 43200000,
"runAs": "<string>",
"vault": "<string>",
"secrets": { "OPENAI_API_KEY": { "name": "openai-key" } }
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
command: '<string>',
cwd: '<string>',
env: {},
timeoutMs: 43200000,
runAs: '<string>',
vault: '<string>',
secrets: {OPENAI_API_KEY: {name: 'openai-key'}}
})
};
fetch('https://api.hyperbrowser.ai/api/sandbox/{id}/processes', 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://api.hyperbrowser.ai/api/sandbox/{id}/processes",
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([
'command' => '<string>',
'cwd' => '<string>',
'env' => [
],
'timeoutMs' => 43200000,
'runAs' => '<string>',
'vault' => '<string>',
'secrets' => [
'OPENAI_API_KEY' => [
'name' => 'openai-key'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hyperbrowser.ai/api/sandbox/{id}/processes"
payload := strings.NewReader("{\n \"command\": \"<string>\",\n \"cwd\": \"<string>\",\n \"env\": {},\n \"timeoutMs\": 43200000,\n \"runAs\": \"<string>\",\n \"vault\": \"<string>\",\n \"secrets\": {\n \"OPENAI_API_KEY\": {\n \"name\": \"openai-key\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.hyperbrowser.ai/api/sandbox/{id}/processes")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"command\": \"<string>\",\n \"cwd\": \"<string>\",\n \"env\": {},\n \"timeoutMs\": 43200000,\n \"runAs\": \"<string>\",\n \"vault\": \"<string>\",\n \"secrets\": {\n \"OPENAI_API_KEY\": {\n \"name\": \"openai-key\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperbrowser.ai/api/sandbox/{id}/processes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"command\": \"<string>\",\n \"cwd\": \"<string>\",\n \"env\": {},\n \"timeoutMs\": 43200000,\n \"runAs\": \"<string>\",\n \"vault\": \"<string>\",\n \"secrets\": {\n \"OPENAI_API_KEY\": {\n \"name\": \"openai-key\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"process": {
"id": "<string>",
"status": "queued",
"command": "<string>",
"cwd": "<string>",
"started_at": 123,
"pid": 123,
"exit_code": 123,
"completed_at": 123
},
"secrets": [
{
"env": "<string>",
"source": {
"type": "vault",
"name": "<string>"
},
"name": "<string>",
"secretId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"secretType": "totp",
"reference": "<string>",
"tokenSecret": "<string>",
"overrides": [
{
"type": "vault",
"name": "<string>"
}
]
}
]
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"error": "<string>",
"requiredScopes": [
"<string>"
],
"retryable": true,
"details": {}
}Authorizations
Path Parameters
Sandbox ID.
Body
Provide secrets, vault, or both.
Shell command to run.
1 - 8192Working directory.
4096Plain environment variables. A variable that vault or secrets sets can't also be in env (400 SECRET_SOURCES_INVALID).
Show child attributes
Show child attributes
Process timeout in milliseconds.
0 <= x <= 86400000User to run the process as.
128Name of a vault whose variables to set. Applied before secrets. Together they set at most 32 variables. A vault without entries returns 400 SECRET_SOURCES_INVALID, and an unknown one 404 VAULT_NOT_FOUND.
^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$Secrets to set as environment variables for this process only, merged over the vault's variables, so secrets wins on a clash. They aren't added to the sandbox's default environment.
Show child attributes
Show child attributes
{
"OPENAI_API_KEY": { "name": "openai-key" }
}
Was this page helpful?