releases.sh

AI wrapper now reports cache-write tokens

@posthog/ai@8.6.8

August 6, 2026PostHog JSView original ↗
1 feature1 enhancementThis release1 featureNew capabilities1 enhancementImprovements to existing featuresAI-tallied from the release notes
From the original release noteView original ↗

8.6.8

Patch Changes

  • #4189 2831de1 Thanks @Fortiz2305! - Report cache-write tokens for the OpenAI wrapper. OpenAI-compatible providers that follow Anthropic's cache-write convention (e.g. Claude via OpenRouter) return cache-write tokens in the response usage (prompt_tokens_details.cache_write_tokens for Chat Completions, input_tokens_details.cache_write_tokens for Responses), but the wrapper only surfaced cache reads. It now populates $ai_cache_creation_input_tokens across Chat Completions and Responses (streaming, non-streaming, and parse()), so ingestion can price the cache-write premium for Claude/Anthropic models instead of under-reporting cost on cache-heavy calls. Completes the cache-aware cost fix started in #4071 (#3615). (2026-08-06)

  • #4236 d36a421 Thanks @gouveags! - Preserve Anthropic cache creation TTL breakdowns in streaming and LangChain generation events. (2026-08-06)

  • Updated dependencies [4751b33, 64ba193]:

    • posthog-node@5.48.1
    • @posthog/core@1.46.9

Fetched August 6, 2026