curl --request POST \
--url https://your-instance.example.com/api/ai/prompt-assistant/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instruction": "Tighten the tone — make it more concise and less salesy.",
"currentPrompt": "<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>",
"conversationHistory": [
{
"role": "user",
"content": "It feels a bit pushy."
},
{
"role": "assistant",
"content": "Got it — what tone would you like instead?"
}
],
"assistedMode": true,
"modelOverride": {
"provider": "anthropic",
"model": "claude-sonnet-4-6"
}
}
'import requests
url = "https://your-instance.example.com/api/ai/prompt-assistant/stream"
payload = {
"instruction": "Tighten the tone — make it more concise and less salesy.",
"currentPrompt": "<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>",
"conversationHistory": [
{
"role": "user",
"content": "It feels a bit pushy."
},
{
"role": "assistant",
"content": "Got it — what tone would you like instead?"
}
],
"assistedMode": True,
"modelOverride": {
"provider": "anthropic",
"model": "claude-sonnet-4-6"
}
}
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({
instruction: 'Tighten the tone — make it more concise and less salesy.',
currentPrompt: '<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>',
conversationHistory: [
{role: 'user', content: 'It feels a bit pushy.'},
{role: 'assistant', content: 'Got it — what tone would you like instead?'}
],
assistedMode: true,
modelOverride: {provider: 'anthropic', model: 'claude-sonnet-4-6'}
})
};
fetch('https://your-instance.example.com/api/ai/prompt-assistant/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://your-instance.example.com/api/ai/prompt-assistant/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([
'instruction' => 'Tighten the tone — make it more concise and less salesy.',
'currentPrompt' => '<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>',
'conversationHistory' => [
[
'role' => 'user',
'content' => 'It feels a bit pushy.'
],
[
'role' => 'assistant',
'content' => 'Got it — what tone would you like instead?'
]
],
'assistedMode' => true,
'modelOverride' => [
'provider' => 'anthropic',
'model' => 'claude-sonnet-4-6'
]
]),
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://your-instance.example.com/api/ai/prompt-assistant/stream"
payload := strings.NewReader("{\n \"instruction\": \"Tighten the tone — make it more concise and less salesy.\",\n \"currentPrompt\": \"<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>\",\n \"conversationHistory\": [\n {\n \"role\": \"user\",\n \"content\": \"It feels a bit pushy.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Got it — what tone would you like instead?\"\n }\n ],\n \"assistedMode\": true,\n \"modelOverride\": {\n \"provider\": \"anthropic\",\n \"model\": \"claude-sonnet-4-6\"\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://your-instance.example.com/api/ai/prompt-assistant/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instruction\": \"Tighten the tone — make it more concise and less salesy.\",\n \"currentPrompt\": \"<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>\",\n \"conversationHistory\": [\n {\n \"role\": \"user\",\n \"content\": \"It feels a bit pushy.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Got it — what tone would you like instead?\"\n }\n ],\n \"assistedMode\": true,\n \"modelOverride\": {\n \"provider\": \"anthropic\",\n \"model\": \"claude-sonnet-4-6\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/ai/prompt-assistant/stream")
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 \"instruction\": \"Tighten the tone — make it more concise and less salesy.\",\n \"currentPrompt\": \"<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>\",\n \"conversationHistory\": [\n {\n \"role\": \"user\",\n \"content\": \"It feels a bit pushy.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Got it — what tone would you like instead?\"\n }\n ],\n \"assistedMode\": true,\n \"modelOverride\": {\n \"provider\": \"anthropic\",\n \"model\": \"claude-sonnet-4-6\"\n }\n}"
response = http.request(request)
puts response.read_body{
"type": "assistant-delta",
"delta": "Sure — I can tighten that up for you."
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}Conversational prompt assistant (streaming)
Conversational prompt assistant that streams assistant reply deltas and may emit a draft prompt update. Classifies the user turn into chat, clarify, or draft mode, then streams a series of newline-delimited JSON events (mode, status, assistant-delta, reasoning-delta, draft-ready, done, error). Response uses application/x-ndjson; treat each line as a discrete event.
curl --request POST \
--url https://your-instance.example.com/api/ai/prompt-assistant/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instruction": "Tighten the tone — make it more concise and less salesy.",
"currentPrompt": "<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>",
"conversationHistory": [
{
"role": "user",
"content": "It feels a bit pushy."
},
{
"role": "assistant",
"content": "Got it — what tone would you like instead?"
}
],
"assistedMode": true,
"modelOverride": {
"provider": "anthropic",
"model": "claude-sonnet-4-6"
}
}
'import requests
url = "https://your-instance.example.com/api/ai/prompt-assistant/stream"
payload = {
"instruction": "Tighten the tone — make it more concise and less salesy.",
"currentPrompt": "<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>",
"conversationHistory": [
{
"role": "user",
"content": "It feels a bit pushy."
},
{
"role": "assistant",
"content": "Got it — what tone would you like instead?"
}
],
"assistedMode": True,
"modelOverride": {
"provider": "anthropic",
"model": "claude-sonnet-4-6"
}
}
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({
instruction: 'Tighten the tone — make it more concise and less salesy.',
currentPrompt: '<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>',
conversationHistory: [
{role: 'user', content: 'It feels a bit pushy.'},
{role: 'assistant', content: 'Got it — what tone would you like instead?'}
],
assistedMode: true,
modelOverride: {provider: 'anthropic', model: 'claude-sonnet-4-6'}
})
};
fetch('https://your-instance.example.com/api/ai/prompt-assistant/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://your-instance.example.com/api/ai/prompt-assistant/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([
'instruction' => 'Tighten the tone — make it more concise and less salesy.',
'currentPrompt' => '<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>',
'conversationHistory' => [
[
'role' => 'user',
'content' => 'It feels a bit pushy.'
],
[
'role' => 'assistant',
'content' => 'Got it — what tone would you like instead?'
]
],
'assistedMode' => true,
'modelOverride' => [
'provider' => 'anthropic',
'model' => 'claude-sonnet-4-6'
]
]),
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://your-instance.example.com/api/ai/prompt-assistant/stream"
payload := strings.NewReader("{\n \"instruction\": \"Tighten the tone — make it more concise and less salesy.\",\n \"currentPrompt\": \"<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>\",\n \"conversationHistory\": [\n {\n \"role\": \"user\",\n \"content\": \"It feels a bit pushy.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Got it — what tone would you like instead?\"\n }\n ],\n \"assistedMode\": true,\n \"modelOverride\": {\n \"provider\": \"anthropic\",\n \"model\": \"claude-sonnet-4-6\"\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://your-instance.example.com/api/ai/prompt-assistant/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instruction\": \"Tighten the tone — make it more concise and less salesy.\",\n \"currentPrompt\": \"<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>\",\n \"conversationHistory\": [\n {\n \"role\": \"user\",\n \"content\": \"It feels a bit pushy.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Got it — what tone would you like instead?\"\n }\n ],\n \"assistedMode\": true,\n \"modelOverride\": {\n \"provider\": \"anthropic\",\n \"model\": \"claude-sonnet-4-6\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/ai/prompt-assistant/stream")
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 \"instruction\": \"Tighten the tone — make it more concise and less salesy.\",\n \"currentPrompt\": \"<prompt><role>Leasing assistant</role><goal>Convert leads into tours.</goal></prompt>\",\n \"conversationHistory\": [\n {\n \"role\": \"user\",\n \"content\": \"It feels a bit pushy.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Got it — what tone would you like instead?\"\n }\n ],\n \"assistedMode\": true,\n \"modelOverride\": {\n \"provider\": \"anthropic\",\n \"model\": \"claude-sonnet-4-6\"\n }\n}"
response = http.request(request)
puts response.read_body{
"type": "assistant-delta",
"delta": "Sure — I can tighten that up for you."
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Latest user turn in the assistant conversation. Classified into chat/clarify/draft mode before any prompt edit is attempted.
The prompt XML currently in the editor; used as read-only grounding for chat/clarify and as the basis for diff when drafting.
Prior assistant turns in this editor session, replayed so the model can carry context. Empty or malformed entries are dropped server-side.
Show child attributes
Show child attributes
Available runtime variables and field scopes; the assistant only references @variables that appear here and never invents new ones.
When true, the assistant clarifies ambiguity instead of drafting directly, and any draft uses the stronger XML architecture system prompt.
Pin to a specific provider/model (e.g. { provider: 'anthropic', model: 'claude-sonnet-4-6' }) overriding the org's default assignment.
Show child attributes
Show child attributes
{
"provider": "anthropic",
"model": "claude-sonnet-4-6"
}
Response
NDJSON event stream of assistant reply deltas and optional draft prompt
One newline-delimited JSON event from the prompt-assistant stream. Possible types: mode, status, assistant-delta, reasoning-delta, draft-ready, ai-setup-required, error, done.
mode, status, assistant-delta, reasoning-delta, draft-ready, ai-setup-required, error, done chat, clarify, draft