Create Job
curl --request POST \
--url https://api.example.com/v1/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {
"graph": {
"nodes": [
{
"key": "<string>",
"serialized_function": "<string>",
"environment": {
"python_version": "3.12",
"pypi_dependencies": [],
"environment_variables": {}
},
"kind": "python",
"node_type": "python/run",
"arguments": {
"positional": [],
"keyword": {}
},
"resources": {
"cpu": 1,
"memory_mib": 1,
"gpu": "<string>",
"timeout_seconds": 300
},
"depends_on": []
}
],
"outputs": [
{
"name": "<string>",
"node_key": "<string>",
"output_name": "result"
}
],
"inputs": []
},
"kind": "computation_graph"
}
}
'import requests
url = "https://api.example.com/v1/jobs"
payload = { "definition": {
"graph": {
"nodes": [
{
"key": "<string>",
"serialized_function": "<string>",
"environment": {
"python_version": "3.12",
"pypi_dependencies": [],
"environment_variables": {}
},
"kind": "python",
"node_type": "python/run",
"arguments": {
"positional": [],
"keyword": {}
},
"resources": {
"cpu": 1,
"memory_mib": 1,
"gpu": "<string>",
"timeout_seconds": 300
},
"depends_on": []
}
],
"outputs": [
{
"name": "<string>",
"node_key": "<string>",
"output_name": "result"
}
],
"inputs": []
},
"kind": "computation_graph"
} }
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({
definition: {
graph: {
nodes: [
{
key: '<string>',
serialized_function: '<string>',
environment: {python_version: '3.12', pypi_dependencies: [], environment_variables: {}},
kind: 'python',
node_type: 'python/run',
arguments: {positional: [], keyword: {}},
resources: {cpu: 1, memory_mib: 1, gpu: '<string>', timeout_seconds: 300},
depends_on: []
}
],
outputs: [{name: '<string>', node_key: '<string>', output_name: 'result'}],
inputs: []
},
kind: 'computation_graph'
}
})
};
fetch('https://api.example.com/v1/jobs', 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/v1/jobs",
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([
'definition' => [
'graph' => [
'nodes' => [
[
'key' => '<string>',
'serialized_function' => '<string>',
'environment' => [
'python_version' => '3.12',
'pypi_dependencies' => [
],
'environment_variables' => [
]
],
'kind' => 'python',
'node_type' => 'python/run',
'arguments' => [
'positional' => [
],
'keyword' => [
]
],
'resources' => [
'cpu' => 1,
'memory_mib' => 1,
'gpu' => '<string>',
'timeout_seconds' => 300
],
'depends_on' => [
]
]
],
'outputs' => [
[
'name' => '<string>',
'node_key' => '<string>',
'output_name' => 'result'
]
],
'inputs' => [
]
],
'kind' => 'computation_graph'
]
]),
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://api.example.com/v1/jobs"
payload := strings.NewReader("{\n \"definition\": {\n \"graph\": {\n \"nodes\": [\n {\n \"key\": \"<string>\",\n \"serialized_function\": \"<string>\",\n \"environment\": {\n \"python_version\": \"3.12\",\n \"pypi_dependencies\": [],\n \"environment_variables\": {}\n },\n \"kind\": \"python\",\n \"node_type\": \"python/run\",\n \"arguments\": {\n \"positional\": [],\n \"keyword\": {}\n },\n \"resources\": {\n \"cpu\": 1,\n \"memory_mib\": 1,\n \"gpu\": \"<string>\",\n \"timeout_seconds\": 300\n },\n \"depends_on\": []\n }\n ],\n \"outputs\": [\n {\n \"name\": \"<string>\",\n \"node_key\": \"<string>\",\n \"output_name\": \"result\"\n }\n ],\n \"inputs\": []\n },\n \"kind\": \"computation_graph\"\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://api.example.com/v1/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": {\n \"graph\": {\n \"nodes\": [\n {\n \"key\": \"<string>\",\n \"serialized_function\": \"<string>\",\n \"environment\": {\n \"python_version\": \"3.12\",\n \"pypi_dependencies\": [],\n \"environment_variables\": {}\n },\n \"kind\": \"python\",\n \"node_type\": \"python/run\",\n \"arguments\": {\n \"positional\": [],\n \"keyword\": {}\n },\n \"resources\": {\n \"cpu\": 1,\n \"memory_mib\": 1,\n \"gpu\": \"<string>\",\n \"timeout_seconds\": 300\n },\n \"depends_on\": []\n }\n ],\n \"outputs\": [\n {\n \"name\": \"<string>\",\n \"node_key\": \"<string>\",\n \"output_name\": \"result\"\n }\n ],\n \"inputs\": []\n },\n \"kind\": \"computation_graph\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/jobs")
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 \"definition\": {\n \"graph\": {\n \"nodes\": [\n {\n \"key\": \"<string>\",\n \"serialized_function\": \"<string>\",\n \"environment\": {\n \"python_version\": \"3.12\",\n \"pypi_dependencies\": [],\n \"environment_variables\": {}\n },\n \"kind\": \"python\",\n \"node_type\": \"python/run\",\n \"arguments\": {\n \"positional\": [],\n \"keyword\": {}\n },\n \"resources\": {\n \"cpu\": 1,\n \"memory_mib\": 1,\n \"gpu\": \"<string>\",\n \"timeout_seconds\": 300\n },\n \"depends_on\": []\n }\n ],\n \"outputs\": [\n {\n \"name\": \"<string>\",\n \"node_key\": \"<string>\",\n \"output_name\": \"result\"\n }\n ],\n \"inputs\": []\n },\n \"kind\": \"computation_graph\"\n }\n}"
response = http.request(request)
puts response.read_body{
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}jobs
Create Job
Compile one public job definition into a durable computation graph.
POST
/
v1
/
jobs
Create Job
curl --request POST \
--url https://api.example.com/v1/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {
"graph": {
"nodes": [
{
"key": "<string>",
"serialized_function": "<string>",
"environment": {
"python_version": "3.12",
"pypi_dependencies": [],
"environment_variables": {}
},
"kind": "python",
"node_type": "python/run",
"arguments": {
"positional": [],
"keyword": {}
},
"resources": {
"cpu": 1,
"memory_mib": 1,
"gpu": "<string>",
"timeout_seconds": 300
},
"depends_on": []
}
],
"outputs": [
{
"name": "<string>",
"node_key": "<string>",
"output_name": "result"
}
],
"inputs": []
},
"kind": "computation_graph"
}
}
'import requests
url = "https://api.example.com/v1/jobs"
payload = { "definition": {
"graph": {
"nodes": [
{
"key": "<string>",
"serialized_function": "<string>",
"environment": {
"python_version": "3.12",
"pypi_dependencies": [],
"environment_variables": {}
},
"kind": "python",
"node_type": "python/run",
"arguments": {
"positional": [],
"keyword": {}
},
"resources": {
"cpu": 1,
"memory_mib": 1,
"gpu": "<string>",
"timeout_seconds": 300
},
"depends_on": []
}
],
"outputs": [
{
"name": "<string>",
"node_key": "<string>",
"output_name": "result"
}
],
"inputs": []
},
"kind": "computation_graph"
} }
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({
definition: {
graph: {
nodes: [
{
key: '<string>',
serialized_function: '<string>',
environment: {python_version: '3.12', pypi_dependencies: [], environment_variables: {}},
kind: 'python',
node_type: 'python/run',
arguments: {positional: [], keyword: {}},
resources: {cpu: 1, memory_mib: 1, gpu: '<string>', timeout_seconds: 300},
depends_on: []
}
],
outputs: [{name: '<string>', node_key: '<string>', output_name: 'result'}],
inputs: []
},
kind: 'computation_graph'
}
})
};
fetch('https://api.example.com/v1/jobs', 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/v1/jobs",
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([
'definition' => [
'graph' => [
'nodes' => [
[
'key' => '<string>',
'serialized_function' => '<string>',
'environment' => [
'python_version' => '3.12',
'pypi_dependencies' => [
],
'environment_variables' => [
]
],
'kind' => 'python',
'node_type' => 'python/run',
'arguments' => [
'positional' => [
],
'keyword' => [
]
],
'resources' => [
'cpu' => 1,
'memory_mib' => 1,
'gpu' => '<string>',
'timeout_seconds' => 300
],
'depends_on' => [
]
]
],
'outputs' => [
[
'name' => '<string>',
'node_key' => '<string>',
'output_name' => 'result'
]
],
'inputs' => [
]
],
'kind' => 'computation_graph'
]
]),
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://api.example.com/v1/jobs"
payload := strings.NewReader("{\n \"definition\": {\n \"graph\": {\n \"nodes\": [\n {\n \"key\": \"<string>\",\n \"serialized_function\": \"<string>\",\n \"environment\": {\n \"python_version\": \"3.12\",\n \"pypi_dependencies\": [],\n \"environment_variables\": {}\n },\n \"kind\": \"python\",\n \"node_type\": \"python/run\",\n \"arguments\": {\n \"positional\": [],\n \"keyword\": {}\n },\n \"resources\": {\n \"cpu\": 1,\n \"memory_mib\": 1,\n \"gpu\": \"<string>\",\n \"timeout_seconds\": 300\n },\n \"depends_on\": []\n }\n ],\n \"outputs\": [\n {\n \"name\": \"<string>\",\n \"node_key\": \"<string>\",\n \"output_name\": \"result\"\n }\n ],\n \"inputs\": []\n },\n \"kind\": \"computation_graph\"\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://api.example.com/v1/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": {\n \"graph\": {\n \"nodes\": [\n {\n \"key\": \"<string>\",\n \"serialized_function\": \"<string>\",\n \"environment\": {\n \"python_version\": \"3.12\",\n \"pypi_dependencies\": [],\n \"environment_variables\": {}\n },\n \"kind\": \"python\",\n \"node_type\": \"python/run\",\n \"arguments\": {\n \"positional\": [],\n \"keyword\": {}\n },\n \"resources\": {\n \"cpu\": 1,\n \"memory_mib\": 1,\n \"gpu\": \"<string>\",\n \"timeout_seconds\": 300\n },\n \"depends_on\": []\n }\n ],\n \"outputs\": [\n {\n \"name\": \"<string>\",\n \"node_key\": \"<string>\",\n \"output_name\": \"result\"\n }\n ],\n \"inputs\": []\n },\n \"kind\": \"computation_graph\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/jobs")
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 \"definition\": {\n \"graph\": {\n \"nodes\": [\n {\n \"key\": \"<string>\",\n \"serialized_function\": \"<string>\",\n \"environment\": {\n \"python_version\": \"3.12\",\n \"pypi_dependencies\": [],\n \"environment_variables\": {}\n },\n \"kind\": \"python\",\n \"node_type\": \"python/run\",\n \"arguments\": {\n \"positional\": [],\n \"keyword\": {}\n },\n \"resources\": {\n \"cpu\": 1,\n \"memory_mib\": 1,\n \"gpu\": \"<string>\",\n \"timeout_seconds\": 300\n },\n \"depends_on\": []\n }\n ],\n \"outputs\": [\n {\n \"name\": \"<string>\",\n \"node_key\": \"<string>\",\n \"output_name\": \"result\"\n }\n ],\n \"inputs\": []\n },\n \"kind\": \"computation_graph\"\n }\n}"
response = http.request(request)
puts response.read_body{
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
An API key or OAuth2/OIDC access token sent as Authorization: Bearer <token>.
Body
application/json
Submit a user graph or a managed workflow through one jobs surface.
A complete declarative computation graph.
- ComputationGraphDefinition
- ReasoningDefinition
Show child attributes
Show child attributes