Wire a PostHog endpoint into a client app or SDK. Covers fetching the OpenAPI spec, generating a typed client with openapi-generator or @hey-api/openapi-ts, sending the right auth header, shaping the variables payload (HogQL code_name vs insight breakdown property), handling rate-limit and materialised-endpoint error responses.
Install
npx skills add PostHog/ai-plugin --skill consuming-endpoints-from-client-codenpx skills add PostHog/ai-plugin --skill consuming-endpoints-from-client-code -a claude-code -gnpx skills add PostHog/ai-plugin --skill consuming-endpoints-from-client-code -a codex -ggemini skills install https://github.com/PostHog/ai-plugin.git --path skills/consuming-endpoints-from-client-codegh skill install PostHog/ai-plugin consuming-endpoints-from-client-codegit clone --depth 1 https://github.com/PostHog/ai-plugin /tmp/PostHog__ai-plugin
mkdir -p ~/.claude/skills ~/.agents/skills
cp -R /tmp/PostHog__ai-plugin/skills/consuming-endpoints-from-client-code ~/.claude/skills/consuming-endpoints-from-client-code # Claude Code
cp -R /tmp/PostHog__ai-plugin/skills/consuming-endpoints-from-client-code ~/.agents/skills/consuming-endpoints-from-client-code # Codex, Cursor, Gemini CLI, Copilot, OpenCode