Omnibus
Skill 79 of 200
Add PostHog AI Observability to trace AI model usage.
4 minutes · 805 words · 4 sections
Install
npx skills add PostHog/skills --skill instrument-llm-analyticsnpx skills add PostHog/skills/plugin marketplace add PostHog/skillsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
Use this skill to add PostHog AI Observability that traces AI model usage in new or changed code. Use it after implementing LLM features or reviewing PRs to ensure all generations are captured with token counts, latency, and costs. If PostHog is not yet installed, this skill also covers initial SDK setup. Supports any provider or framework.
Supported providers: OpenAI, Azure OpenAI, Anthropic, Google, Cohere, Mistral, Perplexity, DeepSeek, Groq, Together AI, Fireworks AI, xAI, Cerebras, Hugging Face, Ollama, OpenRouter.
Supported frameworks: LangChain, LlamaIndex, CrewAI, AutoGen, DSPy, LangGraph, Pydantic AI, Vercel AI, LiteLLM, Instructor, Semantic Kernel, Mirascope, Mastra, SmolAgents, OpenAI Agents.
Proxy/gateway: Portkey, Helicone.
Follow these steps IN ORDER:
STEP 1: Analyze the codebase and detect the LLM stack.
STEP 2: Research instrumentation. (Skip if PostHog LLM tracing is already set up.) 2.1. Find the reference file below that matches the detected provider or framework — it is the source of truth for callback setup, middleware configuration, and event capture. Read it now. 2.2. If no reference matches, use manual-capture.md as a fallback — it covers the generic event capture approach that works with any provider.
STEP 3: Install the PostHog SDK. (Skip if PostHog is already set up.)
STEP 4: Add LLM tracing.
STEP 5: Link to users.
STEP 6: Set up environment variables.
.env, .env.local, or framework-specific env files). If valid values already exist, skip this step.projects-get tool to retrieve the project’s api_token. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project token instead.projects-get MCP response for a region field — US maps to https://us.i.posthog.com, EU maps to https://eu.i.posthog.com. If the region is not available from the MCP response or from existing project configuration, ask the user: “Are you on PostHog US Cloud or EU Cloud?” Do not assume US Cloud.references/openai.md - Openai observability installationreferences/azure-openai.md - Azure openai observability installationreferences/README.md - PostHog.ai for .netreferences/anthropic.md - Anthropic ai observability installationreferences/google.md - Google ai observability installationreferences/cohere.md - Cohere ai observability installationreferences/mistral.md - Mistral ai observability installationreferences/perplexity.md - Perplexity ai observability installationreferences/deepseek.md - Deepseek ai observability installationreferences/groq.md - Groq ai observability installationreferences/together-ai.md - Together ai observability installationreferences/fireworks-ai.md - Fireworks ai observability installationreferences/xai.md - Xai observability installationreferences/cerebras.md - Cerebras ai observability installationreferences/hugging-face.md - Hugging face ai observability installationreferences/ollama.md - Ollama ai observability installationreferences/openrouter.md - Openrouter ai observability installationreferences/langchain.md - Langchain ai observability installationreferences/llamaindex.md - Llamaindex ai observability installationreferences/crewai.md - Crewai observability installationreferences/autogen.md - Autogen ai observability installationreferences/dspy.md - Dspy ai observability installationreferences/langgraph.md - Langgraph ai observability installationreferences/pydantic-ai.md - Pydantic ai observability installationreferences/vercel-ai.md - Vercel ai SDK observability installationreferences/litellm.md - Litellm ai observability installationreferences/instructor.md - Instructor ai observability installationreferences/semantic-kernel.md - Semantic kernel ai observability installationreferences/mirascope.md - Mirascope ai observability installationreferences/mastra.md - Mastra ai observability installationreferences/smolagents.md - Smolagents ai observability installationreferences/openai-agents.md - Openai agents SDK observability installationreferences/portkey.md - Portkey ai observability installationreferences/helicone.md - Helicone ai observability installationreferences/manual-capture.md - Manual capture ai observability installationreferences/basics.md - Ai observability basicsreferences/traces.md - Tracesreferences/calculating-costs.md - Calculating llm costsreferences/COMMANDMENTS.md - Framework-specific rules the integration must followEach provider reference contains installation instructions, SDK setup, and code examples specific to that provider or framework. Find the reference that matches the user’s stack.
If the user’s provider isn’t listed, use manual-capture.md as a fallback — it covers the generic event capture approach that works with any provider.
Add PostHog AI Observability to trace AI model usage. Use after implementing LLM features or reviewing PRs to ensure all generations are captured with token counts, latency, and costs. Also handles initial PostHog SDK setup if not yet installed.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
main, last pushed 24 September 2026.SKILL.md, not by matching a directory convention. 2 distinct layouts observed: skills/omnibus/*/SKILL.md, skills/posthog/all/skills/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by PostHog, declaring 6 plugins. It is read for editorial metadata only — never as the skill index, which is always the repository tree./PostHog/skills.md, and each skill at its own .md URL.39 files · 303 KB
Everything this skill ships beside its prose. All of it is set here, as subchapters of skill 79.
Documentation the agent loads on demand, rather than up front.