Skip to main content

Installation

Usage

Option 1: Global Tracking

Option 2: Prompt Filter

How It Works

MeshAI integrates via Semantic Kernel’s function invocation filter system. The MeshAIPromptFilter intercepts prompt render and completion events:
  1. Extracts the model name from the AI service configuration
  2. Extracts token counts from the completion result metadata
  3. Infers the provider from the model or service type
  4. Sends the usage event to MeshAI (buffered, non-blocking)
Works with all Semantic Kernel AI connectors: OpenAI, Azure OpenAI, Google, HuggingFace, and others.

Alternative: Proxy (Zero-Code)

If your Semantic Kernel uses OpenAI or Azure OpenAI, route through the proxy: