Skip to main content
Use ReasoningTools and YFinance with an explicit Grok 4.3 model to produce a TSLA report.
xAI now resolves the pinned grok-3-beta alias to grok-4.3, so its pricing and behavior follow Grok 4.3 rather than the original beta. Use the explicit current model ID before running. See Grok 4.3.
reasoning_agent.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your xAI API key

4

Use the explicit Grok model

Replace xAI(id="grok-3-beta") with xAI(id="grok-4.3") in the saved file.
5

Run the example

Save the code above as reasoning_agent.py, then run:
Full source: cookbook/90_models/xai/reasoning_agent.py