xAI develops the Grok and Grok Vision models. Explore their developer docs here.

1

Install the AgentOps SDK

2

Install XAI libraries

xAI models can be accessed via OpenAI or Anthropic clients.

To install the OpenAI client, run:

To install the Anthropic client, run:

3

Add AgentOps to your code

Make sure to call agentops.init before calling any openai, cohere, crew, etc models.

Set your API key as an .env variable for easy access.

Read more about environment variables in Advanced Configuration

4

Run your Analysis

Execute your program and visit app.agentops.ai/drilldown to observe your XAI analysis! 🔍

AgentOps automatically tracks your XAI metrics and visualizations in the Dashboard

Full Examples