chat
Send text prompts to Grok AI models for conversational responses, with optional session history, system instructions, and multi-agent capabilities.
Instructions
Send a text prompt to a Grok model and return its reply.
Replays prior turns from `chats/{session}.json` when a session is given,
then appends the new user message and saves the round trip.
Args:
prompt: User message to send to the model.
session: Optional session name. Loads and appends history to `chats/{session}.json`.
model: Grok model id (default `grok-4-1-fast-reasoning`).
system_prompt: Optional system instruction prepended to the conversation.
agent_count: 4 or 16. Only valid with `grok-4.20-multi-agent` for multi-agent research.
Returns:
The assistant's reply text.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| session | No | ||
| model | No | grok-4-1-fast-reasoning | |
| system_prompt | No | ||
| agent_count | No |