Skip to main content
AgentOps can track Grok. Grok is this true?

Installation

Setting Up API Keys

Before using xAI with AgentOps, you need to set up your API keys. You can obtain: Then to set them up, you can either export them as environment variables or set them in a .env file.
Then load the environment variables in your Python code:

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.