Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(llm-gateway): add claude opus 5 (#73618)

Charles Vien5d8b336b652c
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index d47e7b015242..6d696aa6f534 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -5577,7 +5577,7 @@ snapshots:
scenes-app-dashboards--show-without-post-hog-ai-button-label--medium--dark:
hash: v1.k794b7964.8e451e072f54f7e2a4bf649e2af129a1624a9ce5939d023a10cef4dbe200d00a.35hPLpid_TQpN7vdWwVb9IwsPn0qt_aoDmzGmhvA0nA
scenes-app-dashboards--show-without-post-hog-ai-button-label--medium--light:
- hash: v1.k794b7964.16695d22ae64fd0b3f014604ca34dc06afc8329b0d122300de1a87c5f8e3434b.lghCgl4IhqFDNKpqEWy9JqNYM5WW0mnpRr-m7AQQYqY
+ hash: v1.k794b7964.7f45f600558e7bcfa730776316ddea01cd766a65abb2d4ef94147003f7f570b4.Mnn4JzYBVXBWsIK_iXsXqaOySdOgOq3oZo4Oti8MRoA
scenes-app-dashboards--show-without-post-hog-ai-button-label--narrow--dark:
hash: v1.k794b7964.88687d2cc1bbd12296214f07d5f6bb2548705ae3baae37985858225116896a10.YogXGZXR1uFB4qD8nOjCfWyWL--g1SLKNxz0gZvEoWw
scenes-app-dashboards--show-without-post-hog-ai-button-label--narrow--light:
diff --git a/products/posthog_ai/frontend/utils/composerModels.ts b/products/posthog_ai/frontend/utils/composerModels.ts
index fb3e7ec5f8ce..b1a039e558cd 100644
--- a/products/posthog_ai/frontend/utils/composerModels.ts
+++ b/products/posthog_ai/frontend/utils/composerModels.ts
@@ -14,6 +14,7 @@ export interface ComposerEffortOption {
// intentionally absent. Add new Claude models here as they ship.
export const COMPOSER_MODELS: ComposerModelOption[] = [
{ value: 'claude-sonnet-5', label: 'Claude Sonnet 5' },
+ { value: 'claude-opus-5', label: 'Claude Opus 5' },
{ value: 'claude-opus-4-8', label: 'Claude Opus 4.8' },
]
@@ -38,6 +39,13 @@ const EFFORTS_BY_MODEL: Record<string, ReasoningEffortEnumApi[]> = {
ReasoningEffortEnumApi.Xhigh,
ReasoningEffortEnumApi.Max,
],
+ 'claude-opus-5': [
+ ReasoningEffortEnumApi.Low,
+ ReasoningEffortEnumApi.Medium,
+ ReasoningEffortEnumApi.High,
+ ReasoningEffortEnumApi.Xhigh,
+ ReasoningEffortEnumApi.Max,
+ ],
'claude-sonnet-5': [ReasoningEffortEnumApi.Low, ReasoningEffortEnumApi.Medium, ReasoningEffortEnumApi.High],
}
diff --git a/products/tasks/backend/temporal/process_task/utils.py b/products/tasks/backend/temporal/process_task/utils.py
index b486710356df..70849e521b32 100644
--- a/products/tasks/backend/temporal/process_task/utils.py
+++ b/products/tasks/backend/temporal/process_task/utils.py
@@ -132,6 +132,13 @@ CLAUDE_REASONING_EFFORTS_BY_MODEL: dict[str, tuple[ReasoningEffort, ...]] = {
ReasoningEffort.XHIGH,
ReasoningEffort.MAX,
),
+ "claude-opus-5": (
+ ReasoningEffort.LOW,
+ ReasoningEffort.MEDIUM,
+ ReasoningEffort.HIGH,
+ ReasoningEffort.XHIGH,
+ ReasoningEffort.MAX,
+ ),
"claude-fable-5": (
ReasoningEffort.LOW,
ReasoningEffort.MEDIUM,
diff --git a/services/llm-gateway/src/llm_gateway/bedrock.py b/services/llm-gateway/src/llm_gateway/bedrock.py
index 8c090d1d3d77..c805b35a04e0 100644
--- a/services/llm-gateway/src/llm_gateway/bedrock.py
+++ b/services/llm-gateway/src/llm_gateway/bedrock.py
@@ -66,6 +66,10 @@ ANTHROPIC_TO_BEDROCK_MODEL_MAP: Final[dict[str, dict[str, str]]] = {
"us": "us.anthropic.claude-opus-4-8",
"eu": "eu.anthropic.claude-opus-4-8",
},
+ "claude-opus-5": {
+ "us": "us.anthropic.claude-opus-5",
+ "eu": "eu.anthropic.claude-opus-5",
+ },
"claude-fable-5": {
"us": "us.anthropic.claude-fable-5",
"eu": "global.anthropic.claude-fable-5",
@@ -349,6 +353,7 @@ def _strip_regional_inference_prefix(model: str) -> str:
BEDROCK_RUNTIME_COUNT_TOKENS_UNSUPPORTED: Final[frozenset[str]] = frozenset(
{
"anthropic.claude-opus-4-8",
+ "anthropic.claude-opus-5",
"anthropic.claude-fable-5",
}
)
diff --git a/services/llm-gateway/src/llm_gateway/products/config.py b/services/llm-gateway/src/llm_gateway/products/config.py
index 43146815c79f..84c777fab530 100644
--- a/services/llm-gateway/src/llm_gateway/products/config.py
+++ b/services/llm-gateway/src/llm_gateway/products/config.py
@@ -71,6 +71,7 @@ _POSTHOG_CODE_AGENT_MODELS: Final[frozenset[str]] = frozenset(
"claude-opus-4-6",
"claude-opus-4-7",
"claude-opus-4-8",
+ "claude-opus-5",
"claude-sonnet-4-5",
"claude-sonnet-4-6",
"claude-sonnet-5",
@@ -123,6 +124,7 @@ PRODUCTS: Final[dict[str, ProductConfig]] = {
"claude-opus-4-6",
"claude-opus-4-7",
"claude-opus-4-8",
+ "claude-opus-5",
"claude-sonnet-4-5",
"claude-sonnet-5",
"claude-haiku-4-5",
diff --git a/services/llm-gateway/tests/test_bedrock.py b/services/llm-gateway/tests/test_bedrock.py
index 496d783f7bf3..ff6c4f37171d 100644
--- a/services/llm-gateway/tests/test_bedrock.py
+++ b/services/llm-gateway/tests/test_bedrock.py
@@ -124,6 +124,7 @@ class TestBedrockSpecific:
pytest.param("claude-opus-4-8", "bedrock/us.anthropic.claude-opus-4-8", id="opus_4_8_inference_profile"),
pytest.param("claude-fable-5", "bedrock/us.anthropic.claude-fable-5", id="fable_5_inference_profile"),
pytest.param("claude-sonnet-5", "bedrock/us.anthropic.claude-sonnet-5", id="sonnet_5_inference_profile"),
+ pytest.param("claude-opus-5", "bedrock/us.anthropic.claude-opus-5", id="opus_5_inference_profile"),
pytest.param(
"us.anthropic.claude-sonnet-4-6", "bedrock/us.anthropic.claude-sonnet-4-6", id="already_bedrock_id"
),
@@ -869,6 +870,7 @@ class TestModelMapping:
pytest.param("claude-sonnet-4-5", "us.anthropic.claude-sonnet-4-5-20250929-v1:0", id="sonnet_4_5"),
pytest.param("claude-sonnet-4-6", "us.anthropic.claude-sonnet-4-6", id="sonnet_4_6"),
pytest.param("claude-sonnet-5", "us.anthropic.claude-sonnet-5", id="sonnet_5"),
+ pytest.param("claude-opus-5", "us.anthropic.claude-opus-5", id="opus_5"),
pytest.param("claude-haiku-4-5", "us.anthropic.claude-haiku-4-5-20251001-v1:0", id="haiku_4_5"),
],
)
@@ -923,6 +925,8 @@ class TestSupportsBedrockRuntimeCountTokens:
pytest.param("us.anthropic.claude-opus-4-6-v1", True, id="not_denylisted_versioned_suffix"),
pytest.param("us.anthropic.claude-opus-4-8", False, id="unsupported_opus"),
pytest.param("eu.anthropic.claude-opus-4-8", False, id="unsupported_opus_eu_prefix"),
+ pytest.param("us.anthropic.claude-opus-5", False, id="unsupported_opus_5"),
+ pytest.param("eu.anthropic.claude-opus-5", False, id="unsupported_opus_5_eu_prefix"),
pytest.param("us.anthropic.claude-fable-5", False, id="unsupported_fable"),
# EU routes fable through the global profile (no eu. geo profile exists for it);
# runtime CountTokens rejects it the same as the us. form.
diff --git a/services/llm-gateway/tests/test_product_config.py b/services/llm-gateway/tests/test_product_config.py
index 4abd71fc530a..cb3bf30ef5ee 100644
--- a/services/llm-gateway/tests/test_product_config.py
+++ b/services/llm-gateway/tests/test_product_config.py
@@ -126,6 +126,7 @@ class TestCheckProductAccess:
"claude-opus-4-6",
"claude-opus-4-7",
"claude-opus-4-8",
+ "claude-opus-5",
"claude-fable-5",
"claude-sonnet-4-5",
"claude-sonnet-4-6",
@@ -169,6 +170,7 @@ class TestCheckProductAccess:
"claude-opus-4-6",
"claude-opus-4-7",
"claude-opus-4-8",
+ "claude-opus-5",
"claude-fable-5",
"claude-sonnet-4-5",
"claude-sonnet-4-6",
@@ -263,6 +265,7 @@ class TestCheckProductAccess:
"claude-opus-4-6",
"claude-opus-4-7",
"claude-opus-4-8",
+ "claude-opus-5",
"claude-fable-5",
"claude-sonnet-4-5",
"claude-sonnet-5",
@@ -345,6 +348,7 @@ class TestCheckProductAccess:
[
"claude-opus-4-7",
"claude-opus-4-8",
+ "claude-opus-5",
"claude-sonnet-4-6",
"claude-sonnet-5",
"claude-haiku-4-5",