Stream a chat reply
curl --request POST \
--url https://api.dualmindlab.tech/api/arena/chat/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Write a limerick about latency"
}
'import requests
url = "https://api.dualmindlab.tech/api/arena/chat/stream"
payload = { "prompt": "Write a limerick about latency" }
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({prompt: 'Write a limerick about latency'})
};
fetch('https://api.dualmindlab.tech/api/arena/chat/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({prompt: 'Write a limerick about latency'})
};
fetch('https://api.dualmindlab.tech/api/arena/chat/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dualmindlab.tech/api/arena/chat/stream"
payload := strings.NewReader("{\n \"prompt\": \"Write a limerick about latency\"\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))
}using RestSharp;
var options = new RestClientOptions("https://api.dualmindlab.tech/api/arena/chat/stream");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"prompt\": \"Write a limerick about latency\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://api.dualmindlab.tech/api/arena/chat/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Write a limerick about latency\"\n}")
.asString();data: {"object":"ai.stream.delta","delta":{"type":"output_text","text":"There once"}}
data: {"object":"ai.stream.delta","delta":{"type":"output_text","text":" was a packet"}}
data: {"object":"ai.stream.done","finishReason":"stop"}
Arena
Stream a chat reply
Same request as POST /api/arena/chat, but the reply streams back as Server-Sent Events. Each event is a data: line with a JSON object: ai.stream.delta chunks, then one ai.stream.done. Errors arrive as an ai.error event.
POST
/
api
/
arena
/
chat
/
stream
Stream a chat reply
curl --request POST \
--url https://api.dualmindlab.tech/api/arena/chat/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Write a limerick about latency"
}
'import requests
url = "https://api.dualmindlab.tech/api/arena/chat/stream"
payload = { "prompt": "Write a limerick about latency" }
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({prompt: 'Write a limerick about latency'})
};
fetch('https://api.dualmindlab.tech/api/arena/chat/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({prompt: 'Write a limerick about latency'})
};
fetch('https://api.dualmindlab.tech/api/arena/chat/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dualmindlab.tech/api/arena/chat/stream"
payload := strings.NewReader("{\n \"prompt\": \"Write a limerick about latency\"\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))
}using RestSharp;
var options = new RestClientOptions("https://api.dualmindlab.tech/api/arena/chat/stream");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"prompt\": \"Write a limerick about latency\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://api.dualmindlab.tech/api/arena/chat/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Write a limerick about latency\"\n}")
.asString();data: {"object":"ai.stream.delta","delta":{"type":"output_text","text":"There once"}}
data: {"object":"ai.stream.delta","delta":{"type":"output_text","text":" was a packet"}}
data: {"object":"ai.stream.done","finishReason":"stop"}
The streaming guide has complete readers for JavaScript and Python. Use
curl -N to watch the raw stream.Authorizations
The access token from your DualMind Arena session (a Supabase JWT). See Authentication.
Body
application/json
The user prompt. Must not be empty.
Example:
"Explain TCP vs UDP with a pizza analogy"
Model to use: a modelName (or modelId) from GET /api/models, or auto to let the Arena pick a random model.
Example:
"auto"
Optional system prompt.
Maximum tokens to generate.
Required range:
x >= 1Sampling temperature.
Required range:
0 <= x <= 2Save the prompt and reply to this thread. You must own the thread.
Last modified on October 18, 2026
⌘I