Get your API key from xAI here.
Create a virtual environment
Open the Terminal and create a python virtual environment.
Terminal
Install libraries
pip install -U openai phidata
Export `XAI_API_KEY`
export XAI_API_KEY=***
Run xAI Agent
python cookbook/providers/xai/basic.py
Was this page helpful?