Skip to main content
AgentOps provides seamless integration with LiteLLM, allowing you to automatically track all your LLM API calls across different providers through a unified interface.

Installation

Setting Up API Keys

Before using LiteLLM with AgentOps, you need to set up your API keys. You can obtain:
  • Provider API Keys: From your chosen LLM provider (OpenAI, Anthropic, Google, etc.)
  • AGENTOPS_API_KEY: From your AgentOps Dashboard
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

The simplest way to integrate AgentOps with LiteLLM is to set up the success_callback.

Examples

More Examples

LiteLLM Quickstart Notebook

For more information on integrating AgentOps with LiteLLM, refer to the LiteLLM documentation on AgentOps integration.