stateful_chat
Send a user prompt and optional previous response ID to continue a stored conversation. Omit the response ID to start a fresh thread.
Instructions
Continue a server-side stored conversation using xAI's deferred/stateful chat.
The xAI API stores every turn so the client only needs to send the latest
prompt plus `previous_response_id`. Omit `response_id` to start a new thread.
Args:
prompt: User message to append.
model: Grok model id (default `grok-4.3`).
response_id: ID of the previous response to continue from (omit to start fresh).
system_prompt: Optional system instruction. Applied only on the first turn.
Returns:
Assistant reply followed by the new `**Response ID:**` to pass back next turn.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| model | No | grok-4.3 | |
| response_id | No | ||
| system_prompt | No |