Skip to main content
POST
/
api
/
ai
/
prompt-assistant
/
stream
Conversational prompt assistant (streaming)
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"
  }
}
'
{
  "type": "assistant-delta",
  "delta": "Sure — I can tighten that up for you."
}

Documentation Index

Fetch the complete documentation index at: https://docs.tetherai.ca/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
instruction
string
required

Latest user turn in the assistant conversation. Classified into chat/clarify/draft mode before any prompt edit is attempted.

currentPrompt
string

The prompt XML currently in the editor; used as read-only grounding for chat/clarify and as the basis for diff when drafting.

conversationHistory
object[]

Prior assistant turns in this editor session, replayed so the model can carry context. Empty or malformed entries are dropped server-side.

variableContext
object

Available runtime variables and field scopes; the assistant only references @variables that appear here and never invents new ones.

assistedMode
boolean

When true, the assistant clarifies ambiguity instead of drafting directly, and any draft uses the stronger XML architecture system prompt.

modelOverride
object

Pin to a specific provider/model (e.g. { provider: 'anthropic', model: 'claude-sonnet-4-6' }) overriding the org's default assignment.

Example:
{
"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.

type
enum<string>
required
Available options:
mode,
status,
assistant-delta,
reasoning-delta,
draft-ready,
ai-setup-required,
error,
done
mode
enum<string>
Available options:
chat,
clarify,
draft
label
string
delta
string
prompt
string
code
string
reason
string
section
string
provider
string
message
string
error
string