Loading page
Integrations

Connect the AI stack you already use

Meter LLM, voice, agent, and tool usage through one financial layer. See what each integration captures before you ship.

Three integrations, end to end

What actually changes in your code, and what the ledger gets back.

OpenAI

Init once, then stream as usual. Every chunk is metered with customer and agent attribution.

import os
import metricai
from openai import OpenAI

metricai.init(
    api_key=os.getenv("METRICAI_API_KEY"),
    auto_instrument=True,
    default_agent_id="support",
    default_user_id="cust_123",
    llm_keys={"openai": os.getenv("OPENAI_API_KEY")},
)

client = OpenAI()
stream = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello"}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Full integration catalogue

Support status is stated honestly - beta means it works and is still hardening.

  • OpenAI

    LLM providers

    Available now
    Connection
    SDK wrap or OpenAI-compatible proxy
    • Chat
    • Streaming
    • Embeddings
    • Tools
  • Anthropic

    LLM providers

    Available now
    Connection
    SDK wrap or Anthropic Messages API
    • Chat
    • Streaming
    • Tools
  • Google Gemini

    LLM providers

    Available now
    Connection
    Google Generative AI SDK
    • Chat
    • Streaming
    • Multimodal
  • Grok

    LLM providers

    Available now
    Connection
    xAI OpenAI-compatible API
    • Chat
    • Streaming
  • Groq

    LLM providers

    Available now
    Connection
    Groq OpenAI-compatible API
    • Chat
    • Streaming
  • Mistral

    LLM providers

    Available now
    Connection
    LangChain ChatMistralAI + auto-instrument
    • Chat
    • Streaming
    • Embeddings
  • Vertex AI

    LLM providers

    Available now
    Connection
    google-genai Client + Vertex SA credentials
    • Chat
    • Streaming
    • Multimodal
  • Azure Foundry

    LLM providers

    Available now
    Connection
    OpenAI SDK + azure_openai llm_keys
    • Chat
    • Streaming
    • Embeddings
  • Bedrock

    LLM providers

    Available now
    Connection
    AWS Bedrock Runtime
    • Chat
    • Streaming
  • CrewAI

    Agentic frameworks & tools

    Available now
    Connection
    SDK instrumentation around Crew runs
    • Agents
    • Tools
    • Sessions
  • LangChain & LangGraph

    Agentic frameworks & tools

    Available now
    Connection
    Native Chat* models via auto-instrument
    • Chains
    • Agents
    • Tools
    • Streaming
  • LlamaIndex

    Agentic frameworks & tools

    Available now
    Connection
    Callback handlers on LLM & retrieval
    • RAG
    • Tools
    • Streaming
  • AutoGen

    Agentic frameworks & tools

    Beta
    Connection
    Agent conversation wrappers
    • Agents
    • Tools
    • Sessions
  • Tavily

    Agentic frameworks & tools

    Available now
    Connection
    Native SDK + LangChain TavilySearch
    • Tools
    • Cost attribution
  • LiveKit

    Voice & realtime

    Available now
    Connection
    Session metering for realtime agents
    • Audio minutes
    • Sessions
    • Tools
  • Deepgram

    Voice & realtime

    Available now
    Connection
    STT usage events
    • Audio minutes
    • Streaming
  • ElevenLabs

    Voice & realtime

    Available now
    Connection
    TTS usage events
    • Audio minutes
    • Characters
  • Sarvam AI

    Voice & realtime

    Available now
    Connection
    Voice / speech API metering
    • Audio minutes
    • Streaming
  • Custom LLM / OpenAI-compatible

    Custom & self-hosted

    Available now
    Connection
    Normalized usage events via SDK or REST
    • Tokens
    • Cost
    • Attribution
  • Custom tools & internal APIs

    Custom & self-hosted

    Available now
    Connection
    Emit tool-call events with unit + cost
    • Tool calls
    • Sessions
    • Attribution
Custom & self-hosted

Your model. Your tools. Same ledger.

Use automatic integrations for supported providers, or send normalized usage events from custom LLMs, self-hosted inference, internal tools, and OpenAI-compatible APIs.

  • Custom LLM / OpenAI-compatible

    Available now

    Meterable units

    • input_tokens
    • output_tokens
    • requests
    • cost

    Connection: Normalized usage events via SDK or REST

  • Custom tools & internal APIs

    Available now

    Meterable units

    • tool_calls
    • units
    • duration_ms
    • cost

    Connection: Emit tool-call events with unit + cost

Track a custom tool call

One call, fully attributable and safe to retry.

await mai.track({
  event_type: "tool_call",
  customer_id: "cust_123",
  agent: "research-agent",
  tool: "internal_search",
  units: 1,
  cost_usd: 0.002,
  idempotency_key: "evt_7f3a...",
})

What a usage event carries

Every event - automatic or custom - normalises to these fields.

  • customer_id / workspace - who to bill or attribute
  • agent / session - where the spend happened
  • model / provider / tool - what was invoked
  • units + cost - tokens, seconds, calls, or dollars
  • idempotency_key - safe retries, no double billing
  • timestamp + latency - when it ran and how long

Don't see your provider?

Tell us what you are building. We prioritize integrations with active production teams.

Request an integration