Open a terminal session (body machine_id)
curl --request POST \
--url https://api.staging.bma.beeos.ai/v1/terminal_sessions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"machine_id": "<string>",
"shell": "<string>",
"cwd": "<string>",
"cols": 2048,
"rows": 256
}
'import requests
url = "https://api.staging.bma.beeos.ai/v1/terminal_sessions"
payload = {
"machine_id": "<string>",
"shell": "<string>",
"cwd": "<string>",
"cols": 2048,
"rows": 256
}
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({
machine_id: '<string>',
shell: '<string>',
cwd: '<string>',
cols: 2048,
rows: 256
})
};
fetch('https://api.staging.bma.beeos.ai/v1/terminal_sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.bma.beeos.ai/v1/terminal_sessions"
payload := strings.NewReader("{\n \"machine_id\": \"<string>\",\n \"shell\": \"<string>\",\n \"cwd\": \"<string>\",\n \"cols\": 2048,\n \"rows\": 256\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))
}{
"type": "terminal_session",
"id": "<string>",
"org_id": "<string>",
"project_id": "<string>",
"machine_id": "<string>",
"state": "starting",
"created_at": "2023-11-07T05:31:56Z",
"shell": "<string>",
"cwd": "<string>",
"cols": 123,
"rows": 123,
"closed_at": "2023-11-07T05:31:56Z",
"exit_code": 123,
"close_reason": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}Terminal sessions
Open a terminal session (body machine_id)
POST
/
terminal_sessions
Open a terminal session (body machine_id)
curl --request POST \
--url https://api.staging.bma.beeos.ai/v1/terminal_sessions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"machine_id": "<string>",
"shell": "<string>",
"cwd": "<string>",
"cols": 2048,
"rows": 256
}
'import requests
url = "https://api.staging.bma.beeos.ai/v1/terminal_sessions"
payload = {
"machine_id": "<string>",
"shell": "<string>",
"cwd": "<string>",
"cols": 2048,
"rows": 256
}
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({
machine_id: '<string>',
shell: '<string>',
cwd: '<string>',
cols: 2048,
rows: 256
})
};
fetch('https://api.staging.bma.beeos.ai/v1/terminal_sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.bma.beeos.ai/v1/terminal_sessions"
payload := strings.NewReader("{\n \"machine_id\": \"<string>\",\n \"shell\": \"<string>\",\n \"cwd\": \"<string>\",\n \"cols\": 2048,\n \"rows\": 256\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))
}{
"type": "terminal_session",
"id": "<string>",
"org_id": "<string>",
"project_id": "<string>",
"machine_id": "<string>",
"state": "starting",
"created_at": "2023-11-07T05:31:56Z",
"shell": "<string>",
"cwd": "<string>",
"cols": 123,
"rows": 123,
"closed_at": "2023-11-07T05:31:56Z",
"exit_code": 123,
"close_reason": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}Authorizations
apiKeybearer
Headers
Project scope. Required when the API key can access more than one project (alias: anthropic-workspace-id).
Replays the first result of a create; the same key with another body is 409.
Required string length:
1 - 255Body
application/json
Response
Success.
Allowed value:
"terminal_session"Terminal session ID (tsn_...).
Pattern:
^tsn_[a-z2-7]{26}$Pattern:
^org_[a-z2-7]{26}$Project ID (proj_...).
Pattern:
^proj_[a-z2-7]{26}$Machine ID (mch_...).
Pattern:
^mch_[a-z2-7]{26}$Available options:
starting, running, closing, closed, failed