curl --request POST \
--url https://api.example.com/runs/stream \
--header 'Content-Type: application/json' \
--data '
{
"assistant_id": "<string>",
"input": {},
"config": {},
"context": {},
"checkpoint": {},
"checkpoint_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"checkpoint_during": true,
"stream": false,
"stream_mode": "<string>",
"on_disconnect": "<string>",
"multitask_strategy": "<string>",
"command": {},
"interrupt_before": "<string>",
"interrupt_after": "<string>",
"stream_subgraphs": false,
"metadata": {}
}
'import requests
url = "https://api.example.com/runs/stream"
payload = {
"assistant_id": "<string>",
"input": {},
"config": {},
"context": {},
"checkpoint": {},
"checkpoint_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"checkpoint_during": True,
"stream": False,
"stream_mode": "<string>",
"on_disconnect": "<string>",
"multitask_strategy": "<string>",
"command": {},
"interrupt_before": "<string>",
"interrupt_after": "<string>",
"stream_subgraphs": False,
"metadata": {}
}
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({
assistant_id: '<string>',
input: {},
config: {},
context: {},
checkpoint: {},
checkpoint_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
checkpoint_during: true,
stream: false,
stream_mode: '<string>',
on_disconnect: '<string>',
multitask_strategy: '<string>',
command: {},
interrupt_before: '<string>',
interrupt_after: '<string>',
stream_subgraphs: false,
metadata: {}
})
};
fetch('https://api.example.com/runs/stream', 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/runs/stream",
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([
'assistant_id' => '<string>',
'input' => [
],
'config' => [
],
'context' => [
],
'checkpoint' => [
],
'checkpoint_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'checkpoint_during' => true,
'stream' => false,
'stream_mode' => '<string>',
'on_disconnect' => '<string>',
'multitask_strategy' => '<string>',
'command' => [
],
'interrupt_before' => '<string>',
'interrupt_after' => '<string>',
'stream_subgraphs' => false,
'metadata' => [
]
]),
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/runs/stream"
payload := strings.NewReader("{\n \"assistant_id\": \"<string>\",\n \"input\": {},\n \"config\": {},\n \"context\": {},\n \"checkpoint\": {},\n \"checkpoint_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"checkpoint_during\": true,\n \"stream\": false,\n \"stream_mode\": \"<string>\",\n \"on_disconnect\": \"<string>\",\n \"multitask_strategy\": \"<string>\",\n \"command\": {},\n \"interrupt_before\": \"<string>\",\n \"interrupt_after\": \"<string>\",\n \"stream_subgraphs\": false,\n \"metadata\": {}\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/runs/stream")
.header("Content-Type", "application/json")
.body("{\n \"assistant_id\": \"<string>\",\n \"input\": {},\n \"config\": {},\n \"context\": {},\n \"checkpoint\": {},\n \"checkpoint_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"checkpoint_during\": true,\n \"stream\": false,\n \"stream_mode\": \"<string>\",\n \"on_disconnect\": \"<string>\",\n \"multitask_strategy\": \"<string>\",\n \"command\": {},\n \"interrupt_before\": \"<string>\",\n \"interrupt_after\": \"<string>\",\n \"stream_subgraphs\": false,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/runs/stream")
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 \"assistant_id\": \"<string>\",\n \"input\": {},\n \"config\": {},\n \"context\": {},\n \"checkpoint\": {},\n \"checkpoint_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"checkpoint_during\": true,\n \"stream\": false,\n \"stream_mode\": \"<string>\",\n \"on_disconnect\": \"<string>\",\n \"multitask_strategy\": \"<string>\",\n \"command\": {},\n \"interrupt_before\": \"<string>\",\n \"interrupt_after\": \"<string>\",\n \"stream_subgraphs\": false,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Stateless Stream Run
Create a stateless run and stream its execution.
Generates an ephemeral thread, delegates to the threaded
create_and_stream_run endpoint, and deletes the thread after the
stream finishes (unless on_completion="keep").
curl --request POST \
--url https://api.example.com/runs/stream \
--header 'Content-Type: application/json' \
--data '
{
"assistant_id": "<string>",
"input": {},
"config": {},
"context": {},
"checkpoint": {},
"checkpoint_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"checkpoint_during": true,
"stream": false,
"stream_mode": "<string>",
"on_disconnect": "<string>",
"multitask_strategy": "<string>",
"command": {},
"interrupt_before": "<string>",
"interrupt_after": "<string>",
"stream_subgraphs": false,
"metadata": {}
}
'import requests
url = "https://api.example.com/runs/stream"
payload = {
"assistant_id": "<string>",
"input": {},
"config": {},
"context": {},
"checkpoint": {},
"checkpoint_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"checkpoint_during": True,
"stream": False,
"stream_mode": "<string>",
"on_disconnect": "<string>",
"multitask_strategy": "<string>",
"command": {},
"interrupt_before": "<string>",
"interrupt_after": "<string>",
"stream_subgraphs": False,
"metadata": {}
}
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({
assistant_id: '<string>',
input: {},
config: {},
context: {},
checkpoint: {},
checkpoint_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
checkpoint_during: true,
stream: false,
stream_mode: '<string>',
on_disconnect: '<string>',
multitask_strategy: '<string>',
command: {},
interrupt_before: '<string>',
interrupt_after: '<string>',
stream_subgraphs: false,
metadata: {}
})
};
fetch('https://api.example.com/runs/stream', 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/runs/stream",
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([
'assistant_id' => '<string>',
'input' => [
],
'config' => [
],
'context' => [
],
'checkpoint' => [
],
'checkpoint_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'checkpoint_during' => true,
'stream' => false,
'stream_mode' => '<string>',
'on_disconnect' => '<string>',
'multitask_strategy' => '<string>',
'command' => [
],
'interrupt_before' => '<string>',
'interrupt_after' => '<string>',
'stream_subgraphs' => false,
'metadata' => [
]
]),
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/runs/stream"
payload := strings.NewReader("{\n \"assistant_id\": \"<string>\",\n \"input\": {},\n \"config\": {},\n \"context\": {},\n \"checkpoint\": {},\n \"checkpoint_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"checkpoint_during\": true,\n \"stream\": false,\n \"stream_mode\": \"<string>\",\n \"on_disconnect\": \"<string>\",\n \"multitask_strategy\": \"<string>\",\n \"command\": {},\n \"interrupt_before\": \"<string>\",\n \"interrupt_after\": \"<string>\",\n \"stream_subgraphs\": false,\n \"metadata\": {}\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/runs/stream")
.header("Content-Type", "application/json")
.body("{\n \"assistant_id\": \"<string>\",\n \"input\": {},\n \"config\": {},\n \"context\": {},\n \"checkpoint\": {},\n \"checkpoint_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"checkpoint_during\": true,\n \"stream\": false,\n \"stream_mode\": \"<string>\",\n \"on_disconnect\": \"<string>\",\n \"multitask_strategy\": \"<string>\",\n \"command\": {},\n \"interrupt_before\": \"<string>\",\n \"interrupt_after\": \"<string>\",\n \"stream_subgraphs\": false,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/runs/stream")
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 \"assistant_id\": \"<string>\",\n \"input\": {},\n \"config\": {},\n \"context\": {},\n \"checkpoint\": {},\n \"checkpoint_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"checkpoint_during\": true,\n \"stream\": false,\n \"stream_mode\": \"<string>\",\n \"on_disconnect\": \"<string>\",\n \"multitask_strategy\": \"<string>\",\n \"command\": {},\n \"interrupt_before\": \"<string>\",\n \"interrupt_after\": \"<string>\",\n \"stream_subgraphs\": false,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
Request model for creating runs
Assistant to execute
Input data for the run. Optional when resuming from a checkpoint.
Execution config
Execution context
Checkpoint configuration (e.g., {'checkpoint_id': '...', 'checkpoint_ns': ''})
Checkpoint to run from. Short form of checkpoint={'checkpoint_id': ...}; 'checkpoint' wins if both set.
When checkpoints are persisted: 'sync' before each next step starts, 'async' in the background while the next step runs (LangGraph default), 'exit' only once, when the run ends. Overrides the server default (checkpointer.durability).
sync, async, exit Deprecated alias for durability: true means 'async', false means 'exit'. 'durability' wins if both are set.
Enable streaming response
Requested stream mode(s)
Behavior on client disconnect: 'cancel' (default) or 'continue'.
Behavior after stateless run completes: 'delete' (default) removes the ephemeral thread, 'keep' preserves it.
delete, keep Strategy for handling concurrent runs on same thread: 'reject', 'interrupt', 'rollback', or 'enqueue'.
Command for resuming interrupted runs with state updates or navigation
Nodes to interrupt immediately before they get executed. Use '*' for all nodes.
Nodes to interrupt immediately after they get executed. Use '*' for all nodes.
Whether to include subgraph events in streaming. When True, includes events from all subgraphs. When False (default when None), excludes subgraph events. Defaults to False for backwards compatibility.
Request metadata propagated to OTEL trace attributes (langfuse.trace.metadata.<key>). Keys must match [A-Za-z0-9_-]{1,64}. Values must be primitive (str, int, float, bool); string values are capped at 512 characters. Maximum 32 keys. Use this for filterable attributes (tenant, feature flag, environment, sub-agent type) rather than payload data.
Response
Server-Sent Events stream