Files
Richard SolomouandGitHub 54108e8385 docs: add AI provider examples for all LLM analytics integrations (#3326)
* docs: add AI provider examples for all LLM analytics integrations

Add 20 new example directories covering every provider documented in
our LLM analytics onboarding docs. This includes OpenAI-compatible
providers (Groq, DeepSeek, Mistral, xAI, Together AI, Ollama, Cohere,
Hugging Face, Perplexity, Cerebras, Fireworks AI, OpenRouter, Helicone,
Vercel AI Gateway, Azure OpenAI, Portkey) and custom integrations
(Instructor, LangGraph, AWS Bedrock, Convex).

* fix: use max_tokens instead of max_completion_tokens for Mistral example

Mistral's API doesn't support max_completion_tokens, causing 422 errors.

* fix: import AzureOpenAI from @posthog/ai, not @posthog/ai/openai

* fix: use Resource constructor instead of resourceFromAttributes for OTel v1

* style: format all AI examples with prettier
2026-04-07 11:07:35 +03:00

316 B

Portkey + PostHog AI Examples

Track Portkey AI gateway calls with PostHog via the OpenAI-compatible API.

Setup

pnpm install
cp .env.example .env
# Fill in your API keys in .env

Examples

  • chat.ts - Chat completions via Portkey AI gateway

Run

source .env
npx tsx chat.ts