Skip to main content
Glama

stateful_chat

Maintain server-side conversation history for up to 30 days, allowing you to continue chats across sessions without managing history manually. Start new conversations or resume existing ones using saved response IDs.

Instructions

Have ongoing conversations that are saved on xAI's servers for up to 30 days. Unlike regular chat, this maintains conversation history server-side, so you can continue conversations across sessions without managing history yourself. Start a new conversation without a response_id, then use the returned ID to continue it later. Super useful for long-running projects or when you want to pick up where you left off days later. Args: prompt: What you want to say in this turn of the conversation response_id: ID from a previous response to continue that conversation (optional) model: Which Grok model to use (default is grok-4) system_prompt: Instructions for the AI (only used when starting new conversation) include_reasoning: Get a summary of the model's thinking process (default False) temperature: Controls creativity 0-2 max_tokens: Maximum length of response Returns a dict with 'content' (the response), 'response_id' (save this to continue later!), 'status', 'model', 'usage', 'stored_until' (expiration date), and optionally 'reasoning' if you requested it.

Input Schema

NameRequiredDescriptionDefault
promptYes
response_idNo
modelNogrok-4
system_promptNo
include_reasoningNo
temperatureNo
max_tokensNo

Input Schema (JSON Schema)

{ "properties": { "include_reasoning": { "default": false, "title": "Include Reasoning", "type": "boolean" }, "max_tokens": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Max Tokens" }, "model": { "default": "grok-4", "title": "Model", "type": "string" }, "prompt": { "title": "Prompt", "type": "string" }, "response_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Response Id" }, "system_prompt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "System Prompt" }, "temperature": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Temperature" } }, "required": [ "prompt" ], "type": "object" }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/merterbak/Grok-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server