curl --request POST \
--url https://api.example.com/api/v2/external/execution/image/start \
--header 'Content-Type: application/json' \
--data '
{
"docker_image_ref": "<string>",
"docker_run_cmd": [
"<string>"
],
"docker_run_env": "<string>",
"docker_user": "<string>",
"docker_registry_credential_type": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_session_token": "<string>",
"aws_region": "us-east-1",
"docker_username": "<string>",
"docker_password": "<string>",
"timeout": 60,
"execution_type": "gpu.l40s",
"job_type": "<string>",
"file_name": "<string>",
"enable_s3_mount": false,
"s3_mount_path": "/mnt/s3",
"user_callback_urls": [
"<string>"
],
"graceful_timeout": 150
}
'import requests
url = "https://api.example.com/api/v2/external/execution/image/start"
payload = {
"docker_image_ref": "<string>",
"docker_run_cmd": ["<string>"],
"docker_run_env": "<string>",
"docker_user": "<string>",
"docker_registry_credential_type": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_session_token": "<string>",
"aws_region": "us-east-1",
"docker_username": "<string>",
"docker_password": "<string>",
"timeout": 60,
"execution_type": "gpu.l40s",
"job_type": "<string>",
"file_name": "<string>",
"enable_s3_mount": False,
"s3_mount_path": "/mnt/s3",
"user_callback_urls": ["<string>"],
"graceful_timeout": 150
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
docker_image_ref: '<string>',
docker_run_cmd: ['<string>'],
docker_run_env: '<string>',
docker_user: '<string>',
docker_registry_credential_type: '<string>',
aws_access_key_id: '<string>',
aws_secret_access_key: '<string>',
aws_session_token: '<string>',
aws_region: 'us-east-1',
docker_username: '<string>',
docker_password: '<string>',
timeout: 60,
execution_type: 'gpu.l40s',
job_type: '<string>',
file_name: '<string>',
enable_s3_mount: false,
s3_mount_path: '/mnt/s3',
user_callback_urls: ['<string>'],
graceful_timeout: 150
})
};
fetch('https://api.example.com/api/v2/external/execution/image/start', 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.example.com/api/v2/external/execution/image/start",
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([
'docker_image_ref' => '<string>',
'docker_run_cmd' => [
'<string>'
],
'docker_run_env' => '<string>',
'docker_user' => '<string>',
'docker_registry_credential_type' => '<string>',
'aws_access_key_id' => '<string>',
'aws_secret_access_key' => '<string>',
'aws_session_token' => '<string>',
'aws_region' => 'us-east-1',
'docker_username' => '<string>',
'docker_password' => '<string>',
'timeout' => 60,
'execution_type' => 'gpu.l40s',
'job_type' => '<string>',
'file_name' => '<string>',
'enable_s3_mount' => false,
's3_mount_path' => '/mnt/s3',
'user_callback_urls' => [
'<string>'
],
'graceful_timeout' => 150
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/v2/external/execution/image/start"
payload := strings.NewReader("{\n \"docker_image_ref\": \"<string>\",\n \"docker_run_cmd\": [\n \"<string>\"\n ],\n \"docker_run_env\": \"<string>\",\n \"docker_user\": \"<string>\",\n \"docker_registry_credential_type\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_session_token\": \"<string>\",\n \"aws_region\": \"us-east-1\",\n \"docker_username\": \"<string>\",\n \"docker_password\": \"<string>\",\n \"timeout\": 60,\n \"execution_type\": \"gpu.l40s\",\n \"job_type\": \"<string>\",\n \"file_name\": \"<string>\",\n \"enable_s3_mount\": false,\n \"s3_mount_path\": \"/mnt/s3\",\n \"user_callback_urls\": [\n \"<string>\"\n ],\n \"graceful_timeout\": 150\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v2/external/execution/image/start")
.header("Content-Type", "application/json")
.body("{\n \"docker_image_ref\": \"<string>\",\n \"docker_run_cmd\": [\n \"<string>\"\n ],\n \"docker_run_env\": \"<string>\",\n \"docker_user\": \"<string>\",\n \"docker_registry_credential_type\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_session_token\": \"<string>\",\n \"aws_region\": \"us-east-1\",\n \"docker_username\": \"<string>\",\n \"docker_password\": \"<string>\",\n \"timeout\": 60,\n \"execution_type\": \"gpu.l40s\",\n \"job_type\": \"<string>\",\n \"file_name\": \"<string>\",\n \"enable_s3_mount\": false,\n \"s3_mount_path\": \"/mnt/s3\",\n \"user_callback_urls\": [\n \"<string>\"\n ],\n \"graceful_timeout\": 150\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/external/execution/image/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"docker_image_ref\": \"<string>\",\n \"docker_run_cmd\": [\n \"<string>\"\n ],\n \"docker_run_env\": \"<string>\",\n \"docker_user\": \"<string>\",\n \"docker_registry_credential_type\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_session_token\": \"<string>\",\n \"aws_region\": \"us-east-1\",\n \"docker_username\": \"<string>\",\n \"docker_password\": \"<string>\",\n \"timeout\": 60,\n \"execution_type\": \"gpu.l40s\",\n \"job_type\": \"<string>\",\n \"file_name\": \"<string>\",\n \"enable_s3_mount\": false,\n \"s3_mount_path\": \"/mnt/s3\",\n \"user_callback_urls\": [\n \"<string>\"\n ],\n \"graceful_timeout\": 150\n}"
response = http.request(request)
puts response.read_body{
"execution_id": "<string>",
"status": "<string>",
"streaming_url": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Start Container execution
Start Docker container execution and return direct streaming URL.
The client can then connect directly to the streaming_url to receive output.
curl --request POST \
--url https://api.example.com/api/v2/external/execution/image/start \
--header 'Content-Type: application/json' \
--data '
{
"docker_image_ref": "<string>",
"docker_run_cmd": [
"<string>"
],
"docker_run_env": "<string>",
"docker_user": "<string>",
"docker_registry_credential_type": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_session_token": "<string>",
"aws_region": "us-east-1",
"docker_username": "<string>",
"docker_password": "<string>",
"timeout": 60,
"execution_type": "gpu.l40s",
"job_type": "<string>",
"file_name": "<string>",
"enable_s3_mount": false,
"s3_mount_path": "/mnt/s3",
"user_callback_urls": [
"<string>"
],
"graceful_timeout": 150
}
'import requests
url = "https://api.example.com/api/v2/external/execution/image/start"
payload = {
"docker_image_ref": "<string>",
"docker_run_cmd": ["<string>"],
"docker_run_env": "<string>",
"docker_user": "<string>",
"docker_registry_credential_type": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_session_token": "<string>",
"aws_region": "us-east-1",
"docker_username": "<string>",
"docker_password": "<string>",
"timeout": 60,
"execution_type": "gpu.l40s",
"job_type": "<string>",
"file_name": "<string>",
"enable_s3_mount": False,
"s3_mount_path": "/mnt/s3",
"user_callback_urls": ["<string>"],
"graceful_timeout": 150
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
docker_image_ref: '<string>',
docker_run_cmd: ['<string>'],
docker_run_env: '<string>',
docker_user: '<string>',
docker_registry_credential_type: '<string>',
aws_access_key_id: '<string>',
aws_secret_access_key: '<string>',
aws_session_token: '<string>',
aws_region: 'us-east-1',
docker_username: '<string>',
docker_password: '<string>',
timeout: 60,
execution_type: 'gpu.l40s',
job_type: '<string>',
file_name: '<string>',
enable_s3_mount: false,
s3_mount_path: '/mnt/s3',
user_callback_urls: ['<string>'],
graceful_timeout: 150
})
};
fetch('https://api.example.com/api/v2/external/execution/image/start', 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.example.com/api/v2/external/execution/image/start",
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([
'docker_image_ref' => '<string>',
'docker_run_cmd' => [
'<string>'
],
'docker_run_env' => '<string>',
'docker_user' => '<string>',
'docker_registry_credential_type' => '<string>',
'aws_access_key_id' => '<string>',
'aws_secret_access_key' => '<string>',
'aws_session_token' => '<string>',
'aws_region' => 'us-east-1',
'docker_username' => '<string>',
'docker_password' => '<string>',
'timeout' => 60,
'execution_type' => 'gpu.l40s',
'job_type' => '<string>',
'file_name' => '<string>',
'enable_s3_mount' => false,
's3_mount_path' => '/mnt/s3',
'user_callback_urls' => [
'<string>'
],
'graceful_timeout' => 150
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/v2/external/execution/image/start"
payload := strings.NewReader("{\n \"docker_image_ref\": \"<string>\",\n \"docker_run_cmd\": [\n \"<string>\"\n ],\n \"docker_run_env\": \"<string>\",\n \"docker_user\": \"<string>\",\n \"docker_registry_credential_type\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_session_token\": \"<string>\",\n \"aws_region\": \"us-east-1\",\n \"docker_username\": \"<string>\",\n \"docker_password\": \"<string>\",\n \"timeout\": 60,\n \"execution_type\": \"gpu.l40s\",\n \"job_type\": \"<string>\",\n \"file_name\": \"<string>\",\n \"enable_s3_mount\": false,\n \"s3_mount_path\": \"/mnt/s3\",\n \"user_callback_urls\": [\n \"<string>\"\n ],\n \"graceful_timeout\": 150\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v2/external/execution/image/start")
.header("Content-Type", "application/json")
.body("{\n \"docker_image_ref\": \"<string>\",\n \"docker_run_cmd\": [\n \"<string>\"\n ],\n \"docker_run_env\": \"<string>\",\n \"docker_user\": \"<string>\",\n \"docker_registry_credential_type\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_session_token\": \"<string>\",\n \"aws_region\": \"us-east-1\",\n \"docker_username\": \"<string>\",\n \"docker_password\": \"<string>\",\n \"timeout\": 60,\n \"execution_type\": \"gpu.l40s\",\n \"job_type\": \"<string>\",\n \"file_name\": \"<string>\",\n \"enable_s3_mount\": false,\n \"s3_mount_path\": \"/mnt/s3\",\n \"user_callback_urls\": [\n \"<string>\"\n ],\n \"graceful_timeout\": 150\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/external/execution/image/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"docker_image_ref\": \"<string>\",\n \"docker_run_cmd\": [\n \"<string>\"\n ],\n \"docker_run_env\": \"<string>\",\n \"docker_user\": \"<string>\",\n \"docker_registry_credential_type\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_session_token\": \"<string>\",\n \"aws_region\": \"us-east-1\",\n \"docker_username\": \"<string>\",\n \"docker_password\": \"<string>\",\n \"timeout\": 60,\n \"execution_type\": \"gpu.l40s\",\n \"job_type\": \"<string>\",\n \"file_name\": \"<string>\",\n \"enable_s3_mount\": false,\n \"s3_mount_path\": \"/mnt/s3\",\n \"user_callback_urls\": [\n \"<string>\"\n ],\n \"graceful_timeout\": 150\n}"
response = http.request(request)
puts response.read_body{
"execution_id": "<string>",
"status": "<string>",
"streaming_url": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
Request model for Docker container execution
Docker image reference (e.g., python:3.9)
Command to run in the container
Environment variables as string
User to run container as (e.g., '1000', 'nobody', '1000:1000')
Registry auth type (e.g., 'aws', 'basic')
AWS Access Key ID for ECR
AWS Secret Access Key for ECR
AWS Session Token for ECR
AWS region for ECR
Docker registry username
Docker registry password
1 <= x <= 600^[a-zA-Z0-9_.]+$Job type (e.g., 'customer_image', 'customer_notebook')
Whether to enable S3 mount for this execution
Path where S3 will be mounted inside the container
URLs to call with job completion info
Seconds to wait for graceful shutdown on cancel (default: 10)
1 <= x <= 300
