Usage guide
Setup, environment variables, and Python/JavaScript/Go usage examples.
XAILLM
Text generation with xAI’s Grok models, using your own xAI API key. Good for fast conversational agents with tool calling. Authenticates with XAI_API_KEY from your environment, or an explicitapi_key.
Fields
Base URL of the xAI API. Change it only when routing through a proxy or compatible endpoint. Defaults to ‘https://api.x.ai/v1’.
Sampling temperature, 0 to 2. Lower values give more focused, repeatable replies. Defaults to 0.7.
How the model may call tools: “auto” lets it decide, “required” forces a tool call, “none” disables tools. Defaults to ‘auto’.
Maximum number of tokens the model may generate per reply. Leave unset for no explicit limit. Defaults to None (not set).