Installation
Setting Up API Keys
Before using xAI with AgentOps, you need to set up your API keys. You can obtain:- XAI_API_KEY: From the xAI Developer Platform
- AGENTOPS_API_KEY: From your AgentOps Dashboard
.env file.
Usage
Initialize AgentOps at the beginning of your application. Then, use the OpenAI SDK with xAI’s base URL to interact with Grok. AgentOps will automatically track all API calls.Examples
Grok Simple Example
Basic usage patterns for Grok LLM
Grok Vision Example
Demonstrates using Grok with vision capabilities.

