NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #472 most downloaded on PyPI
Integrate PostHog into any python application.
Latest stable
8.1.0
Last release today
20 Nov 2026
Ships on a steady schedule
a new release about every 8 days
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
391 releases · first in 2020
Drag across the ruler to compare, or tap a release to open it.
fe76fc9 Improve mypy coverage for core SDK modules without changing runtime behavior. — Thanks @Kshitijmishradev for your first contribution 🎉!
00b2091 Add internal-only routing of $ai_* events to a dedicated capture endpoint in their own batch, gated behind the unstable _dedicated_ai_endpoint
$ai_* events to a dedicated capture endpoint in their own batch, gated behind the unstable _dedicated_ai_endpoint client option (off by default, not for general use). — Thanks @carlos-marchal-ph!Your coding agent can read these notes before it upgrades. Set up the MCP server →
a2ce51e feat(feature-flags): support the early_exit condition option in local evaluation. When a flag enables early exit, evaluation now stops and ret
early_exit condition option in local evaluation. When a flag enables early exit, evaluation now stops and returns False as soon as a condition group's property filters match but the rollout percentage excludes the user, instead of falling through to later groups — matching the server-side evaluation behavior. — Thanks @gustavohstrassburger!3aed638 Add a configurable $is_server event property (default true) so PostHog can identify server-side events. Set is_server=False when using posthog
$is_server event property (default true) so PostHog can identify server-side events. Set is_server=False when using posthog-python as a client/CLI so the device OS is attributed normally. — Thanks @turnipdabeets for your first contribution 🎉!44e6b14 Fix async streaming responses from the AI wrappers (OpenAI, Anthropic, Gemini) so they support async with as well as async for. Previously, co
async with as well as async for. Previously, consuming a stream via async with (e.g. with pydantic-ai) raised TypeError: 'async_generator' object does not support the asynchronous context manager protocol. — Thanks @turnipdabeets for your first contribution 🎉!643a810 Return empty flag defaults from Client flag helpers when the flags API fails. — Thanks @marandaneto!
034dce2 Make module-level setup no-op when API key is blank — Thanks @marandaneto!
8f6d6c8 Include group context in the $feature_flag_called dedupe key so group-scoped flags fire a separate event for each group a user is evaluated un
$feature_flag_called dedupe key so group-scoped flags fire a separate event for each group a user is evaluated under, instead of being dedup-ed against the first group context the same (distinct_id, flag, response) was seen under. — Thanks @gustavohstrassburger!a44e0be Add async flag definition cache providers — Thanks @dustinbyrne!
0207088 Track OpenAI chat completions parse calls — Thanks @marandaneto!
be9b78b Reject semver values with leading zeros in local flag evaluation. Per semver 2.0.0 §2, numeric identifiers must not include leading zeros — va
1.07.3 are not valid semver and should not match targeting conditions. Both override values and flag values are now validated; invalid inputs raise InconclusiveMatchError so the condition does not match. — Thanks @dmarticus!1574b1b Fix OpenAI usage parsing when token detail fields are null — Thanks @michael-ciridae!
a098aa7 Fix Gemini web search extraction when response candidates are null. — Thanks @marandaneto!
52cd20e feat: add Celery integration and improve PostHog client fork safety — Thanks @parinporecha!
44c1261 Fix scoped context support for async functions — Thanks @marandaneto!
f6c8ede fix: type warning on new_context — Thanks @itsaphel for your first contribution 🎉!
chore: remove unsupported setup-uv input by @marandaneto in https://github.com/PostHog/posthog-python/pull/545
Full Changelog: https://github.com/PostHog/posthog-python/compare/7.13.2...7.14.0
69dc2a8 Add evaluate_flags() and a new flags option on capture() so a single /flags call can power both flag branching and event enrichment per request:
flags = posthog.evaluate_flags(distinct_id, person_properties={"plan": "enterprise"})
if flags.is_enabled("new-dashboard"):
render_new_dashboard()
posthog.capture("page_viewed", distinct_id=distinct_id, flags=flags)
The returned FeatureFlagEvaluations snapshot exposes is_enabled(), get_flag(), get_flag_payload() for branching and only_accessed() / only([keys]) filter helpers. Pass flag_keys=[...] to evaluate_flags() to scope the underlying /flags request itself.
Deprecates feature_enabled(), get_feature_flag(), get_feature_flag_payload(), and capture(send_feature_flags=...). They continue to work but now emit a DeprecationWarning pointing at evaluate_flags(). Removal is planned for the next major version. — Thanks @dmarticus!
chore(deps): bump litellm from 1.83.0 to 1.83.7 in /examples/example-ai-dspy by @dependabot[bot] in https://github.com/PostHog/posthog-python/pull/536
Full Changelog: https://github.com/PostHog/posthog-python/compare/7.13.1...7.13.2
chore(deps): bump python-dotenv from 1.1.1 to 1.2.2 by @dependabot[bot] in https://github.com/PostHog/posthog-python/pull/528
Full Changelog: https://github.com/PostHog/posthog-python/compare/7.13.0...7.13.1
chore: use engineering@posthog.com in package metadata by @marandaneto in https://github.com/PostHog/posthog-python/pull/514
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.12.0...7.13.0
capture_errors option to Prompts that reports prompt fetch failures to PostHog error tracking via capture_exception() when enabled. — Thanks @andrewm4894!chore: merge master into main by @marandaneto in https://github.com/PostHog/posthog-python/pull/513
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.11.2...v7.12.0
Prompts.get() now accepts with_metadata=True and returns a PromptResult dataclass containing source (api, cache, stale_cache, or code_fallback), name, and version alongside the prompt text. The previous plain-string return is deprecated and will be removed in a future major version. — Thanks @marandaneto!chore: add GitHub community health files by @marandaneto in https://github.com/PostHog/posthog-python/pull/505
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.11.1...v7.11.2
/api/feature_flag/local_evaluation to /flags/definitions — Thanks @patricio-posthog!chore: add stale workflow for issues and PRs by @marandaneto in https://github.com/PostHog/posthog-python/pull/502
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.11.0...v7.11.1
fix(llma): graceful fallback in claude_agent_sdk wrapper by @andrewm4894 in https://github.com/PostHog/posthog-python/pull/495
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.10.3...v7.11.0
embed_content tracking support for both sync and async clients — Thanks @carlos-marchal-ph!fix: pass before_send through module-level setup by @sipa-echo-zaoa in https://github.com/PostHog/posthog-python/pull/472
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.10.2...v7.10.3
posthog.before_send callback into the lazily initialized default client — Thanks @marandaneto!chore: configurabel endpoint for flags local evaluation by @patricio-posthog in https://github.com/PostHog/posthog-python/pull/483
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.10.1...v7.10.2
POSTHOG_LOCAL_EVALUATION_ENDPOINT env var with fallback to default endpoint — Thanks @patricio-posthog for your first contribution 🎉!fix: pass capture_exceptions as keyword arg in Django middleware by @marandaneto in https://github.com/PostHog/posthog-python/pull/488
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.10.0...v7.10.1
docs: add AI provider integration examples by @richardsolomou in https://github.com/PostHog/posthog-python/pull/466
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.9.12...v7.10.0
distinct_id for group_identify, flag_keys_to_evaluate for get_all_flags/get_all_flags_and_payloads) — Thanks @dustinbyrne!chore(flags): expose flag_definition_cache_provider by @matheus-vb in https://github.com/PostHog/posthog-python/pull/462
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.9.11...v7.9.12
chore(ci): fix release attribution by @Piccirello in https://github.com/PostHog/posthog-python/pull/461
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.9.10...v7.9.11
fix(ci): attribute release tag to GitHub App by @Piccirello in https://github.com/PostHog/posthog-python/pull/460
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.9.9...v7.9.10
Update release.yml to support commit signing by @Piccirello in https://github.com/PostHog/posthog-python/pull/458
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.9.8...v7.9.9
feat(llma): support prompt versions in prompts sdk by @Radu-Raicea in https://github.com/PostHog/posthog-python/pull/454
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.9.7...v7.9.8
fix(llma): use distinct_id from outer context if not provided by @ethanporcaro in https://github.com/PostHog/posthog-python/pull/449
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.9.6...v7.9.7
refactor: add PROPERTY_OPERATORS constant for match_property by @dmarticus in https://github.com/PostHog/posthog-python/pull/448
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.9.5...v7.9.6
feat: add semver targeting support to local flag evaluation by @dmarticus in https://github.com/PostHog/posthog-python/pull/447
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.9.4...v7.9.5
fix: use $ip not $ip_addess by @iloveitaly in https://github.com/PostHog/posthog-python/pull/356
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.9.3...v7.9.4
$ai_tokens_source property ("sdk" or "passthrough") to all $ai_generation events to detect when token values are externally overridden via posthog_properties — Thanks @carlos-marchal-ph!Small fixes for python publishing by @rafaeelaudibert in https://github.com/PostHog/posthog-python/pull/441
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.9.2...v7.9.3
fix(ai): bind prompt reads to project token by @Radu-Raicea in https://github.com/PostHog/posthog-python/pull/433
sampo by @rafaeelaudibert in https://github.com/PostHog/posthog-python/pull/398Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.9.0...v7.9.2
fix(llma): make prompt fetches deterministic by requiring project_api_key and sending it as token query param
fix(llma): make prompt fetches deterministic by requiring project_api_key and sending it as token query param
test(flags): make wrong-key load_feature_flags deterministic by @andehen in https://github.com/PostHog/posthog-python/pull/432
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.8.6...v7.9.0
feat: limit max number of items in collection to scan by @ablaszkiewicz in https://github.com/PostHog/posthog-python/pull/430
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.8.5...v7.8.6
feat: further optimize code variables regex search by @ablaszkiewicz in https://github.com/PostHog/posthog-python/pull/429
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.8.4...v7.8.5
fix: Retry on 408 and respect Retry-After header by @andehen in https://github.com/PostHog/posthog-python/pull/426
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.8.3...v7.8.4
Fix feature flag 401 errors causing HTTP request storm by @GabiGrin in https://github.com/PostHog/posthog-python/pull/422
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.8.2...v7.8.3
fix(llma): default prompts url by @Radu-Raicea in https://github.com/PostHog/posthog-python/pull/423
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.8.1...v7.8.2
feat: SDK Compliance by @jose-sequeira in https://github.com/PostHog/posthog-python/pull/397
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.8.0...v7.8.1
feat(llma): pass raw provider usage metadata for backend cost calculations by @richardsolomou in https://github.com/PostHog/posthog-python/pull/411
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.7.0...v7.8.0
feat(llma): add prompt management
Adds the Prompt Management feature. At the time of release, this feature is in a closed alpha.
feat(ai): add OpenAI Agents SDK integration by @andrewm4894 in https://github.com/PostHog/posthog-python/pull/408
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.6.0...v7.7.0
feat(ai): Add OpenAI Agents SDK integration
Automatic tracing for agent workflows, handoffs, tool calls, guardrails, and custom spans. Includes $ai_total_tokens, $ai_error_type categorization, and $ai_framework property.
chore: check for syntax warnings by @pauldambra in https://github.com/PostHog/posthog-python/pull/404
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.5.1...v7.6.0
feat: add device_id to flags request payload
Add device_id parameter to all feature flag methods, allowing the server to track device identifiers for flag evaluation. The device_id can be passed explicitly or set via context using set_context_device_id().
chore: add a test to describe upload behaviour when there are errors by @pauldambra in https://github.com/PostHog/posthog-python/pull/403
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.5.0...v7.5.1
fix: avoid return from finally block to fix Python 3.14 SyntaxWarning (#361) - thanks @jodal
feat: llma / error tracking integration by @daibhin in https://github.com/PostHog/posthog-python/pull/376
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.4.3...v7.5.0
feat: Capture Langchain, OpenAI and Anthropic errors as exceptions (if exception autocapture is enabled) feat: Add reference to exception in LLMA trace and span events
fix: double counting anthropic langchain by @carlos-marchal-ph in https://github.com/PostHog/posthog-python/pull/399
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.4.2...v7.4.3
feat: add in_app configuration for python SDK by @hpouillot in https://github.com/PostHog/posthog-python/pull/396
Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.4.1...v7.4.2
fix: Respect send_feature_flags setting and deprecate send_feature_flag_events in get_feature_flag_payload by @dustinbyrne in https://github.com/PostH…
send_feature_flags setting and deprecate send_feature_flag_events in get_feature_flag_payload by @dustinbyrne in https://github.com/PostHog/posthog-python/pull/391Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.4.0...v7.4.1
fix: extract model from response for OpenAI stored prompts
When using OpenAI stored prompts, the model is defined in the OpenAI dashboard rather than passed in the API request. This fix adds a fallback to extract the model from the response object when not provided in kwargs, ensuring generations show up with the correct model and enabling cost calculations.
feat(llma): multimodal-capture by @carlos-marchal-ph in https://github.com/PostHog/posthog-python/pull/378
$feature_flag_error property to track flag evaluation failures by @haacked in https://github.com/PostHog/posthog-python/pull/390Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.3.1...v7.4.0
feat: Add automatic retries for feature flag requests
Feature flag API requests now automatically retry on transient failures:
Rate limit (429) and quota (402) errors are not retried.
feat: add python 3.14 support by @carlos-marchal-ph in https://github.com/PostHog/posthog-python/pull/373
evaluated_at properties in $feature_flag_called events by @dmarticus in https://github.com/PostHog/posthog-python/pull/374Full Changelog: https://github.com/PostHog/posthog-python/compare/v7.0.1...v7.3.1
Try to use repr() when formatting code variables
(BREAKING) Python 3.9 is no longer supported
(BREAKING) Python 3.9 is no longer supported
chore(llma): update LLM provider SDKs to latest major versions
feat(ph-ai): PostHog properties dict in GenerationMetadata
One column per quarter.