---
title: "stream message · RUAL Documentation"
description: "Send a prompt to Claude and stream the reply token-by-token to a WebSocket channel as it generates, then return the full text."
canonical: https://docs.rual.nl/block-types/anthropic/anthropicconnection_message_stream
language: en
---

# stream message

This block is part of the [`anthropic`](https://docs.rual.nl/block-types/anthropic) group and was last modified in core [`v15.0.0`](https://docs.rual.nl/core-versions/150000).

Send a prompt to Claude and stream the reply token-by-token to a WebSocket channel as it generates, then return the full text.

- flow `flow`

- connection required `anthropicconnection`

- memory `anthropicmemory` Optional. A memory (from create memory); prior turns are loaded in and this exchange is appended, so the chat continues across runs.

- prompt required `value` The user prompt.

- system `value` Optional system prompt (instructions / persona).

- attachments `file` Optional images/PDFs to send with the prompt. For large documents with an expensive model, run them through preflight document first to cut tokens.

- model `value` Model ID. Defaults to the connection's default model. • Suggestions: `claude-opus-4-8` `claude-sonnet-4-6` `claude-haiku-4-5`

- max tokens `number` Max tokens to generate. Defaults to 16000.

- thinking `condition` Enable adaptive extended thinking.

- cache `condition` Cache the system prompt (prompt caching) for cheaper repeated calls.

- effort `value` Reasoning effort: low | medium | high | xhigh | max. • Suggestions: `low` `medium` `high` `xhigh` `max`

- channel `value` WebSocket channel to broadcast tokens to (the frontend subscribes to it). Leave empty to stream straight to the calling WebSocket connection instead.

- event `value` Event name for the broadcast frames. Defaults to anthropic_delta.

- flow `flow`

- connection `anthropicconnection`

- memory `anthropicmemory` The memory, passed through with this turn appended; chain it into the next send message.

- success `condition`

- text `value` The full reply (also delivered live over the channel/spark).

- usage `object` Token counts plus the call cost: input_tokens, output_tokens, cache_read_input_tokens, cache_creation_input_tokens, cost_usd.

- stop reason `value`

- partial `value`

- errors `array ` Error codes when the call fails (success=false): config_error, internal_error, model_not_allowed, budget_exceeded, concurrency_limit_exceeded, rate_limited, refused, max_tokens, transport_error.

- warnings `array ` Non-fatal notices: cost_unknown.

- error detail `value`

- on delta `execute_function` Optional: run this function for every streamed chunk. It receives the chunk, its index and the text so far. Keep it light; it runs synchronously per chunk and a heavy callback slows the stream.

| `stream` |
| --- |
| `live message` |
| `streaming chat` |
| `typewriter` |
| `sse` |

A typical wiring for [stream message](https://docs.rual.nl/block-types/anthropic/anthropicconnection_message_stream): a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) starts the flow; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `prompt` pin; the function out pin wires to an [execute](https://docs.rual.nl/block-types/function%20execution/function_custom_execute_from_trigger) block.

![Studio canvas example for the stream message block: typical wiring for stream message.](https://docs.rual.nl/canvas-examples/anthropicconnection_message_stream.png)

### Version history

Introduced in [`v15.0.0`](https://docs.rual.nl/core-versions/150000).
