Skip to main content
POST
/
api
/
v2
/
external
/
execution
/
image
/
start
Start Container execution
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

application/json

Request model for Docker container execution

docker_image_ref
string
required

Docker image reference (e.g., python:3.9)

docker_run_cmd
string[] | null

Command to run in the container

docker_run_env
string | null

Environment variables as string

docker_user
string | null

User to run container as (e.g., '1000', 'nobody', '1000:1000')

docker_registry_credential_type
string | null

Registry auth type (e.g., 'aws', 'basic')

aws_access_key_id
string | null

AWS Access Key ID for ECR

aws_secret_access_key
string | null

AWS Secret Access Key for ECR

aws_session_token
string | null

AWS Session Token for ECR

aws_region
string | null
default:us-east-1

AWS region for ECR

docker_username
string | null

Docker registry username

docker_password
string | null

Docker registry password

timeout
integer
default:60
Required range: 1 <= x <= 600
execution_type
string
default:gpu.l40s
Pattern: ^[a-zA-Z0-9_.]+$
job_type
string | null

Job type (e.g., 'customer_image', 'customer_notebook')

file_name
string | null
enable_s3_mount
boolean
default:false

Whether to enable S3 mount for this execution

s3_mount_path
string
default:/mnt/s3

Path where S3 will be mounted inside the container

user_callback_urls
string[] | null

URLs to call with job completion info

graceful_timeout
integer | null

Seconds to wait for graceful shutdown on cancel (default: 10)

Required range: 1 <= x <= 300

Response

Successful Response

Response model with direct streaming URL

execution_id
string
required
status
string
required
streaming_url
string
required