curl --request POST \
--url https://levers9.uselevers.com/stubs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"objectId": "<string>",
"imageId": "<string>",
"stubType": "<string>",
"name": "<string>",
"pythonVersion": "<string>",
"cpu": "<string>",
"memory": "<string>",
"gpu": "<string>",
"handler": "<string>",
"retries": 123,
"timeout": "<string>",
"keepWarmSeconds": 123,
"workers": 123,
"maxPendingTasks": 123,
"volumes": [
{
"id": "<string>",
"mountPath": "<string>",
"config": {
"bucketName": "<string>",
"accessKey": "<string>",
"secretKey": "<string>",
"endpointUrl": "<string>",
"region": "<string>",
"readOnly": true,
"forcePathStyle": true
}
}
],
"forceCreate": true,
"onStart": "<string>",
"callbackUrl": "<string>",
"authorized": true,
"secrets": [
{
"name": "<string>"
}
],
"autoscaler": {
"type": "<string>",
"maxContainers": 123,
"tasksPerContainer": 123,
"minContainers": 123
},
"taskPolicy": {
"timeout": "<string>",
"maxRetries": 123,
"ttl": 123
},
"concurrentRequests": 123,
"extra": "<string>",
"checkpointEnabled": true,
"gpuCount": 123,
"onDeploy": "<string>",
"onDeployStubId": "<string>",
"entrypoint": [
"<string>"
],
"ports": [
123
],
"env": [
"<string>"
],
"appName": "<string>",
"pricing": {
"maxInFlight": "<string>",
"costModel": "<string>",
"costPerTask": 123,
"costPerTaskDurationMs": 123
},
"inputs": {
"fields": {}
},
"outputs": {
"fields": {}
},
"tcp": true,
"blockNetwork": true,
"allowList": [
"<string>"
],
"dockerEnabled": true,
"pool": {
"name": "<string>",
"gpu": [
"<string>"
],
"nodes": 123,
"ttl": "<string>",
"maxSpend": 123,
"providers": [
"<string>"
],
"regions": [
"<string>"
],
"minReliability": 123,
"selector": "<string>",
"mode": "<string>",
"transport": "<string>",
"fallback": "<string>",
"priority": 123,
"offerId": "<string>",
"containerRuntime": "<string>"
},
"isService": true,
"serving": {
"appKind": "<string>",
"servingProtocol": "<string>",
"llm": {
"modelId": "<string>",
"engine": "<string>",
"servedModelName": "<string>",
"contextLength": "<string>",
"tokenizer": "<string>",
"metricsPath": "<string>",
"sloTier": "<string>"
},
"database": {
"kind": "<string>",
"port": 123,
"readinessProbe": "<string>",
"connectionEnvName": "<string>",
"credentialSecretNames": [
"<string>"
],
"durabilityMode": "<string>",
"usernameSecretName": "<string>",
"passwordSecretName": "<string>",
"databaseSecretName": "<string>",
"connectionUrlSecretName": "<string>"
}
},
"disks": [
{
"name": "<string>",
"size": "<string>",
"mountPath": "<string>",
"filesystem": "<string>",
"driver": "<string>",
"readOnly": true,
"sourceSnapshotId": "<string>"
}
],
"allowMarketplace": true,
"checkpointTrigger": {
"type": "<string>",
"httpPath": "<string>",
"httpPort": 123,
"timeoutSeconds": 123,
"intervalSeconds": 123
},
"hostname": "<string>",
"persistentRoot": {
"size": "<string>",
"sourceSnapshotId": "<string>",
"name": "<string>"
}
}
'import requests
url = "https://levers9.uselevers.com/stubs"
payload = {
"objectId": "<string>",
"imageId": "<string>",
"stubType": "<string>",
"name": "<string>",
"pythonVersion": "<string>",
"cpu": "<string>",
"memory": "<string>",
"gpu": "<string>",
"handler": "<string>",
"retries": 123,
"timeout": "<string>",
"keepWarmSeconds": 123,
"workers": 123,
"maxPendingTasks": 123,
"volumes": [
{
"id": "<string>",
"mountPath": "<string>",
"config": {
"bucketName": "<string>",
"accessKey": "<string>",
"secretKey": "<string>",
"endpointUrl": "<string>",
"region": "<string>",
"readOnly": True,
"forcePathStyle": True
}
}
],
"forceCreate": True,
"onStart": "<string>",
"callbackUrl": "<string>",
"authorized": True,
"secrets": [{ "name": "<string>" }],
"autoscaler": {
"type": "<string>",
"maxContainers": 123,
"tasksPerContainer": 123,
"minContainers": 123
},
"taskPolicy": {
"timeout": "<string>",
"maxRetries": 123,
"ttl": 123
},
"concurrentRequests": 123,
"extra": "<string>",
"checkpointEnabled": True,
"gpuCount": 123,
"onDeploy": "<string>",
"onDeployStubId": "<string>",
"entrypoint": ["<string>"],
"ports": [123],
"env": ["<string>"],
"appName": "<string>",
"pricing": {
"maxInFlight": "<string>",
"costModel": "<string>",
"costPerTask": 123,
"costPerTaskDurationMs": 123
},
"inputs": { "fields": {} },
"outputs": { "fields": {} },
"tcp": True,
"blockNetwork": True,
"allowList": ["<string>"],
"dockerEnabled": True,
"pool": {
"name": "<string>",
"gpu": ["<string>"],
"nodes": 123,
"ttl": "<string>",
"maxSpend": 123,
"providers": ["<string>"],
"regions": ["<string>"],
"minReliability": 123,
"selector": "<string>",
"mode": "<string>",
"transport": "<string>",
"fallback": "<string>",
"priority": 123,
"offerId": "<string>",
"containerRuntime": "<string>"
},
"isService": True,
"serving": {
"appKind": "<string>",
"servingProtocol": "<string>",
"llm": {
"modelId": "<string>",
"engine": "<string>",
"servedModelName": "<string>",
"contextLength": "<string>",
"tokenizer": "<string>",
"metricsPath": "<string>",
"sloTier": "<string>"
},
"database": {
"kind": "<string>",
"port": 123,
"readinessProbe": "<string>",
"connectionEnvName": "<string>",
"credentialSecretNames": ["<string>"],
"durabilityMode": "<string>",
"usernameSecretName": "<string>",
"passwordSecretName": "<string>",
"databaseSecretName": "<string>",
"connectionUrlSecretName": "<string>"
}
},
"disks": [
{
"name": "<string>",
"size": "<string>",
"mountPath": "<string>",
"filesystem": "<string>",
"driver": "<string>",
"readOnly": True,
"sourceSnapshotId": "<string>"
}
],
"allowMarketplace": True,
"checkpointTrigger": {
"type": "<string>",
"httpPath": "<string>",
"httpPort": 123,
"timeoutSeconds": 123,
"intervalSeconds": 123
},
"hostname": "<string>",
"persistentRoot": {
"size": "<string>",
"sourceSnapshotId": "<string>",
"name": "<string>"
}
}
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({
objectId: '<string>',
imageId: '<string>',
stubType: '<string>',
name: '<string>',
pythonVersion: '<string>',
cpu: '<string>',
memory: '<string>',
gpu: '<string>',
handler: '<string>',
retries: 123,
timeout: '<string>',
keepWarmSeconds: 123,
workers: 123,
maxPendingTasks: 123,
volumes: [
{
id: '<string>',
mountPath: '<string>',
config: {
bucketName: '<string>',
accessKey: '<string>',
secretKey: '<string>',
endpointUrl: '<string>',
region: '<string>',
readOnly: true,
forcePathStyle: true
}
}
],
forceCreate: true,
onStart: '<string>',
callbackUrl: '<string>',
authorized: true,
secrets: [{name: '<string>'}],
autoscaler: {
type: '<string>',
maxContainers: 123,
tasksPerContainer: 123,
minContainers: 123
},
taskPolicy: {timeout: '<string>', maxRetries: 123, ttl: 123},
concurrentRequests: 123,
extra: '<string>',
checkpointEnabled: true,
gpuCount: 123,
onDeploy: '<string>',
onDeployStubId: '<string>',
entrypoint: ['<string>'],
ports: [123],
env: ['<string>'],
appName: '<string>',
pricing: {
maxInFlight: '<string>',
costModel: '<string>',
costPerTask: 123,
costPerTaskDurationMs: 123
},
inputs: {fields: {}},
outputs: {fields: {}},
tcp: true,
blockNetwork: true,
allowList: ['<string>'],
dockerEnabled: true,
pool: {
name: '<string>',
gpu: ['<string>'],
nodes: 123,
ttl: '<string>',
maxSpend: 123,
providers: ['<string>'],
regions: ['<string>'],
minReliability: 123,
selector: '<string>',
mode: '<string>',
transport: '<string>',
fallback: '<string>',
priority: 123,
offerId: '<string>',
containerRuntime: '<string>'
},
isService: true,
serving: {
appKind: '<string>',
servingProtocol: '<string>',
llm: {
modelId: '<string>',
engine: '<string>',
servedModelName: '<string>',
contextLength: '<string>',
tokenizer: '<string>',
metricsPath: '<string>',
sloTier: '<string>'
},
database: {
kind: '<string>',
port: 123,
readinessProbe: '<string>',
connectionEnvName: '<string>',
credentialSecretNames: ['<string>'],
durabilityMode: '<string>',
usernameSecretName: '<string>',
passwordSecretName: '<string>',
databaseSecretName: '<string>',
connectionUrlSecretName: '<string>'
}
},
disks: [
{
name: '<string>',
size: '<string>',
mountPath: '<string>',
filesystem: '<string>',
driver: '<string>',
readOnly: true,
sourceSnapshotId: '<string>'
}
],
allowMarketplace: true,
checkpointTrigger: {
type: '<string>',
httpPath: '<string>',
httpPort: 123,
timeoutSeconds: 123,
intervalSeconds: 123
},
hostname: '<string>',
persistentRoot: {size: '<string>', sourceSnapshotId: '<string>', name: '<string>'}
})
};
fetch('https://levers9.uselevers.com/stubs', 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://levers9.uselevers.com/stubs",
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([
'objectId' => '<string>',
'imageId' => '<string>',
'stubType' => '<string>',
'name' => '<string>',
'pythonVersion' => '<string>',
'cpu' => '<string>',
'memory' => '<string>',
'gpu' => '<string>',
'handler' => '<string>',
'retries' => 123,
'timeout' => '<string>',
'keepWarmSeconds' => 123,
'workers' => 123,
'maxPendingTasks' => 123,
'volumes' => [
[
'id' => '<string>',
'mountPath' => '<string>',
'config' => [
'bucketName' => '<string>',
'accessKey' => '<string>',
'secretKey' => '<string>',
'endpointUrl' => '<string>',
'region' => '<string>',
'readOnly' => true,
'forcePathStyle' => true
]
]
],
'forceCreate' => true,
'onStart' => '<string>',
'callbackUrl' => '<string>',
'authorized' => true,
'secrets' => [
[
'name' => '<string>'
]
],
'autoscaler' => [
'type' => '<string>',
'maxContainers' => 123,
'tasksPerContainer' => 123,
'minContainers' => 123
],
'taskPolicy' => [
'timeout' => '<string>',
'maxRetries' => 123,
'ttl' => 123
],
'concurrentRequests' => 123,
'extra' => '<string>',
'checkpointEnabled' => true,
'gpuCount' => 123,
'onDeploy' => '<string>',
'onDeployStubId' => '<string>',
'entrypoint' => [
'<string>'
],
'ports' => [
123
],
'env' => [
'<string>'
],
'appName' => '<string>',
'pricing' => [
'maxInFlight' => '<string>',
'costModel' => '<string>',
'costPerTask' => 123,
'costPerTaskDurationMs' => 123
],
'inputs' => [
'fields' => [
]
],
'outputs' => [
'fields' => [
]
],
'tcp' => true,
'blockNetwork' => true,
'allowList' => [
'<string>'
],
'dockerEnabled' => true,
'pool' => [
'name' => '<string>',
'gpu' => [
'<string>'
],
'nodes' => 123,
'ttl' => '<string>',
'maxSpend' => 123,
'providers' => [
'<string>'
],
'regions' => [
'<string>'
],
'minReliability' => 123,
'selector' => '<string>',
'mode' => '<string>',
'transport' => '<string>',
'fallback' => '<string>',
'priority' => 123,
'offerId' => '<string>',
'containerRuntime' => '<string>'
],
'isService' => true,
'serving' => [
'appKind' => '<string>',
'servingProtocol' => '<string>',
'llm' => [
'modelId' => '<string>',
'engine' => '<string>',
'servedModelName' => '<string>',
'contextLength' => '<string>',
'tokenizer' => '<string>',
'metricsPath' => '<string>',
'sloTier' => '<string>'
],
'database' => [
'kind' => '<string>',
'port' => 123,
'readinessProbe' => '<string>',
'connectionEnvName' => '<string>',
'credentialSecretNames' => [
'<string>'
],
'durabilityMode' => '<string>',
'usernameSecretName' => '<string>',
'passwordSecretName' => '<string>',
'databaseSecretName' => '<string>',
'connectionUrlSecretName' => '<string>'
]
],
'disks' => [
[
'name' => '<string>',
'size' => '<string>',
'mountPath' => '<string>',
'filesystem' => '<string>',
'driver' => '<string>',
'readOnly' => true,
'sourceSnapshotId' => '<string>'
]
],
'allowMarketplace' => true,
'checkpointTrigger' => [
'type' => '<string>',
'httpPath' => '<string>',
'httpPort' => 123,
'timeoutSeconds' => 123,
'intervalSeconds' => 123
],
'hostname' => '<string>',
'persistentRoot' => [
'size' => '<string>',
'sourceSnapshotId' => '<string>',
'name' => '<string>'
]
]),
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://levers9.uselevers.com/stubs"
payload := strings.NewReader("{\n \"objectId\": \"<string>\",\n \"imageId\": \"<string>\",\n \"stubType\": \"<string>\",\n \"name\": \"<string>\",\n \"pythonVersion\": \"<string>\",\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\",\n \"gpu\": \"<string>\",\n \"handler\": \"<string>\",\n \"retries\": 123,\n \"timeout\": \"<string>\",\n \"keepWarmSeconds\": 123,\n \"workers\": 123,\n \"maxPendingTasks\": 123,\n \"volumes\": [\n {\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\",\n \"config\": {\n \"bucketName\": \"<string>\",\n \"accessKey\": \"<string>\",\n \"secretKey\": \"<string>\",\n \"endpointUrl\": \"<string>\",\n \"region\": \"<string>\",\n \"readOnly\": true,\n \"forcePathStyle\": true\n }\n }\n ],\n \"forceCreate\": true,\n \"onStart\": \"<string>\",\n \"callbackUrl\": \"<string>\",\n \"authorized\": true,\n \"secrets\": [\n {\n \"name\": \"<string>\"\n }\n ],\n \"autoscaler\": {\n \"type\": \"<string>\",\n \"maxContainers\": 123,\n \"tasksPerContainer\": 123,\n \"minContainers\": 123\n },\n \"taskPolicy\": {\n \"timeout\": \"<string>\",\n \"maxRetries\": 123,\n \"ttl\": 123\n },\n \"concurrentRequests\": 123,\n \"extra\": \"<string>\",\n \"checkpointEnabled\": true,\n \"gpuCount\": 123,\n \"onDeploy\": \"<string>\",\n \"onDeployStubId\": \"<string>\",\n \"entrypoint\": [\n \"<string>\"\n ],\n \"ports\": [\n 123\n ],\n \"env\": [\n \"<string>\"\n ],\n \"appName\": \"<string>\",\n \"pricing\": {\n \"maxInFlight\": \"<string>\",\n \"costModel\": \"<string>\",\n \"costPerTask\": 123,\n \"costPerTaskDurationMs\": 123\n },\n \"inputs\": {\n \"fields\": {}\n },\n \"outputs\": {\n \"fields\": {}\n },\n \"tcp\": true,\n \"blockNetwork\": true,\n \"allowList\": [\n \"<string>\"\n ],\n \"dockerEnabled\": true,\n \"pool\": {\n \"name\": \"<string>\",\n \"gpu\": [\n \"<string>\"\n ],\n \"nodes\": 123,\n \"ttl\": \"<string>\",\n \"maxSpend\": 123,\n \"providers\": [\n \"<string>\"\n ],\n \"regions\": [\n \"<string>\"\n ],\n \"minReliability\": 123,\n \"selector\": \"<string>\",\n \"mode\": \"<string>\",\n \"transport\": \"<string>\",\n \"fallback\": \"<string>\",\n \"priority\": 123,\n \"offerId\": \"<string>\",\n \"containerRuntime\": \"<string>\"\n },\n \"isService\": true,\n \"serving\": {\n \"appKind\": \"<string>\",\n \"servingProtocol\": \"<string>\",\n \"llm\": {\n \"modelId\": \"<string>\",\n \"engine\": \"<string>\",\n \"servedModelName\": \"<string>\",\n \"contextLength\": \"<string>\",\n \"tokenizer\": \"<string>\",\n \"metricsPath\": \"<string>\",\n \"sloTier\": \"<string>\"\n },\n \"database\": {\n \"kind\": \"<string>\",\n \"port\": 123,\n \"readinessProbe\": \"<string>\",\n \"connectionEnvName\": \"<string>\",\n \"credentialSecretNames\": [\n \"<string>\"\n ],\n \"durabilityMode\": \"<string>\",\n \"usernameSecretName\": \"<string>\",\n \"passwordSecretName\": \"<string>\",\n \"databaseSecretName\": \"<string>\",\n \"connectionUrlSecretName\": \"<string>\"\n }\n },\n \"disks\": [\n {\n \"name\": \"<string>\",\n \"size\": \"<string>\",\n \"mountPath\": \"<string>\",\n \"filesystem\": \"<string>\",\n \"driver\": \"<string>\",\n \"readOnly\": true,\n \"sourceSnapshotId\": \"<string>\"\n }\n ],\n \"allowMarketplace\": true,\n \"checkpointTrigger\": {\n \"type\": \"<string>\",\n \"httpPath\": \"<string>\",\n \"httpPort\": 123,\n \"timeoutSeconds\": 123,\n \"intervalSeconds\": 123\n },\n \"hostname\": \"<string>\",\n \"persistentRoot\": {\n \"size\": \"<string>\",\n \"sourceSnapshotId\": \"<string>\",\n \"name\": \"<string>\"\n }\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://levers9.uselevers.com/stubs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"objectId\": \"<string>\",\n \"imageId\": \"<string>\",\n \"stubType\": \"<string>\",\n \"name\": \"<string>\",\n \"pythonVersion\": \"<string>\",\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\",\n \"gpu\": \"<string>\",\n \"handler\": \"<string>\",\n \"retries\": 123,\n \"timeout\": \"<string>\",\n \"keepWarmSeconds\": 123,\n \"workers\": 123,\n \"maxPendingTasks\": 123,\n \"volumes\": [\n {\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\",\n \"config\": {\n \"bucketName\": \"<string>\",\n \"accessKey\": \"<string>\",\n \"secretKey\": \"<string>\",\n \"endpointUrl\": \"<string>\",\n \"region\": \"<string>\",\n \"readOnly\": true,\n \"forcePathStyle\": true\n }\n }\n ],\n \"forceCreate\": true,\n \"onStart\": \"<string>\",\n \"callbackUrl\": \"<string>\",\n \"authorized\": true,\n \"secrets\": [\n {\n \"name\": \"<string>\"\n }\n ],\n \"autoscaler\": {\n \"type\": \"<string>\",\n \"maxContainers\": 123,\n \"tasksPerContainer\": 123,\n \"minContainers\": 123\n },\n \"taskPolicy\": {\n \"timeout\": \"<string>\",\n \"maxRetries\": 123,\n \"ttl\": 123\n },\n \"concurrentRequests\": 123,\n \"extra\": \"<string>\",\n \"checkpointEnabled\": true,\n \"gpuCount\": 123,\n \"onDeploy\": \"<string>\",\n \"onDeployStubId\": \"<string>\",\n \"entrypoint\": [\n \"<string>\"\n ],\n \"ports\": [\n 123\n ],\n \"env\": [\n \"<string>\"\n ],\n \"appName\": \"<string>\",\n \"pricing\": {\n \"maxInFlight\": \"<string>\",\n \"costModel\": \"<string>\",\n \"costPerTask\": 123,\n \"costPerTaskDurationMs\": 123\n },\n \"inputs\": {\n \"fields\": {}\n },\n \"outputs\": {\n \"fields\": {}\n },\n \"tcp\": true,\n \"blockNetwork\": true,\n \"allowList\": [\n \"<string>\"\n ],\n \"dockerEnabled\": true,\n \"pool\": {\n \"name\": \"<string>\",\n \"gpu\": [\n \"<string>\"\n ],\n \"nodes\": 123,\n \"ttl\": \"<string>\",\n \"maxSpend\": 123,\n \"providers\": [\n \"<string>\"\n ],\n \"regions\": [\n \"<string>\"\n ],\n \"minReliability\": 123,\n \"selector\": \"<string>\",\n \"mode\": \"<string>\",\n \"transport\": \"<string>\",\n \"fallback\": \"<string>\",\n \"priority\": 123,\n \"offerId\": \"<string>\",\n \"containerRuntime\": \"<string>\"\n },\n \"isService\": true,\n \"serving\": {\n \"appKind\": \"<string>\",\n \"servingProtocol\": \"<string>\",\n \"llm\": {\n \"modelId\": \"<string>\",\n \"engine\": \"<string>\",\n \"servedModelName\": \"<string>\",\n \"contextLength\": \"<string>\",\n \"tokenizer\": \"<string>\",\n \"metricsPath\": \"<string>\",\n \"sloTier\": \"<string>\"\n },\n \"database\": {\n \"kind\": \"<string>\",\n \"port\": 123,\n \"readinessProbe\": \"<string>\",\n \"connectionEnvName\": \"<string>\",\n \"credentialSecretNames\": [\n \"<string>\"\n ],\n \"durabilityMode\": \"<string>\",\n \"usernameSecretName\": \"<string>\",\n \"passwordSecretName\": \"<string>\",\n \"databaseSecretName\": \"<string>\",\n \"connectionUrlSecretName\": \"<string>\"\n }\n },\n \"disks\": [\n {\n \"name\": \"<string>\",\n \"size\": \"<string>\",\n \"mountPath\": \"<string>\",\n \"filesystem\": \"<string>\",\n \"driver\": \"<string>\",\n \"readOnly\": true,\n \"sourceSnapshotId\": \"<string>\"\n }\n ],\n \"allowMarketplace\": true,\n \"checkpointTrigger\": {\n \"type\": \"<string>\",\n \"httpPath\": \"<string>\",\n \"httpPort\": 123,\n \"timeoutSeconds\": 123,\n \"intervalSeconds\": 123\n },\n \"hostname\": \"<string>\",\n \"persistentRoot\": {\n \"size\": \"<string>\",\n \"sourceSnapshotId\": \"<string>\",\n \"name\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://levers9.uselevers.com/stubs")
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 \"objectId\": \"<string>\",\n \"imageId\": \"<string>\",\n \"stubType\": \"<string>\",\n \"name\": \"<string>\",\n \"pythonVersion\": \"<string>\",\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\",\n \"gpu\": \"<string>\",\n \"handler\": \"<string>\",\n \"retries\": 123,\n \"timeout\": \"<string>\",\n \"keepWarmSeconds\": 123,\n \"workers\": 123,\n \"maxPendingTasks\": 123,\n \"volumes\": [\n {\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\",\n \"config\": {\n \"bucketName\": \"<string>\",\n \"accessKey\": \"<string>\",\n \"secretKey\": \"<string>\",\n \"endpointUrl\": \"<string>\",\n \"region\": \"<string>\",\n \"readOnly\": true,\n \"forcePathStyle\": true\n }\n }\n ],\n \"forceCreate\": true,\n \"onStart\": \"<string>\",\n \"callbackUrl\": \"<string>\",\n \"authorized\": true,\n \"secrets\": [\n {\n \"name\": \"<string>\"\n }\n ],\n \"autoscaler\": {\n \"type\": \"<string>\",\n \"maxContainers\": 123,\n \"tasksPerContainer\": 123,\n \"minContainers\": 123\n },\n \"taskPolicy\": {\n \"timeout\": \"<string>\",\n \"maxRetries\": 123,\n \"ttl\": 123\n },\n \"concurrentRequests\": 123,\n \"extra\": \"<string>\",\n \"checkpointEnabled\": true,\n \"gpuCount\": 123,\n \"onDeploy\": \"<string>\",\n \"onDeployStubId\": \"<string>\",\n \"entrypoint\": [\n \"<string>\"\n ],\n \"ports\": [\n 123\n ],\n \"env\": [\n \"<string>\"\n ],\n \"appName\": \"<string>\",\n \"pricing\": {\n \"maxInFlight\": \"<string>\",\n \"costModel\": \"<string>\",\n \"costPerTask\": 123,\n \"costPerTaskDurationMs\": 123\n },\n \"inputs\": {\n \"fields\": {}\n },\n \"outputs\": {\n \"fields\": {}\n },\n \"tcp\": true,\n \"blockNetwork\": true,\n \"allowList\": [\n \"<string>\"\n ],\n \"dockerEnabled\": true,\n \"pool\": {\n \"name\": \"<string>\",\n \"gpu\": [\n \"<string>\"\n ],\n \"nodes\": 123,\n \"ttl\": \"<string>\",\n \"maxSpend\": 123,\n \"providers\": [\n \"<string>\"\n ],\n \"regions\": [\n \"<string>\"\n ],\n \"minReliability\": 123,\n \"selector\": \"<string>\",\n \"mode\": \"<string>\",\n \"transport\": \"<string>\",\n \"fallback\": \"<string>\",\n \"priority\": 123,\n \"offerId\": \"<string>\",\n \"containerRuntime\": \"<string>\"\n },\n \"isService\": true,\n \"serving\": {\n \"appKind\": \"<string>\",\n \"servingProtocol\": \"<string>\",\n \"llm\": {\n \"modelId\": \"<string>\",\n \"engine\": \"<string>\",\n \"servedModelName\": \"<string>\",\n \"contextLength\": \"<string>\",\n \"tokenizer\": \"<string>\",\n \"metricsPath\": \"<string>\",\n \"sloTier\": \"<string>\"\n },\n \"database\": {\n \"kind\": \"<string>\",\n \"port\": 123,\n \"readinessProbe\": \"<string>\",\n \"connectionEnvName\": \"<string>\",\n \"credentialSecretNames\": [\n \"<string>\"\n ],\n \"durabilityMode\": \"<string>\",\n \"usernameSecretName\": \"<string>\",\n \"passwordSecretName\": \"<string>\",\n \"databaseSecretName\": \"<string>\",\n \"connectionUrlSecretName\": \"<string>\"\n }\n },\n \"disks\": [\n {\n \"name\": \"<string>\",\n \"size\": \"<string>\",\n \"mountPath\": \"<string>\",\n \"filesystem\": \"<string>\",\n \"driver\": \"<string>\",\n \"readOnly\": true,\n \"sourceSnapshotId\": \"<string>\"\n }\n ],\n \"allowMarketplace\": true,\n \"checkpointTrigger\": {\n \"type\": \"<string>\",\n \"httpPath\": \"<string>\",\n \"httpPort\": 123,\n \"timeoutSeconds\": 123,\n \"intervalSeconds\": 123\n },\n \"hostname\": \"<string>\",\n \"persistentRoot\": {\n \"size\": \"<string>\",\n \"sourceSnapshotId\": \"<string>\",\n \"name\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"stubId": "<string>",
"errMsg": "<string>",
"warnMsg": "<string>",
"capacityStatus": "<string>",
"unsupportedGpus": [
"<string>"
],
"matchedPrivatePool": "<string>"
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Stubs
curl --request POST \
--url https://levers9.uselevers.com/stubs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"objectId": "<string>",
"imageId": "<string>",
"stubType": "<string>",
"name": "<string>",
"pythonVersion": "<string>",
"cpu": "<string>",
"memory": "<string>",
"gpu": "<string>",
"handler": "<string>",
"retries": 123,
"timeout": "<string>",
"keepWarmSeconds": 123,
"workers": 123,
"maxPendingTasks": 123,
"volumes": [
{
"id": "<string>",
"mountPath": "<string>",
"config": {
"bucketName": "<string>",
"accessKey": "<string>",
"secretKey": "<string>",
"endpointUrl": "<string>",
"region": "<string>",
"readOnly": true,
"forcePathStyle": true
}
}
],
"forceCreate": true,
"onStart": "<string>",
"callbackUrl": "<string>",
"authorized": true,
"secrets": [
{
"name": "<string>"
}
],
"autoscaler": {
"type": "<string>",
"maxContainers": 123,
"tasksPerContainer": 123,
"minContainers": 123
},
"taskPolicy": {
"timeout": "<string>",
"maxRetries": 123,
"ttl": 123
},
"concurrentRequests": 123,
"extra": "<string>",
"checkpointEnabled": true,
"gpuCount": 123,
"onDeploy": "<string>",
"onDeployStubId": "<string>",
"entrypoint": [
"<string>"
],
"ports": [
123
],
"env": [
"<string>"
],
"appName": "<string>",
"pricing": {
"maxInFlight": "<string>",
"costModel": "<string>",
"costPerTask": 123,
"costPerTaskDurationMs": 123
},
"inputs": {
"fields": {}
},
"outputs": {
"fields": {}
},
"tcp": true,
"blockNetwork": true,
"allowList": [
"<string>"
],
"dockerEnabled": true,
"pool": {
"name": "<string>",
"gpu": [
"<string>"
],
"nodes": 123,
"ttl": "<string>",
"maxSpend": 123,
"providers": [
"<string>"
],
"regions": [
"<string>"
],
"minReliability": 123,
"selector": "<string>",
"mode": "<string>",
"transport": "<string>",
"fallback": "<string>",
"priority": 123,
"offerId": "<string>",
"containerRuntime": "<string>"
},
"isService": true,
"serving": {
"appKind": "<string>",
"servingProtocol": "<string>",
"llm": {
"modelId": "<string>",
"engine": "<string>",
"servedModelName": "<string>",
"contextLength": "<string>",
"tokenizer": "<string>",
"metricsPath": "<string>",
"sloTier": "<string>"
},
"database": {
"kind": "<string>",
"port": 123,
"readinessProbe": "<string>",
"connectionEnvName": "<string>",
"credentialSecretNames": [
"<string>"
],
"durabilityMode": "<string>",
"usernameSecretName": "<string>",
"passwordSecretName": "<string>",
"databaseSecretName": "<string>",
"connectionUrlSecretName": "<string>"
}
},
"disks": [
{
"name": "<string>",
"size": "<string>",
"mountPath": "<string>",
"filesystem": "<string>",
"driver": "<string>",
"readOnly": true,
"sourceSnapshotId": "<string>"
}
],
"allowMarketplace": true,
"checkpointTrigger": {
"type": "<string>",
"httpPath": "<string>",
"httpPort": 123,
"timeoutSeconds": 123,
"intervalSeconds": 123
},
"hostname": "<string>",
"persistentRoot": {
"size": "<string>",
"sourceSnapshotId": "<string>",
"name": "<string>"
}
}
'import requests
url = "https://levers9.uselevers.com/stubs"
payload = {
"objectId": "<string>",
"imageId": "<string>",
"stubType": "<string>",
"name": "<string>",
"pythonVersion": "<string>",
"cpu": "<string>",
"memory": "<string>",
"gpu": "<string>",
"handler": "<string>",
"retries": 123,
"timeout": "<string>",
"keepWarmSeconds": 123,
"workers": 123,
"maxPendingTasks": 123,
"volumes": [
{
"id": "<string>",
"mountPath": "<string>",
"config": {
"bucketName": "<string>",
"accessKey": "<string>",
"secretKey": "<string>",
"endpointUrl": "<string>",
"region": "<string>",
"readOnly": True,
"forcePathStyle": True
}
}
],
"forceCreate": True,
"onStart": "<string>",
"callbackUrl": "<string>",
"authorized": True,
"secrets": [{ "name": "<string>" }],
"autoscaler": {
"type": "<string>",
"maxContainers": 123,
"tasksPerContainer": 123,
"minContainers": 123
},
"taskPolicy": {
"timeout": "<string>",
"maxRetries": 123,
"ttl": 123
},
"concurrentRequests": 123,
"extra": "<string>",
"checkpointEnabled": True,
"gpuCount": 123,
"onDeploy": "<string>",
"onDeployStubId": "<string>",
"entrypoint": ["<string>"],
"ports": [123],
"env": ["<string>"],
"appName": "<string>",
"pricing": {
"maxInFlight": "<string>",
"costModel": "<string>",
"costPerTask": 123,
"costPerTaskDurationMs": 123
},
"inputs": { "fields": {} },
"outputs": { "fields": {} },
"tcp": True,
"blockNetwork": True,
"allowList": ["<string>"],
"dockerEnabled": True,
"pool": {
"name": "<string>",
"gpu": ["<string>"],
"nodes": 123,
"ttl": "<string>",
"maxSpend": 123,
"providers": ["<string>"],
"regions": ["<string>"],
"minReliability": 123,
"selector": "<string>",
"mode": "<string>",
"transport": "<string>",
"fallback": "<string>",
"priority": 123,
"offerId": "<string>",
"containerRuntime": "<string>"
},
"isService": True,
"serving": {
"appKind": "<string>",
"servingProtocol": "<string>",
"llm": {
"modelId": "<string>",
"engine": "<string>",
"servedModelName": "<string>",
"contextLength": "<string>",
"tokenizer": "<string>",
"metricsPath": "<string>",
"sloTier": "<string>"
},
"database": {
"kind": "<string>",
"port": 123,
"readinessProbe": "<string>",
"connectionEnvName": "<string>",
"credentialSecretNames": ["<string>"],
"durabilityMode": "<string>",
"usernameSecretName": "<string>",
"passwordSecretName": "<string>",
"databaseSecretName": "<string>",
"connectionUrlSecretName": "<string>"
}
},
"disks": [
{
"name": "<string>",
"size": "<string>",
"mountPath": "<string>",
"filesystem": "<string>",
"driver": "<string>",
"readOnly": True,
"sourceSnapshotId": "<string>"
}
],
"allowMarketplace": True,
"checkpointTrigger": {
"type": "<string>",
"httpPath": "<string>",
"httpPort": 123,
"timeoutSeconds": 123,
"intervalSeconds": 123
},
"hostname": "<string>",
"persistentRoot": {
"size": "<string>",
"sourceSnapshotId": "<string>",
"name": "<string>"
}
}
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({
objectId: '<string>',
imageId: '<string>',
stubType: '<string>',
name: '<string>',
pythonVersion: '<string>',
cpu: '<string>',
memory: '<string>',
gpu: '<string>',
handler: '<string>',
retries: 123,
timeout: '<string>',
keepWarmSeconds: 123,
workers: 123,
maxPendingTasks: 123,
volumes: [
{
id: '<string>',
mountPath: '<string>',
config: {
bucketName: '<string>',
accessKey: '<string>',
secretKey: '<string>',
endpointUrl: '<string>',
region: '<string>',
readOnly: true,
forcePathStyle: true
}
}
],
forceCreate: true,
onStart: '<string>',
callbackUrl: '<string>',
authorized: true,
secrets: [{name: '<string>'}],
autoscaler: {
type: '<string>',
maxContainers: 123,
tasksPerContainer: 123,
minContainers: 123
},
taskPolicy: {timeout: '<string>', maxRetries: 123, ttl: 123},
concurrentRequests: 123,
extra: '<string>',
checkpointEnabled: true,
gpuCount: 123,
onDeploy: '<string>',
onDeployStubId: '<string>',
entrypoint: ['<string>'],
ports: [123],
env: ['<string>'],
appName: '<string>',
pricing: {
maxInFlight: '<string>',
costModel: '<string>',
costPerTask: 123,
costPerTaskDurationMs: 123
},
inputs: {fields: {}},
outputs: {fields: {}},
tcp: true,
blockNetwork: true,
allowList: ['<string>'],
dockerEnabled: true,
pool: {
name: '<string>',
gpu: ['<string>'],
nodes: 123,
ttl: '<string>',
maxSpend: 123,
providers: ['<string>'],
regions: ['<string>'],
minReliability: 123,
selector: '<string>',
mode: '<string>',
transport: '<string>',
fallback: '<string>',
priority: 123,
offerId: '<string>',
containerRuntime: '<string>'
},
isService: true,
serving: {
appKind: '<string>',
servingProtocol: '<string>',
llm: {
modelId: '<string>',
engine: '<string>',
servedModelName: '<string>',
contextLength: '<string>',
tokenizer: '<string>',
metricsPath: '<string>',
sloTier: '<string>'
},
database: {
kind: '<string>',
port: 123,
readinessProbe: '<string>',
connectionEnvName: '<string>',
credentialSecretNames: ['<string>'],
durabilityMode: '<string>',
usernameSecretName: '<string>',
passwordSecretName: '<string>',
databaseSecretName: '<string>',
connectionUrlSecretName: '<string>'
}
},
disks: [
{
name: '<string>',
size: '<string>',
mountPath: '<string>',
filesystem: '<string>',
driver: '<string>',
readOnly: true,
sourceSnapshotId: '<string>'
}
],
allowMarketplace: true,
checkpointTrigger: {
type: '<string>',
httpPath: '<string>',
httpPort: 123,
timeoutSeconds: 123,
intervalSeconds: 123
},
hostname: '<string>',
persistentRoot: {size: '<string>', sourceSnapshotId: '<string>', name: '<string>'}
})
};
fetch('https://levers9.uselevers.com/stubs', 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://levers9.uselevers.com/stubs",
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([
'objectId' => '<string>',
'imageId' => '<string>',
'stubType' => '<string>',
'name' => '<string>',
'pythonVersion' => '<string>',
'cpu' => '<string>',
'memory' => '<string>',
'gpu' => '<string>',
'handler' => '<string>',
'retries' => 123,
'timeout' => '<string>',
'keepWarmSeconds' => 123,
'workers' => 123,
'maxPendingTasks' => 123,
'volumes' => [
[
'id' => '<string>',
'mountPath' => '<string>',
'config' => [
'bucketName' => '<string>',
'accessKey' => '<string>',
'secretKey' => '<string>',
'endpointUrl' => '<string>',
'region' => '<string>',
'readOnly' => true,
'forcePathStyle' => true
]
]
],
'forceCreate' => true,
'onStart' => '<string>',
'callbackUrl' => '<string>',
'authorized' => true,
'secrets' => [
[
'name' => '<string>'
]
],
'autoscaler' => [
'type' => '<string>',
'maxContainers' => 123,
'tasksPerContainer' => 123,
'minContainers' => 123
],
'taskPolicy' => [
'timeout' => '<string>',
'maxRetries' => 123,
'ttl' => 123
],
'concurrentRequests' => 123,
'extra' => '<string>',
'checkpointEnabled' => true,
'gpuCount' => 123,
'onDeploy' => '<string>',
'onDeployStubId' => '<string>',
'entrypoint' => [
'<string>'
],
'ports' => [
123
],
'env' => [
'<string>'
],
'appName' => '<string>',
'pricing' => [
'maxInFlight' => '<string>',
'costModel' => '<string>',
'costPerTask' => 123,
'costPerTaskDurationMs' => 123
],
'inputs' => [
'fields' => [
]
],
'outputs' => [
'fields' => [
]
],
'tcp' => true,
'blockNetwork' => true,
'allowList' => [
'<string>'
],
'dockerEnabled' => true,
'pool' => [
'name' => '<string>',
'gpu' => [
'<string>'
],
'nodes' => 123,
'ttl' => '<string>',
'maxSpend' => 123,
'providers' => [
'<string>'
],
'regions' => [
'<string>'
],
'minReliability' => 123,
'selector' => '<string>',
'mode' => '<string>',
'transport' => '<string>',
'fallback' => '<string>',
'priority' => 123,
'offerId' => '<string>',
'containerRuntime' => '<string>'
],
'isService' => true,
'serving' => [
'appKind' => '<string>',
'servingProtocol' => '<string>',
'llm' => [
'modelId' => '<string>',
'engine' => '<string>',
'servedModelName' => '<string>',
'contextLength' => '<string>',
'tokenizer' => '<string>',
'metricsPath' => '<string>',
'sloTier' => '<string>'
],
'database' => [
'kind' => '<string>',
'port' => 123,
'readinessProbe' => '<string>',
'connectionEnvName' => '<string>',
'credentialSecretNames' => [
'<string>'
],
'durabilityMode' => '<string>',
'usernameSecretName' => '<string>',
'passwordSecretName' => '<string>',
'databaseSecretName' => '<string>',
'connectionUrlSecretName' => '<string>'
]
],
'disks' => [
[
'name' => '<string>',
'size' => '<string>',
'mountPath' => '<string>',
'filesystem' => '<string>',
'driver' => '<string>',
'readOnly' => true,
'sourceSnapshotId' => '<string>'
]
],
'allowMarketplace' => true,
'checkpointTrigger' => [
'type' => '<string>',
'httpPath' => '<string>',
'httpPort' => 123,
'timeoutSeconds' => 123,
'intervalSeconds' => 123
],
'hostname' => '<string>',
'persistentRoot' => [
'size' => '<string>',
'sourceSnapshotId' => '<string>',
'name' => '<string>'
]
]),
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://levers9.uselevers.com/stubs"
payload := strings.NewReader("{\n \"objectId\": \"<string>\",\n \"imageId\": \"<string>\",\n \"stubType\": \"<string>\",\n \"name\": \"<string>\",\n \"pythonVersion\": \"<string>\",\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\",\n \"gpu\": \"<string>\",\n \"handler\": \"<string>\",\n \"retries\": 123,\n \"timeout\": \"<string>\",\n \"keepWarmSeconds\": 123,\n \"workers\": 123,\n \"maxPendingTasks\": 123,\n \"volumes\": [\n {\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\",\n \"config\": {\n \"bucketName\": \"<string>\",\n \"accessKey\": \"<string>\",\n \"secretKey\": \"<string>\",\n \"endpointUrl\": \"<string>\",\n \"region\": \"<string>\",\n \"readOnly\": true,\n \"forcePathStyle\": true\n }\n }\n ],\n \"forceCreate\": true,\n \"onStart\": \"<string>\",\n \"callbackUrl\": \"<string>\",\n \"authorized\": true,\n \"secrets\": [\n {\n \"name\": \"<string>\"\n }\n ],\n \"autoscaler\": {\n \"type\": \"<string>\",\n \"maxContainers\": 123,\n \"tasksPerContainer\": 123,\n \"minContainers\": 123\n },\n \"taskPolicy\": {\n \"timeout\": \"<string>\",\n \"maxRetries\": 123,\n \"ttl\": 123\n },\n \"concurrentRequests\": 123,\n \"extra\": \"<string>\",\n \"checkpointEnabled\": true,\n \"gpuCount\": 123,\n \"onDeploy\": \"<string>\",\n \"onDeployStubId\": \"<string>\",\n \"entrypoint\": [\n \"<string>\"\n ],\n \"ports\": [\n 123\n ],\n \"env\": [\n \"<string>\"\n ],\n \"appName\": \"<string>\",\n \"pricing\": {\n \"maxInFlight\": \"<string>\",\n \"costModel\": \"<string>\",\n \"costPerTask\": 123,\n \"costPerTaskDurationMs\": 123\n },\n \"inputs\": {\n \"fields\": {}\n },\n \"outputs\": {\n \"fields\": {}\n },\n \"tcp\": true,\n \"blockNetwork\": true,\n \"allowList\": [\n \"<string>\"\n ],\n \"dockerEnabled\": true,\n \"pool\": {\n \"name\": \"<string>\",\n \"gpu\": [\n \"<string>\"\n ],\n \"nodes\": 123,\n \"ttl\": \"<string>\",\n \"maxSpend\": 123,\n \"providers\": [\n \"<string>\"\n ],\n \"regions\": [\n \"<string>\"\n ],\n \"minReliability\": 123,\n \"selector\": \"<string>\",\n \"mode\": \"<string>\",\n \"transport\": \"<string>\",\n \"fallback\": \"<string>\",\n \"priority\": 123,\n \"offerId\": \"<string>\",\n \"containerRuntime\": \"<string>\"\n },\n \"isService\": true,\n \"serving\": {\n \"appKind\": \"<string>\",\n \"servingProtocol\": \"<string>\",\n \"llm\": {\n \"modelId\": \"<string>\",\n \"engine\": \"<string>\",\n \"servedModelName\": \"<string>\",\n \"contextLength\": \"<string>\",\n \"tokenizer\": \"<string>\",\n \"metricsPath\": \"<string>\",\n \"sloTier\": \"<string>\"\n },\n \"database\": {\n \"kind\": \"<string>\",\n \"port\": 123,\n \"readinessProbe\": \"<string>\",\n \"connectionEnvName\": \"<string>\",\n \"credentialSecretNames\": [\n \"<string>\"\n ],\n \"durabilityMode\": \"<string>\",\n \"usernameSecretName\": \"<string>\",\n \"passwordSecretName\": \"<string>\",\n \"databaseSecretName\": \"<string>\",\n \"connectionUrlSecretName\": \"<string>\"\n }\n },\n \"disks\": [\n {\n \"name\": \"<string>\",\n \"size\": \"<string>\",\n \"mountPath\": \"<string>\",\n \"filesystem\": \"<string>\",\n \"driver\": \"<string>\",\n \"readOnly\": true,\n \"sourceSnapshotId\": \"<string>\"\n }\n ],\n \"allowMarketplace\": true,\n \"checkpointTrigger\": {\n \"type\": \"<string>\",\n \"httpPath\": \"<string>\",\n \"httpPort\": 123,\n \"timeoutSeconds\": 123,\n \"intervalSeconds\": 123\n },\n \"hostname\": \"<string>\",\n \"persistentRoot\": {\n \"size\": \"<string>\",\n \"sourceSnapshotId\": \"<string>\",\n \"name\": \"<string>\"\n }\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://levers9.uselevers.com/stubs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"objectId\": \"<string>\",\n \"imageId\": \"<string>\",\n \"stubType\": \"<string>\",\n \"name\": \"<string>\",\n \"pythonVersion\": \"<string>\",\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\",\n \"gpu\": \"<string>\",\n \"handler\": \"<string>\",\n \"retries\": 123,\n \"timeout\": \"<string>\",\n \"keepWarmSeconds\": 123,\n \"workers\": 123,\n \"maxPendingTasks\": 123,\n \"volumes\": [\n {\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\",\n \"config\": {\n \"bucketName\": \"<string>\",\n \"accessKey\": \"<string>\",\n \"secretKey\": \"<string>\",\n \"endpointUrl\": \"<string>\",\n \"region\": \"<string>\",\n \"readOnly\": true,\n \"forcePathStyle\": true\n }\n }\n ],\n \"forceCreate\": true,\n \"onStart\": \"<string>\",\n \"callbackUrl\": \"<string>\",\n \"authorized\": true,\n \"secrets\": [\n {\n \"name\": \"<string>\"\n }\n ],\n \"autoscaler\": {\n \"type\": \"<string>\",\n \"maxContainers\": 123,\n \"tasksPerContainer\": 123,\n \"minContainers\": 123\n },\n \"taskPolicy\": {\n \"timeout\": \"<string>\",\n \"maxRetries\": 123,\n \"ttl\": 123\n },\n \"concurrentRequests\": 123,\n \"extra\": \"<string>\",\n \"checkpointEnabled\": true,\n \"gpuCount\": 123,\n \"onDeploy\": \"<string>\",\n \"onDeployStubId\": \"<string>\",\n \"entrypoint\": [\n \"<string>\"\n ],\n \"ports\": [\n 123\n ],\n \"env\": [\n \"<string>\"\n ],\n \"appName\": \"<string>\",\n \"pricing\": {\n \"maxInFlight\": \"<string>\",\n \"costModel\": \"<string>\",\n \"costPerTask\": 123,\n \"costPerTaskDurationMs\": 123\n },\n \"inputs\": {\n \"fields\": {}\n },\n \"outputs\": {\n \"fields\": {}\n },\n \"tcp\": true,\n \"blockNetwork\": true,\n \"allowList\": [\n \"<string>\"\n ],\n \"dockerEnabled\": true,\n \"pool\": {\n \"name\": \"<string>\",\n \"gpu\": [\n \"<string>\"\n ],\n \"nodes\": 123,\n \"ttl\": \"<string>\",\n \"maxSpend\": 123,\n \"providers\": [\n \"<string>\"\n ],\n \"regions\": [\n \"<string>\"\n ],\n \"minReliability\": 123,\n \"selector\": \"<string>\",\n \"mode\": \"<string>\",\n \"transport\": \"<string>\",\n \"fallback\": \"<string>\",\n \"priority\": 123,\n \"offerId\": \"<string>\",\n \"containerRuntime\": \"<string>\"\n },\n \"isService\": true,\n \"serving\": {\n \"appKind\": \"<string>\",\n \"servingProtocol\": \"<string>\",\n \"llm\": {\n \"modelId\": \"<string>\",\n \"engine\": \"<string>\",\n \"servedModelName\": \"<string>\",\n \"contextLength\": \"<string>\",\n \"tokenizer\": \"<string>\",\n \"metricsPath\": \"<string>\",\n \"sloTier\": \"<string>\"\n },\n \"database\": {\n \"kind\": \"<string>\",\n \"port\": 123,\n \"readinessProbe\": \"<string>\",\n \"connectionEnvName\": \"<string>\",\n \"credentialSecretNames\": [\n \"<string>\"\n ],\n \"durabilityMode\": \"<string>\",\n \"usernameSecretName\": \"<string>\",\n \"passwordSecretName\": \"<string>\",\n \"databaseSecretName\": \"<string>\",\n \"connectionUrlSecretName\": \"<string>\"\n }\n },\n \"disks\": [\n {\n \"name\": \"<string>\",\n \"size\": \"<string>\",\n \"mountPath\": \"<string>\",\n \"filesystem\": \"<string>\",\n \"driver\": \"<string>\",\n \"readOnly\": true,\n \"sourceSnapshotId\": \"<string>\"\n }\n ],\n \"allowMarketplace\": true,\n \"checkpointTrigger\": {\n \"type\": \"<string>\",\n \"httpPath\": \"<string>\",\n \"httpPort\": 123,\n \"timeoutSeconds\": 123,\n \"intervalSeconds\": 123\n },\n \"hostname\": \"<string>\",\n \"persistentRoot\": {\n \"size\": \"<string>\",\n \"sourceSnapshotId\": \"<string>\",\n \"name\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://levers9.uselevers.com/stubs")
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 \"objectId\": \"<string>\",\n \"imageId\": \"<string>\",\n \"stubType\": \"<string>\",\n \"name\": \"<string>\",\n \"pythonVersion\": \"<string>\",\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\",\n \"gpu\": \"<string>\",\n \"handler\": \"<string>\",\n \"retries\": 123,\n \"timeout\": \"<string>\",\n \"keepWarmSeconds\": 123,\n \"workers\": 123,\n \"maxPendingTasks\": 123,\n \"volumes\": [\n {\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\",\n \"config\": {\n \"bucketName\": \"<string>\",\n \"accessKey\": \"<string>\",\n \"secretKey\": \"<string>\",\n \"endpointUrl\": \"<string>\",\n \"region\": \"<string>\",\n \"readOnly\": true,\n \"forcePathStyle\": true\n }\n }\n ],\n \"forceCreate\": true,\n \"onStart\": \"<string>\",\n \"callbackUrl\": \"<string>\",\n \"authorized\": true,\n \"secrets\": [\n {\n \"name\": \"<string>\"\n }\n ],\n \"autoscaler\": {\n \"type\": \"<string>\",\n \"maxContainers\": 123,\n \"tasksPerContainer\": 123,\n \"minContainers\": 123\n },\n \"taskPolicy\": {\n \"timeout\": \"<string>\",\n \"maxRetries\": 123,\n \"ttl\": 123\n },\n \"concurrentRequests\": 123,\n \"extra\": \"<string>\",\n \"checkpointEnabled\": true,\n \"gpuCount\": 123,\n \"onDeploy\": \"<string>\",\n \"onDeployStubId\": \"<string>\",\n \"entrypoint\": [\n \"<string>\"\n ],\n \"ports\": [\n 123\n ],\n \"env\": [\n \"<string>\"\n ],\n \"appName\": \"<string>\",\n \"pricing\": {\n \"maxInFlight\": \"<string>\",\n \"costModel\": \"<string>\",\n \"costPerTask\": 123,\n \"costPerTaskDurationMs\": 123\n },\n \"inputs\": {\n \"fields\": {}\n },\n \"outputs\": {\n \"fields\": {}\n },\n \"tcp\": true,\n \"blockNetwork\": true,\n \"allowList\": [\n \"<string>\"\n ],\n \"dockerEnabled\": true,\n \"pool\": {\n \"name\": \"<string>\",\n \"gpu\": [\n \"<string>\"\n ],\n \"nodes\": 123,\n \"ttl\": \"<string>\",\n \"maxSpend\": 123,\n \"providers\": [\n \"<string>\"\n ],\n \"regions\": [\n \"<string>\"\n ],\n \"minReliability\": 123,\n \"selector\": \"<string>\",\n \"mode\": \"<string>\",\n \"transport\": \"<string>\",\n \"fallback\": \"<string>\",\n \"priority\": 123,\n \"offerId\": \"<string>\",\n \"containerRuntime\": \"<string>\"\n },\n \"isService\": true,\n \"serving\": {\n \"appKind\": \"<string>\",\n \"servingProtocol\": \"<string>\",\n \"llm\": {\n \"modelId\": \"<string>\",\n \"engine\": \"<string>\",\n \"servedModelName\": \"<string>\",\n \"contextLength\": \"<string>\",\n \"tokenizer\": \"<string>\",\n \"metricsPath\": \"<string>\",\n \"sloTier\": \"<string>\"\n },\n \"database\": {\n \"kind\": \"<string>\",\n \"port\": 123,\n \"readinessProbe\": \"<string>\",\n \"connectionEnvName\": \"<string>\",\n \"credentialSecretNames\": [\n \"<string>\"\n ],\n \"durabilityMode\": \"<string>\",\n \"usernameSecretName\": \"<string>\",\n \"passwordSecretName\": \"<string>\",\n \"databaseSecretName\": \"<string>\",\n \"connectionUrlSecretName\": \"<string>\"\n }\n },\n \"disks\": [\n {\n \"name\": \"<string>\",\n \"size\": \"<string>\",\n \"mountPath\": \"<string>\",\n \"filesystem\": \"<string>\",\n \"driver\": \"<string>\",\n \"readOnly\": true,\n \"sourceSnapshotId\": \"<string>\"\n }\n ],\n \"allowMarketplace\": true,\n \"checkpointTrigger\": {\n \"type\": \"<string>\",\n \"httpPath\": \"<string>\",\n \"httpPort\": 123,\n \"timeoutSeconds\": 123,\n \"intervalSeconds\": 123\n },\n \"hostname\": \"<string>\",\n \"persistentRoot\": {\n \"size\": \"<string>\",\n \"sourceSnapshotId\": \"<string>\",\n \"name\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"stubId": "<string>",
"errMsg": "<string>",
"warnMsg": "<string>",
"capacityStatus": "<string>",
"unsupportedGpus": [
"<string>"
],
"matchedPrivatePool": "<string>"
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Hostname to set inside the container.
A durable machine-root disk. The container's entire root filesystem delta lives on a qcow-backed volume mounted at "/", so disk snapshots capture the whole machine state. Shorthand for a DurableDisk with mount_path "/" and the qcow driver.
Show child attributes
Show child attributes
Response
A successful response.
Capacity verdict for the requested GPU types, computed at stub creation: "available", "low", or "none". Empty when no check applies (CPU-only workloads, private-pool-only stubs, or pool-selector-bound stubs).
GPU types from the request that no serverless pool supports.
Name of an existing ready private pool in the workspace that satisfies the GPU request. Set instead of capacity_status "none" so clients can re-issue stub creation targeting this pool.

