Python (SDK)
from meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.sandbox.create(session_id="demo-python-20260316", user_id="demo-user", session_kind="standard", ttl_seconds=600, sandbox_features=[], runtime_profile="standard", queue_if_full=False, skip_llm_credential_exchange=False)
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.sandbox.create({
createSessionRequest: {
sessionId: "demo-python-20260316",
sessionKind: "standard",
sandboxFeatures: [],
runtimeProfile: "standard",
},
});
console.log(result);
}
run();using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using System.Collections.Generic;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Sandbox.CreateAsync(body: new MeetKai.MKA1.Types.Components.CreateSessionRequest() {
SessionId = "demo-python-20260316",
SessionKind = SessionKind.Standard,
SandboxFeatures = new List<SandboxFeature>() {},
RuntimeProfile = SandboxRuntimeProfile.Standard,
});
// handle responsecurl --request POST \
--url https://apigw.mka1.com/api/v1/sandbox/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session_id": "demo-python-20260316",
"user_id": "demo-user",
"session_kind": "standard",
"ttl_seconds": 600,
"sandbox_features": [],
"runtime_profile": "standard",
"queue_if_full": false
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
session_id: 'demo-python-20260316',
user_id: 'demo-user',
session_kind: 'standard',
ttl_seconds: 600,
sandbox_features: [],
runtime_profile: 'standard',
queue_if_full: false
})
};
fetch('https://apigw.mka1.com/api/v1/sandbox/sessions', 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://apigw.mka1.com/api/v1/sandbox/sessions",
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([
'session_id' => 'demo-python-20260316',
'user_id' => 'demo-user',
'session_kind' => 'standard',
'ttl_seconds' => 600,
'sandbox_features' => [
],
'runtime_profile' => 'standard',
'queue_if_full' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://apigw.mka1.com/api/v1/sandbox/sessions"
payload := strings.NewReader("{\n \"session_id\": \"demo-python-20260316\",\n \"user_id\": \"demo-user\",\n \"session_kind\": \"standard\",\n \"ttl_seconds\": 600,\n \"sandbox_features\": [],\n \"runtime_profile\": \"standard\",\n \"queue_if_full\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://apigw.mka1.com/api/v1/sandbox/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session_id\": \"demo-python-20260316\",\n \"user_id\": \"demo-user\",\n \"session_kind\": \"standard\",\n \"ttl_seconds\": 600,\n \"sandbox_features\": [],\n \"runtime_profile\": \"standard\",\n \"queue_if_full\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/sandbox/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"session_id\": \"demo-python-20260316\",\n \"user_id\": \"demo-user\",\n \"session_kind\": \"standard\",\n \"ttl_seconds\": 600,\n \"sandbox_features\": [],\n \"runtime_profile\": \"standard\",\n \"queue_if_full\": false\n}"
response = http.request(request)
puts response.read_body{
"session": {
"session_id": "demo-python-20260316",
"user_id": "demo-user",
"status": "idle",
"session_kind": "standard",
"ttl_seconds": 600,
"workspace_expires_at": "2026-03-23T20:40:00Z",
"sandbox_features": [],
"runtime_profile": "standard",
"api_key_id": null,
"permissions": [],
"runner_id": "runner-usw2a-01",
"runner_url": "http://runner:8010",
"runner_zone": "us-west-2a",
"created_at": "2026-03-16T20:40:00Z",
"updated_at": "2026-03-16T20:40:02Z"
},
"session_token": "sandbox_test_20260316_4f9c2b1a",
"sandbox_url": "http://10.0.3.19:8010/v1/sandboxes/demo-python-20260316",
"provider": "runner-firecracker"
}{
"session": {
"session_id": "demo-python-20260316",
"user_id": "demo-user",
"status": "queued",
"session_kind": "standard",
"ttl_seconds": 600,
"workspace_expires_at": "2026-03-23T20:40:00Z",
"sandbox_features": [],
"runtime_profile": "standard",
"api_key_id": null,
"permissions": [],
"runner_id": "runner-usw2a-01",
"runner_url": "http://runner:8010",
"runner_zone": "us-west-2a",
"created_at": "2026-03-16T20:40:00Z",
"updated_at": "2026-03-16T20:41:00Z"
},
"session_token": "sandbox_test_20260316_4f9c2b1a",
"sandbox_url": null,
"provider": null
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Sessions
Criar Sessão
Crie uma sessão sandbox e retorne um token de sessão, provedor e URL base da sandbox. Defina session_kind como browser para iniciar uma sessão com navegador em vez de uma sandbox padrão de comando/código. Defina queue_if_full como true para colocar a solicitação na fila em vez de falhar quando a capacidade do executor estiver temporariamente indisponível.
POST
/
api
/
v1
/
sandbox
/
sessions
Python (SDK)
from meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.sandbox.create(session_id="demo-python-20260316", user_id="demo-user", session_kind="standard", ttl_seconds=600, sandbox_features=[], runtime_profile="standard", queue_if_full=False, skip_llm_credential_exchange=False)
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.sandbox.create({
createSessionRequest: {
sessionId: "demo-python-20260316",
sessionKind: "standard",
sandboxFeatures: [],
runtimeProfile: "standard",
},
});
console.log(result);
}
run();using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using System.Collections.Generic;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Sandbox.CreateAsync(body: new MeetKai.MKA1.Types.Components.CreateSessionRequest() {
SessionId = "demo-python-20260316",
SessionKind = SessionKind.Standard,
SandboxFeatures = new List<SandboxFeature>() {},
RuntimeProfile = SandboxRuntimeProfile.Standard,
});
// handle responsecurl --request POST \
--url https://apigw.mka1.com/api/v1/sandbox/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session_id": "demo-python-20260316",
"user_id": "demo-user",
"session_kind": "standard",
"ttl_seconds": 600,
"sandbox_features": [],
"runtime_profile": "standard",
"queue_if_full": false
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
session_id: 'demo-python-20260316',
user_id: 'demo-user',
session_kind: 'standard',
ttl_seconds: 600,
sandbox_features: [],
runtime_profile: 'standard',
queue_if_full: false
})
};
fetch('https://apigw.mka1.com/api/v1/sandbox/sessions', 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://apigw.mka1.com/api/v1/sandbox/sessions",
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([
'session_id' => 'demo-python-20260316',
'user_id' => 'demo-user',
'session_kind' => 'standard',
'ttl_seconds' => 600,
'sandbox_features' => [
],
'runtime_profile' => 'standard',
'queue_if_full' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://apigw.mka1.com/api/v1/sandbox/sessions"
payload := strings.NewReader("{\n \"session_id\": \"demo-python-20260316\",\n \"user_id\": \"demo-user\",\n \"session_kind\": \"standard\",\n \"ttl_seconds\": 600,\n \"sandbox_features\": [],\n \"runtime_profile\": \"standard\",\n \"queue_if_full\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://apigw.mka1.com/api/v1/sandbox/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session_id\": \"demo-python-20260316\",\n \"user_id\": \"demo-user\",\n \"session_kind\": \"standard\",\n \"ttl_seconds\": 600,\n \"sandbox_features\": [],\n \"runtime_profile\": \"standard\",\n \"queue_if_full\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/sandbox/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"session_id\": \"demo-python-20260316\",\n \"user_id\": \"demo-user\",\n \"session_kind\": \"standard\",\n \"ttl_seconds\": 600,\n \"sandbox_features\": [],\n \"runtime_profile\": \"standard\",\n \"queue_if_full\": false\n}"
response = http.request(request)
puts response.read_body{
"session": {
"session_id": "demo-python-20260316",
"user_id": "demo-user",
"status": "idle",
"session_kind": "standard",
"ttl_seconds": 600,
"workspace_expires_at": "2026-03-23T20:40:00Z",
"sandbox_features": [],
"runtime_profile": "standard",
"api_key_id": null,
"permissions": [],
"runner_id": "runner-usw2a-01",
"runner_url": "http://runner:8010",
"runner_zone": "us-west-2a",
"created_at": "2026-03-16T20:40:00Z",
"updated_at": "2026-03-16T20:40:02Z"
},
"session_token": "sandbox_test_20260316_4f9c2b1a",
"sandbox_url": "http://10.0.3.19:8010/v1/sandboxes/demo-python-20260316",
"provider": "runner-firecracker"
}{
"session": {
"session_id": "demo-python-20260316",
"user_id": "demo-user",
"status": "queued",
"session_kind": "standard",
"ttl_seconds": 600,
"workspace_expires_at": "2026-03-23T20:40:00Z",
"sandbox_features": [],
"runtime_profile": "standard",
"api_key_id": null,
"permissions": [],
"runner_id": "runner-usw2a-01",
"runner_url": "http://runner:8010",
"runner_zone": "us-west-2a",
"created_at": "2026-03-16T20:40:00Z",
"updated_at": "2026-03-16T20:41:00Z"
},
"session_token": "sandbox_test_20260316_4f9c2b1a",
"sandbox_url": null,
"provider": null
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Autorizações
Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
Cabeçalhos
Optional external end-user identifier forwarded by the API gateway.
Corpo
application/json
Opções disponíveis:
standard, browser Intervalo obrigatório:
x >= 1Opções disponíveis:
python, git, claude-code Opções disponíveis:
standard, eval-python Show child attributes
Show child attributes
Esta página foi útil?
⌘I