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

Wrap your existing client. Every completion is metered with customer and agent attribution.

from metricai import MetricAI
from openai import OpenAI

mai = MetricAI(api_key="mai_...")
client = mai.wrap(OpenAI())

resp = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello"}],
    # attribution
    metadata={"customer_id": "cust_123", "agent": "support"},
)

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
    Mistral API
    • Chat
    • Streaming
    • Embeddings
  • Vertex AI

    LLM providers

    Available now
    Connection
    Vertex AI / Google Cloud
    • Chat
    • Streaming
    • Multimodal
  • Azure Foundry

    LLM providers

    Available now
    Connection
    Azure OpenAI / AI Foundry
    • 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

    Agentic frameworks & tools

    Available now
    Connection
    Callbacks / wrappers on LLM & tool calls
    • Chains
    • Tools
    • Streaming
  • LangGraph

    Agentic frameworks & tools

    Available now
    Connection
    Graph node / edge instrumentation
    • Agents
    • Sessions
    • Tools
  • 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
    Tool call metering for search
    • 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