Run a command and stream its output
curl --request POST \
--url https://api.styne.ai/sandboxes/{id}/exec \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cmd": "<string>",
"args": [
"<string>"
],
"argv": [
"<string>"
],
"shell": "<string>",
"envs": {},
"cwd": "<string>",
"user": "<string>",
"timeoutMs": 123,
"stdin": true,
"pty": "<unknown>"
}
'import requests
url = "https://api.styne.ai/sandboxes/{id}/exec"
payload = {
"cmd": "<string>",
"args": ["<string>"],
"argv": ["<string>"],
"shell": "<string>",
"envs": {},
"cwd": "<string>",
"user": "<string>",
"timeoutMs": 123,
"stdin": True,
"pty": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cmd: '<string>',
args: ['<string>'],
argv: ['<string>'],
shell: '<string>',
envs: {},
cwd: '<string>',
user: '<string>',
timeoutMs: 123,
stdin: true,
pty: '<unknown>'
})
};
fetch('https://api.styne.ai/sandboxes/{id}/exec', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 123,
"message": "<string>",
"error_code": "<string>",
"origin": "<string>",
"request_id": "<string>"
}Run a command and stream its output
POST
/
sandboxes
/
{id}
/
exec
Run a command and stream its output
curl --request POST \
--url https://api.styne.ai/sandboxes/{id}/exec \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cmd": "<string>",
"args": [
"<string>"
],
"argv": [
"<string>"
],
"shell": "<string>",
"envs": {},
"cwd": "<string>",
"user": "<string>",
"timeoutMs": 123,
"stdin": true,
"pty": "<unknown>"
}
'import requests
url = "https://api.styne.ai/sandboxes/{id}/exec"
payload = {
"cmd": "<string>",
"args": ["<string>"],
"argv": ["<string>"],
"shell": "<string>",
"envs": {},
"cwd": "<string>",
"user": "<string>",
"timeoutMs": 123,
"stdin": True,
"pty": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cmd: '<string>',
args: ['<string>'],
argv: ['<string>'],
shell: '<string>',
envs: {},
cwd: '<string>',
user: '<string>',
timeoutMs: 123,
stdin: true,
pty: '<unknown>'
})
};
fetch('https://api.styne.ai/sandboxes/{id}/exec', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 123,
"message": "<string>",
"error_code": "<string>",
"origin": "<string>",
"request_id": "<string>"
}Authorizations
Body
application/json
Run one command and wait for it to finish. Give cmd (run through a shell unless argv is set) or argv.
Response
Success. The answer is described on https://docs.styne.ai/exec.