Skip to main content
Early Beta — The Web SDK is in early beta. APIs may change between releases.

Overview

Pass a prompt and nothing else. Every other option falls back to the SDK default, so this is the shortest path from a loaded model to text.

Basic usage

For a plain string with no metrics, RunAnywhere.textGeneration.chat() wraps the same call:

Signature

Conversation history

Prior turns go on history as ChatMessage values, not concatenated into the prompt. A conversationId lets a backend reuse its prompt cache across turns.
timestampUs is microseconds since the Unix epoch, and ChatMessage is a proto message, so the required scalar and repeated fields (toolCalls, metadata, attachments) must be present.

With options

Error handling

See Error handling for the full error surface.

Generate

Full generation with options and metrics

Streaming

Real-time token streaming