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(tasks): show model cost multipliers in the run pickers (#102320)

Vojta Bartoš577c1e22c486
diff --git a/frontend/src/scenes/settings/environment/TaskAgentDefaultsSettings.tsx b/frontend/src/scenes/settings/environment/TaskAgentDefaultsSettings.tsx
index 2ee061db385f..c724dfef690e 100644
--- a/frontend/src/scenes/settings/environment/TaskAgentDefaultsSettings.tsx
+++ b/frontend/src/scenes/settings/environment/TaskAgentDefaultsSettings.tsx
@@ -7,11 +7,14 @@ import { RestrictionScope, useRestrictedArea } from 'lib/components/RestrictedAr
import { TeamMembershipLevel } from 'lib/constants'
import { LemonField } from 'lib/lemon-ui/LemonField'
+import { ModelCostChip } from 'products/posthog_ai/frontend/components/ModelCostChip'
+import { ModelCostFooter } from 'products/posthog_ai/frontend/components/ModelCostFooter'
import { modelCatalogueLogic } from 'products/posthog_ai/frontend/logics/modelCatalogueLogic'
import {
filterEffortForModel,
getEffortLabel,
getEffortsForModel,
+ getModelCost,
getModelLabel,
getRuntimeAdapterLabel,
listRuntimeAdapters,
@@ -47,17 +50,30 @@ function PreferenceEditor({
// Grouped by harness off the same catalogue the composer renders, so a model you can pick for a
// run is always settable as a default and vice versa — including the Codex models that only
// Slack and PostHog Desktop drive today.
- const modelOptions = useMemo(
- () =>
- listRuntimeAdapters(catalogue).map((adapter) => ({
- title: getRuntimeAdapterLabel(adapter),
- options: modelsForRuntimeAdapter(catalogue, adapter).map((choice) => ({
- value: choice.model,
- label: choice.display_name,
- })),
+ const modelOptions = useMemo(() => {
+ const groups = listRuntimeAdapters(catalogue).map((adapter) => ({
+ title: getRuntimeAdapterLabel(adapter),
+ options: modelsForRuntimeAdapter(catalogue, adapter).map((choice) => ({
+ value: choice.model,
+ label: choice.display_name,
+ // Menu only: cost is what you compare models on while choosing, and says
+ // nothing once the closed control shows the one you picked.
+ labelInMenu: (
+ <span className="flex w-full items-center justify-between gap-2">
+ {choice.display_name}
+ <ModelCostChip model={choice.model} />
+ </span>
+ ),
})),
- [catalogue]
- )
+ }))
+ // On the last group, so it reads as closing the whole list rather than that one harness.
+ const last = groups.at(-1)
+ const anyCost = groups.some((group) => group.options.some((option) => getModelCost(option.value)))
+ if (last && anyCost) {
+ return [...groups.slice(0, -1), { ...last, footer: <ModelCostFooter /> }]
+ }
+ return groups
+ }, [catalogue])
const effortOptions = useMemo(() => getEffortsForModel(catalogue, draft.model), [catalogue, draft.model])
return (
diff --git a/products/desktop/packages/shared/src/model-catalog.generated.ts b/products/desktop/packages/shared/src/model-catalog.generated.ts
index 0c4d103b7a68..bfbdb95a3621 100644
--- a/products/desktop/packages/shared/src/model-catalog.generated.ts
+++ b/products/desktop/packages/shared/src/model-catalog.generated.ts
@@ -3,9 +3,9 @@
// Regenerate with `hogli build:task-model-catalog`. Do not edit.
//
// The single definition of a task agent run's triple: runtime adapter,
-// model, and reasoning effort. The backend validates a run against this
-// same data, so a picker built on this file can only offer a selection
-// the API will accept.
+// model, and reasoning effort, plus what each model costs. The backend
+// validates a run against this same data, so a picker built on this file
+// can only offer a selection the API will accept.
export type RuntimeAdapter = "claude" | "codex";
@@ -33,6 +33,11 @@ export type ByRuntimeAdapter<T> = Record<RuntimeAdapter, T>;
/** Efforts per adapter, absent where the adapter has no fallback. */
type FallbackEfforts = Partial<ByRuntimeAdapter<readonly ReasoningEffort[]>>;
+export interface ModelCost {
+ inputPerMtok: number;
+ outputPerMtok: number;
+}
+
export interface CatalogModel {
id: string;
runtimeAdapter: RuntimeAdapter;
@@ -45,8 +50,23 @@ export interface CatalogModel {
means generally available. Governs display only — the server decides
whether a run may use it. */
accessFlag?: string;
+ /** List price in US dollars per million tokens. Absent for a model no
+ public price list covers, which a picker shows with no cost at all. */
+ cost?: ModelCost;
+ /** Per-token cost against Claude Sonnet 5, ready to render: `2.5×`,
+ `≈0.55×`. Prefixed when input and output rates diverge enough that one
+ number flatters either. Absent whenever `cost` is. */
+ costMultiplier?: string;
+ /** The rates behind the multiplier, ready to render. Absent whenever
+ `cost` is. */
+ costSummary?: string;
}
+/** The model `1×` refers to. */
+export const COST_BASELINE_MODEL = "claude-sonnet-5";
+
+export const COST_BASELINE_LABEL = "Claude Sonnet 5";
+
/** Which vendor API each runtime adapter speaks. */
export const PROVIDER_BY_RUNTIME_ADAPTER: ByRuntimeAdapter<string> = {
claude: "anthropic",
@@ -62,6 +82,12 @@ export const MODELS: readonly CatalogModel[] = [
reasoningEfforts: ["high", "max"],
label: "GLM-5.2",
accessFlag: "posthog-code-glm-model",
+ cost: {
+ inputPerMtok: 1.4,
+ outputPerMtok: 4.4,
+ },
+ costMultiplier: "≈0.57×",
+ costSummary: "Input $1.40 · Output $4.40 per 1M tokens",
},
{
id: "zai-org/glm-5.3",
@@ -69,6 +95,12 @@ export const MODELS: readonly CatalogModel[] = [
reasoningEfforts: ["high", "max"],
label: "GLM-5.3",
accessFlag: "posthog-code-glm-53-model",
+ cost: {
+ inputPerMtok: 1.4,
+ outputPerMtok: 4.4,
+ },
+ costMultiplier: "≈0.57×",
+ costSummary: "Input $1.40 · Output $4.40 per 1M tokens",
},
{
id: "zai-org/glm-5.3-flash",
@@ -76,6 +108,12 @@ export const MODELS: readonly CatalogModel[] = [
reasoningEfforts: ["high", "max"],
label: "GLM-5.3 Flash",
accessFlag: "posthog-code-glm-53-flash-model",
+ cost: {
+ inputPerMtok: 0.15,
+ outputPerMtok: 0.5,
+ },
+ costMultiplier: "≈0.06×",
+ costSummary: "Input $0.15 · Output $0.50 per 1M tokens",
},
{
id: "moonshotai/kimi-k3",
@@ -83,6 +121,12 @@ export const MODELS: readonly CatalogModel[] = [
reasoningEfforts: [],
label: "Kimi K3",
accessFlag: "tasks-kimi-k3",
+ cost: {
+ inputPerMtok: 3,
+ outputPerMtok: 15,
+ },
+ costMultiplier: "1.5×",
+ costSummary: "Input $3 · Output $15 per 1M tokens",
},
{
id: "deepseek-ai/deepseek-v4-flash-0731",
@@ -90,60 +134,120 @@ export const MODELS: readonly CatalogModel[] = [
reasoningEfforts: [],
label: "DeepSeek V4 Flash",
accessFlag: "posthog-code-deepseek-model",
+ cost: {
+ inputPerMtok: 0.13,
+ outputPerMtok: 0.26,
+ },
+ costMultiplier: "≈0.05×",
+ costSummary: "Input $0.13 · Output $0.26 per 1M tokens",
},
{
id: "claude-opus-4-5",
runtimeAdapter: "claude",
reasoningEfforts: ["low", "medium", "high"],
label: "Claude Opus 4.5",
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 25,
+ },
+ costMultiplier: "2.5×",
+ costSummary: "Input $5 · Output $25 per 1M tokens",
},
{
id: "claude-opus-4-6",
runtimeAdapter: "claude",
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
label: "Claude Opus 4.6",
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 25,
+ },
+ costMultiplier: "2.5×",
+ costSummary: "Input $5 · Output $25 per 1M tokens",
},
{
id: "claude-opus-4-7",
runtimeAdapter: "claude",
reasoningEfforts: ["low", "medium", "high", "xhigh", "max", "ultracode"],
label: "Claude Opus 4.7",
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 25,
+ },
+ costMultiplier: "2.5×",
+ costSummary: "Input $5 · Output $25 per 1M tokens",
},
{
id: "claude-opus-4-8",
runtimeAdapter: "claude",
reasoningEfforts: ["low", "medium", "high", "xhigh", "max", "ultracode"],
label: "Claude Opus 4.8",
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 25,
+ },
+ costMultiplier: "2.5×",
+ costSummary: "Input $5 · Output $25 per 1M tokens",
},
{
id: "claude-opus-5",
runtimeAdapter: "claude",
reasoningEfforts: ["low", "medium", "high", "xhigh", "max", "ultracode"],
label: "Claude Opus 5",
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 25,
+ },
+ costMultiplier: "2.5×",
+ costSummary: "Input $5 · Output $25 per 1M tokens",
},
{
id: "claude-fable-5",
runtimeAdapter: "claude",
reasoningEfforts: ["low", "medium", "high", "xhigh", "max", "ultracode"],
label: "Claude Fable 5",
+ cost: {
+ inputPerMtok: 10,
+ outputPerMtok: 50,
+ },
+ costMultiplier: "5×",
+ costSummary: "Input $10 · Output $50 per 1M tokens",
},
{
id: "claude-fable-5-1",
runtimeAdapter: "claude",
reasoningEfforts: ["low", "medium", "high", "xhigh", "max", "ultracode"],
label: "Claude Fable 5.1",
+ cost: {
+ inputPerMtok: 10,
+ outputPerMtok: 50,
+ },
+ costMultiplier: "5×",
+ costSummary: "Input $10 · Output $50 per 1M tokens",
},
{
id: "claude-sonnet-5",
runtimeAdapter: "claude",
reasoningEfforts: ["low", "medium", "high", "xhigh", "max", "ultracode"],
label: "Claude Sonnet 5",
+ cost: {
+ inputPerMtok: 2,
+ outputPerMtok: 10,
+ },
+ costMultiplier: "1×",
+ costSummary: "Input $2 · Output $10 per 1M tokens",
},
{
id: "claude-sonnet-4-6",
runtimeAdapter: "claude",
reasoningEfforts: ["low", "medium", "high"],
label: "Claude Sonnet 4.6",
+ cost: {
+ inputPerMtok: 3,
+ outputPerMtok: 15,
+ },
+ costMultiplier: "1.5×",
+ costSummary: "Input $3 · Output $15 per 1M tokens",
},
{
id: "gpt-5",
@@ -156,30 +260,60 @@ export const MODELS: readonly CatalogModel[] = [
runtimeAdapter: "codex",
reasoningEfforts: ["low", "medium", "high", "xhigh"],
label: "GPT-5.5",
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 30,
+ },
+ costMultiplier: "≈2.8×",
+ costSummary: "Input $5 · Output $30 per 1M tokens",
},
{
id: "gpt-5.6-sol",
runtimeAdapter: "codex",
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
label: "GPT-5.6 Sol",
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 30,
+ },
+ costMultiplier: "≈2.8×",
+ costSummary: "Input $5 · Output $30 per 1M tokens",
},
{
id: "gpt-5.6-terra",
runtimeAdapter: "codex",
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
label: "GPT-5.6 Terra",
+ cost: {
+ inputPerMtok: 2.5,
+ outputPerMtok: 15,
+ },
+ costMultiplier: "≈1.4×",
+ costSummary: "Input $2.50 · Output $15 per 1M tokens",
},
{
id: "gpt-5.6-luna",
runtimeAdapter: "codex",
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
label: "GPT-5.6 Luna",
+ cost: {
+ inputPerMtok: 1,
+ outputPerMtok: 6,
+ },
+ costMultiplier: "≈0.55×",
+ costSummary: "Input $1 · Output $6 per 1M tokens",
},
{
id: "gpt-6-astra",
runtimeAdapter: "codex",
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
label: "GPT-6 Astra",
+ cost: {
+ inputPerMtok: 10,
+ outputPerMtok: 50,
+ },
+ costMultiplier: "5×",
+ costSummary: "Input $10 · Output $50 per 1M tokens",
},
];
diff --git a/products/posthog_ai/frontend/components/ModelCostChip.tsx b/products/posthog_ai/frontend/components/ModelCostChip.tsx
new file mode 100644
index 000000000000..d9fd687bbe8e
--- /dev/null
+++ b/products/posthog_ai/frontend/components/ModelCostChip.tsx
@@ -0,0 +1,27 @@
+import { COST_BASELINE_LABEL } from 'products/tasks/frontend/modelCatalog.generated'
+
+import { getModelCost } from '../utils/composerModels'
+
+export interface ModelCostChipProps {
+ model: string
+}
+
+/**
+ * The rates sit in a native `title` rather than a `Tooltip`: this renders inside menu items in
+ * two different menu systems, and a portalled tooltip competes with each one's focus handling.
+ */
+export function ModelCostChip({ model }: ModelCostChipProps): JSX.Element | null {
+ const cost = getModelCost(model)
+ if (!cost) {
+ return null
+ }
+ return (
+ <span
+ className="text-xs tabular-nums whitespace-nowrap text-muted"
+ title={`Cost per token vs ${COST_BASELINE_LABEL}. ${cost.summary}`}
+ data-attr="model-cost-multiplier"
+ >
+ {cost.multiplier}
+ </span>
+ )
+}
diff --git a/products/posthog_ai/frontend/components/ModelCostFooter.tsx b/products/posthog_ai/frontend/components/ModelCostFooter.tsx
new file mode 100644
index 000000000000..624dee2bb24a
--- /dev/null
+++ b/products/posthog_ai/frontend/components/ModelCostFooter.tsx
@@ -0,0 +1,9 @@
+import { COST_BASELINE_LABEL } from 'products/tasks/frontend/modelCatalog.generated'
+
+export function ModelCostFooter(): JSX.Element {
+ return (
+ <div className="px-2 py-1 text-xxs text-muted" data-attr="model-cost-legend">
+ × is cost per token vs {COST_BASELINE_LABEL}
+ </div>
+ )
+}
diff --git a/products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsx b/products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsx
index 5013f0f1b3e2..4c6e9f9e0413 100644
--- a/products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsx
+++ b/products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsx
@@ -20,6 +20,7 @@ import {
getDefaultModelForRuntimeAdapter,
getEffortLabel,
getEffortsForModel,
+ getModelCost,
getModelLabel,
getRuntimeAdapterForModel,
getRuntimeAdapterLabel,
@@ -32,6 +33,8 @@ import {
RuntimeAdapterEnumApi,
} from 'products/tasks/frontend/generated/api.schemas'
+import { ModelCostChip } from '../ModelCostChip'
+import { ModelCostFooter } from '../ModelCostFooter'
import { ComposerReasoningSlider } from './ComposerReasoningSlider'
// Separates model and effort in a slider stop key; never appears in a model id or an effort.
@@ -71,10 +74,12 @@ interface PickerSectionProps {
value: string
onValueChange: (value: string) => void
children: React.ReactNode
+ /** Rendered under the radio list, for a legend the options need to be read against. */
+ footer?: React.ReactNode
}
/** One `label … current ›` row of the cascade, opening a radio list. */
-function PickerSection({ title, current, value, onValueChange, children }: PickerSectionProps): JSX.Element {
+function PickerSection({ title, current, value, onValueChange, children, footer }: PickerSectionProps): JSX.Element {
return (
<DropdownMenuSub>
<DropdownMenuSubTrigger>
@@ -85,6 +90,7 @@ function PickerSection({ title, current, value, onValueChange, children }: Picke
<DropdownMenuRadioGroup value={value} onValueChange={onValueChange}>
{children}
</DropdownMenuRadioGroup>
+ {footer}
</DropdownMenuSubContent>
</DropdownMenuSub>
)
@@ -122,17 +128,21 @@ export function ComposerModelEffortPickers({
// The catalogue only changes when the gateway list reloads, so derive the whole tree in one pass — this
// component re-renders on every keystroke in the composer above it.
- const { selectedAdapter, modelLabel, effortOptions, adapters, adapterModels, ladder } = useMemo(() => {
- const adapter = getRuntimeAdapterForModel(models, selectedModel)
- return {
- selectedAdapter: adapter,
- modelLabel: getModelLabel(models, selectedModel),
- effortOptions: getEffortsForModel(models, selectedModel),
- adapters: listRuntimeAdapters(models),
- adapterModels: modelsForRuntimeAdapter(models, adapter),
- ladder: getCapabilityLadder(models, adapter),
- }
- }, [models, selectedModel])
+ const { selectedAdapter, modelLabel, effortOptions, adapters, adapterModels, ladder, showsAnyCost } =
+ useMemo(() => {
+ const adapter = getRuntimeAdapterForModel(models, selectedModel)
+ const offered = modelsForRuntimeAdapter(models, adapter)
+ return {
+ selectedAdapter: adapter,
+ modelLabel: getModelLabel(models, selectedModel),
+ effortOptions: getEffortsForModel(models, selectedModel),
+ adapters: listRuntimeAdapters(models),
+ adapterModels: offered,
+ ladder: getCapabilityLadder(models, adapter),
+ // The legend explains a symbol, so it only belongs where a row carries one.
+ showsAnyCost: offered.some((option) => !!getModelCost(option.model)),
+ }
+ }, [models, selectedModel])
const selectAdapter = (adapter: string): void => {
const runtimeAdapter = adapter as RuntimeAdapterEnumApi
@@ -254,10 +264,14 @@ export function ComposerModelEffortPickers({
onModelChange(value)
setOpen(false)
}}
+ footer={showsAnyCost ? <ModelCostFooter /> : undefined}
>
{adapterModels.map((option) => (
<DropdownMenuRadioItem key={option.model} value={option.model}>
- {option.display_name}
+ <span className="flex w-full items-center justify-between gap-2">
+ {option.display_name}
+ <ModelCostChip model={option.model} />
+ </span>
</DropdownMenuRadioItem>
))}
</PickerSection>
diff --git a/products/posthog_ai/frontend/utils/composerModels.test.ts b/products/posthog_ai/frontend/utils/composerModels.test.ts
index 27678068ed79..42248af48192 100644
--- a/products/posthog_ai/frontend/utils/composerModels.test.ts
+++ b/products/posthog_ai/frontend/utils/composerModels.test.ts
@@ -12,6 +12,7 @@ import {
getCapabilityLadder,
getDefaultModelForRuntimeAdapter,
getEffortsForModel,
+ getModelCost,
getModelLabel,
getRuntimeAdapterForModel,
listRuntimeAdapters,
@@ -107,6 +108,17 @@ describe('composerModels', () => {
).toMatchObject({ runtime_adapter: getRuntimeAdapterForModel(CATALOGUE, bare) })
})
+ // A stored `anthropic/...` spelling must not lose its cost while keeping its name, which would
+ // show as one row in the list silently missing a figure every other row has.
+ it.each([
+ ['claude-opus-5', '2.5×'],
+ ['anthropic/claude-opus-5', '2.5×'],
+ ['gpt-5', null],
+ ['some-unreleased-model', null],
+ ])('reads the cost of %s off the catalog', (model, expected) => {
+ expect(getModelCost(model)?.multiplier ?? null).toBe(expected)
+ })
+
// A model absent from the catalogue (still loading, or retired from the gateway) must still produce a
// sendable request rather than an undefined adapter.
it('falls back to the claude adapter for an unknown model', () => {
diff --git a/products/posthog_ai/frontend/utils/composerModels.ts b/products/posthog_ai/frontend/utils/composerModels.ts
index d88a0cac0ddc..3fd5be372ca6 100644
--- a/products/posthog_ai/frontend/utils/composerModels.ts
+++ b/products/posthog_ai/frontend/utils/composerModels.ts
@@ -9,7 +9,7 @@ import {
TaskRunCreateRequestSchemaApi,
} from 'products/tasks/frontend/generated/api.schemas'
import { normalizeModelId } from 'products/tasks/frontend/modelCatalog'
-import { DEFAULT_MODEL_BY_RUNTIME_ADAPTER } from 'products/tasks/frontend/modelCatalog.generated'
+import { DEFAULT_MODEL_BY_RUNTIME_ADAPTER, MODELS } from 'products/tasks/frontend/modelCatalog.generated'
import { type PermissionMode, resolveModeForRuntimeAdapter } from './composerModes'
@@ -153,6 +153,25 @@ export function getEffortLabel(effort: string | null | undefined): string {
return effort ? (EFFORT_LABELS[effort] ?? effort) : 'Effort'
}
+export interface ModelCostDisplay {
+ /** Per-token cost against the catalog baseline, ready to render: `2.5×`, `≈0.55×`. */
+ multiplier: string
+ /** The rates behind it: `Input $2 · Output $10 per 1M tokens`. */
+ summary: string
+}
+
+/** What a model costs, or `null` where the catalog quotes no rate and a picker shows none. */
+export function getModelCost(model: string | null | undefined): ModelCostDisplay | null {
+ if (!model) {
+ return null
+ }
+ const entry = MODELS.find((candidate) => candidate.id === normalizeModelId(model))
+ if (!entry?.costMultiplier || !entry.costSummary) {
+ return null
+ }
+ return { multiplier: entry.costMultiplier, summary: entry.costSummary }
+}
+
// Keep an effort only if the model supports it, else nothing. The stored-preference counterpart of
// `resolveEffortForModel`: a settings row wants "no pick" when the effort no longer applies, where a
// composer wants a concrete value to send. Mirrors the backend's `filter_unsupported_effort`.
diff --git a/products/slack_app/backend/services/model_catalogue.py b/products/slack_app/backend/services/model_catalogue.py
index 5acbf1b104ae..d45cdd5b498a 100644
--- a/products/slack_app/backend/services/model_catalogue.py
+++ b/products/slack_app/backend/services/model_catalogue.py
@@ -13,6 +13,7 @@ against it. Neither may hardcode a model list.
from __future__ import annotations
from products.tasks.backend.facade.model_catalogue import (
+ COST_BASELINE_MODEL,
REASONING_EFFORT_DISPLAY_NAMES,
RUNTIME_ADAPTER_DISPLAY_NAMES,
ModelChoice,
@@ -47,6 +48,7 @@ def describe_run_model(model: str | None, reasoning_effort: str | None) -> str:
__all__ = [
+ "COST_BASELINE_MODEL",
"REASONING_EFFORT_DISPLAY_NAMES",
"RUNTIME_ADAPTER_DISPLAY_NAMES",
"ModelChoice",
diff --git a/products/slack_app/backend/services/slack_app_home.py b/products/slack_app/backend/services/slack_app_home.py
index c6e956fb5b81..7dfcc8cd130e 100644
--- a/products/slack_app/backend/services/slack_app_home.py
+++ b/products/slack_app/backend/services/slack_app_home.py
@@ -37,6 +37,7 @@ from products.slack_app.backend.feature_flags import is_slack_app_oauth_enabled
from products.slack_app.backend.models import SlackSettings, SlackUserProfileCache, UntaggedFollowupMode
from products.slack_app.backend.services.integration_resolver import load_integrations, resolve_from_candidates
from products.slack_app.backend.services.model_catalogue import (
+ COST_BASELINE_MODEL,
REASONING_EFFORT_DISPLAY_NAMES,
RUNTIME_ADAPTER_DISPLAY_NAMES,
available_model_choices,
@@ -165,6 +166,7 @@ class PickerModel:
value: str
label: str
supported_efforts: tuple[PickerEffort, ...]
+ cost_description: str | None = None
@dataclass(frozen=True)
@@ -174,6 +176,13 @@ class PickerAdapter:
models: tuple[PickerModel, ...]
+def _describe_cost(cost_multiplier: str | None) -> str | None:
+ """Slack has no tooltip to hide the baseline in, so the comparison names it outright."""
+ if not cost_multiplier:
+ return None
+ return f"Cost per token vs {display_name_for_model(COST_BASELINE_MODEL)}: {cost_multiplier}"
+
+
def get_picker_choices() -> tuple[PickerAdapter, ...]:
"""Dress the catalogue's runtime → model tree in the effort labels the modal's linked
dropdowns render. Adapters with no available models are omitted entirely."""
@@ -189,6 +198,7 @@ def get_picker_choices() -> tuple[PickerAdapter, ...]:
PickerEffort(value=e, label=label_for(e, REASONING_EFFORT_DISPLAY_NAMES))
for e in choice.supported_efforts
),
+ cost_description=_describe_cost(choice.cost_multiplier),
)
for choice in group.choices
),
@@ -197,11 +207,11 @@ def get_picker_choices() -> tuple[PickerAdapter, ...]:
)
-def _models_for(runtime_adapter: str) -> tuple[tuple[str, str], ...]:
- """Return `(value, label)` pairs for the modal's model dropdown."""
+def _models_for(runtime_adapter: str) -> tuple[PickerModel, ...]:
+ """The models the modal's model dropdown offers for one runtime."""
for adapter in get_picker_choices():
if adapter.value == runtime_adapter:
- return tuple((m.value, m.label) for m in adapter.models)
+ return adapter.models
return ()
@@ -1330,10 +1340,15 @@ def render_edit_modal(
if current.runtime_adapter:
model_options = [
{
- "text": {"type": "plain_text", "text": label, "emoji": True},
- "value": value,
+ "text": {"type": "plain_text", "text": model.label, "emoji": True},
+ "value": model.value,
+ **(
+ {"description": {"type": "plain_text", "text": model.cost_description}}
+ if model.cost_description
+ else {}
+ ),
}
- for value, label in _models_for(current.runtime_adapter)
+ for model in _models_for(current.runtime_adapter)
]
if model_options:
model_element: dict[str, Any] = {
@@ -1766,7 +1781,7 @@ def _drop_invalidated_selections(
effort. The scoped block ids stop Slack handing those back on the next interaction;
this stops the view we render from the same payload showing them in the meantime.
"""
- if model and model not in {value for value, _ in _models_for(runtime_adapter or "")}:
+ if model and model not in {offered.value for offered in _models_for(runtime_adapter or "")}:
model = None
if reasoning_effort and reasoning_effort not in (_supported_efforts(runtime_adapter, model) or ()):
reasoning_effort = None
diff --git a/products/slack_app/backend/tests/services/test_slack_app_home.py b/products/slack_app/backend/tests/services/test_slack_app_home.py
index 9f4f20656270..42b3a1e8c1a3 100644
--- a/products/slack_app/backend/tests/services/test_slack_app_home.py
+++ b/products/slack_app/backend/tests/services/test_slack_app_home.py
@@ -916,6 +916,21 @@ class TestRenderEditModal:
assert option_values
assert all(v.startswith("gpt-") for v in option_values)
+ def test_model_options_carry_the_cost_of_a_priced_model(self):
+ view = render_edit_modal(current=AIPreferences(runtime_adapter="claude"))
+ model_block = _find_block(view, MODAL_BLOCK_MODEL)
+ assert model_block
+ options = {o["value"]: o for o in model_block["element"]["options"]}
+ assert "Claude Sonnet 5" in options["claude-opus-5"]["description"]["text"]
+ assert "2.5×" in options["claude-opus-5"]["description"]["text"]
+
+ def test_model_option_omits_the_cost_line_when_the_catalog_prices_nothing(self):
+ view = render_edit_modal(current=AIPreferences(runtime_adapter="codex"))
+ model_block = _find_block(view, MODAL_BLOCK_MODEL)
+ assert model_block
+ options = {o["value"]: o for o in model_block["element"]["options"]}
+ assert "description" not in options["gpt-5"]
+
def test_effort_block_renders_only_when_supported_efforts_provided(self):
view = render_edit_modal(
current=AIPreferences(runtime_adapter="claude", model="claude-opus-4-7"),
@@ -943,6 +958,9 @@ class TestRenderEditModal:
assert runtime_block["element"]["initial_option"]["value"] == "claude"
assert model_block["element"]["initial_option"]["value"] == "claude-opus-4-7"
assert effort_block["element"]["initial_option"]["value"] == "high"
+ # Slack rejects the whole view when an initial option is not one of the offered
+ # options, down to the cost line under the name.
+ assert model_block["element"]["initial_option"] in model_block["element"]["options"]
def test_dispatch_action_set_on_runtime_and_model(self):
view = render_edit_modal(current=AIPreferences(runtime_adapter="claude"))
diff --git a/products/tasks/backend/facade/model_catalogue.py b/products/tasks/backend/facade/model_catalogue.py
index 283b03c58fdc..a2190222601d 100644
--- a/products/tasks/backend/facade/model_catalogue.py
+++ b/products/tasks/backend/facade/model_catalogue.py
@@ -8,6 +8,7 @@ picker and model-override classifier) import from here rather than reaching into
"""
from products.tasks.backend.logic.services.model_catalogue import (
+ COST_BASELINE_MODEL,
REASONING_EFFORT_DISPLAY_NAMES,
RUNTIME_ADAPTER_DISPLAY_NAMES,
TASK_RUN_GATEWAY_PRODUCT,
@@ -24,6 +25,7 @@ from products.tasks.backend.logic.services.model_catalogue import (
)
__all__ = [
+ "COST_BASELINE_MODEL",
"REASONING_EFFORT_DISPLAY_NAMES",
"RUNTIME_ADAPTER_DISPLAY_NAMES",
"TASK_RUN_GATEWAY_PRODUCT",
diff --git a/products/tasks/backend/logic/services/model_catalogue.py b/products/tasks/backend/logic/services/model_catalogue.py
index 909fba7f864a..f14c068a9ed0 100644
--- a/products/tasks/backend/logic/services/model_catalogue.py
+++ b/products/tasks/backend/logic/services/model_catalogue.py
@@ -27,7 +27,7 @@ from django.core.cache import cache
import structlog
from products.tasks.backend import model_catalog
-from products.tasks.backend.model_catalog import display_name_for_model # noqa: F401 — re-exported
+from products.tasks.backend.model_catalog import COST_BASELINE_MODEL, display_name_for_model # noqa: F401 — re-exported
if TYPE_CHECKING:
from posthog.llm.gateway_client import Product
@@ -75,12 +75,17 @@ class ModelChoice:
`supported_efforts` is empty for a model with no effort control — that is a real
answer, not missing metadata, so a picker should render the model with no effort
dropdown rather than hiding it.
+
+ `cost_multiplier` is what this model costs per token against the catalog's baseline,
+ already rendered (`2.5×`, `≈0.55×`). `None` where the catalog quotes no rate, and a
+ picker then offers the model with no cost beside it.
"""
runtime_adapter: str
model: str
label: str
supported_efforts: tuple[str, ...]
+ cost_multiplier: str | None = None
@dataclass(frozen=True)
@@ -191,6 +196,7 @@ def available_model_choices(product: Product) -> tuple[ModelChoice, ...]:
model=model.id,
label=model_catalog.display_name_for_model(model.id),
supported_efforts=tuple(e.value for e in get_supported_reasoning_efforts(runtime_adapter, model.id)),
+ cost_multiplier=model_catalog.cost_multiplier_label(model.id),
)
)
return tuple(choices)
@@ -211,6 +217,7 @@ def catalog_model_choices() -> tuple[ModelChoice, ...]:
model=entry.id,
label=model_catalog.display_name_for_model(entry.id),
supported_efforts=entry.reasoning_efforts,
+ cost_multiplier=model_catalog.cost_multiplier_label(entry.id),
)
for entry in model_catalog.MODELS
)
diff --git a/products/tasks/backend/model_catalog.py b/products/tasks/backend/model_catalog.py
index 32a7ad1ee6f3..f24ea84eade1 100644
--- a/products/tasks/backend/model_catalog.py
+++ b/products/tasks/backend/model_catalog.py
@@ -2,7 +2,8 @@
This module is the single definition of the run triple — runtime adapter, model, and
reasoning effort — together with the model each adapter falls back to when a run pins
-none. Every surface that offers or validates a selection derives from here:
+none, and what each model costs relative to the rest. Every surface that offers or
+validates a selection derives from here:
- the backend, through ``products.tasks.backend.temporal.process_task.utils``;
- the web composer and settings, through ``products/tasks/frontend/modelCatalog.generated.ts``;
@@ -54,6 +55,18 @@ _GLM = (HIGH, MAX)
_NO_EFFORT: tuple[str, ...] = ()
+@dataclass(frozen=True)
+class ModelCost:
+ """List price in US dollars per million tokens, not the negotiated rate PostHog pays.
+
+ A picker states a comparison between models, and a negotiated rate would make it one
+ nobody outside PostHog could check.
+ """
+
+ input_per_mtok: float
+ output_per_mtok: float
+
+
@dataclass(frozen=True)
class CatalogModel:
"""One model a run may use.
@@ -71,6 +84,9 @@ class CatalogModel:
checked in and the desktop app auto-updates into it, so it is readable by anyone and can
be stale. Whether a run may actually use the model stays a server question, answered by
``get_model_access_error`` on every write path.
+
+ ``cost`` is ``None`` where no public price list covers the model, and a picker then shows
+ it with no cost rather than a guessed one.
"""
id: str
@@ -78,40 +94,82 @@ class CatalogModel:
reasoning_efforts: tuple[str, ...]
label: str | None = None
access_flag: str | None = None
-
+ cost: ModelCost | None = None
+
+
+# Rates a model family lists at. Sources, checked 2026-09-17: Anthropic and OpenAI publish
+# theirs; the models PostHog serves through Cloudflare, Baseten and Modal are quoted at what
+# the gateway bills, pinned in
+# `services/llm-gateway/src/llm_gateway/rate_limiting/model_cost_overrides.py`.
+_GLM_COST = ModelCost(1.4, 4.4)
+_GLM_FLASH_COST = ModelCost(0.15, 0.5)
+_KIMI_COST = ModelCost(3, 15)
+_DEEPSEEK_COST = ModelCost(0.13, 0.26)
+_OPUS_COST = ModelCost(5, 25)
+_FABLE_COST = ModelCost(10, 50)
+_SONNET_COST = ModelCost(2, 10)
+_SONNET_4_COST = ModelCost(3, 15)
+_GPT_PRO_COST = ModelCost(5, 30)
+_GPT_MID_COST = ModelCost(2.5, 15)
+_GPT_LIGHT_COST = ModelCost(1, 6)
+_GPT_FRONTIER_COST = ModelCost(10, 50)
MODELS: tuple[CatalogModel, ...] = (
# GLM 5.2 is Cloudflare-served and driven through the `claude` adapter: the LLM gateway
# exposes it over its Anthropic-Messages surface and translates the `@cf/` id upstream,
# so the `anthropic` provider is the intended routing rather than a direct Anthropic call.
- CatalogModel("@cf/zai-org/glm-5.2", CLAUDE, _GLM, label="GLM-5.2", access_flag="posthog-code-glm-model"),
- CatalogModel("zai-org/glm-5.3", CLAUDE, _GLM, label="GLM-5.3", access_flag="posthog-code-glm-53-model"),
CatalogModel(
- "zai-org/glm-5.3-flash", CLAUDE, _GLM, label="GLM-5.3 Flash", access_flag="posthog-code-glm-53-flash-model"
+ "@cf/zai-org/glm-5.2",
+ CLAUDE,
+ _GLM,
+ label="GLM-5.2",
+ access_flag="posthog-code-glm-model",
+ cost=_GLM_COST,
+ ),
+ CatalogModel(
+ "zai-org/glm-5.3",
+ CLAUDE,
+ _GLM,
+ label="GLM-5.3",
+ access_flag="posthog-code-glm-53-model",
+ cost=_GLM_COST,
+ ),
+ CatalogModel(
+ "zai-org/glm-5.3-flash",
+ CLAUDE,
+ _GLM,
+ label="GLM-5.3 Flash",
+ access_flag="posthog-code-glm-53-flash-model",
+ cost=_GLM_FLASH_COST,
+ ),
+ CatalogModel(
+ "moonshotai/kimi-k3", CLAUDE, _NO_EFFORT, label="Kimi K3", access_flag="tasks-kimi-k3", cost=_KIMI_COST
),
- CatalogModel("moonshotai/kimi-k3", CLAUDE, _NO_EFFORT, label="Kimi K3", access_flag="tasks-kimi-k3"),
CatalogModel(
"deepseek-ai/deepseek-v4-flash-0731",
CLAUDE,
_NO_EFFORT,
label="DeepSeek V4 Flash",
access_flag="posthog-code-deepseek-model",
+ cost=_DEEPSEEK_COST,
),
- CatalogModel("claude-opus-4-5", CLAUDE, _STANDARD),
- CatalogModel("claude-opus-4-6", CLAUDE, _THROUGH_MAX),
- CatalogModel("claude-opus-4-7", CLAUDE, _EXTENDED),
- CatalogModel("claude-opus-4-8", CLAUDE, _EXTENDED),
- CatalogModel("claude-opus-5", CLAUDE, _EXTENDED),
- CatalogModel("claude-fable-5", CLAUDE, _EXTENDED),
- CatalogModel("claude-fable-5-1", CLAUDE, _EXTENDED),
- CatalogModel("claude-sonnet-5", CLAUDE, _EXTENDED),
- CatalogModel("claude-sonnet-4-6", CLAUDE, _STANDARD),
+ CatalogModel("claude-opus-4-5", CLAUDE, _STANDARD, cost=_OPUS_COST),
+ CatalogModel("claude-opus-4-6", CLAUDE, _THROUGH_MAX, cost=_OPUS_COST),
+ CatalogModel("claude-opus-4-7", CLAUDE, _EXTENDED, cost=_OPUS_COST),
+ CatalogModel("claude-opus-4-8", CLAUDE, _EXTENDED, cost=_OPUS_COST),
+ CatalogModel("claude-opus-5", CLAUDE, _EXTENDED, cost=_OPUS_COST),
+ CatalogModel("claude-fable-5", CLAUDE, _EXTENDED, cost=_FABLE_COST),
+ CatalogModel("claude-fable-5-1", CLAUDE, _EXTENDED, cost=_FABLE_COST),
+ CatalogModel("claude-sonnet-5", CLAUDE, _EXTENDED, cost=_SONNET_COST),
+ CatalogModel("claude-sonnet-4-6", CLAUDE, _STANDARD, cost=_SONNET_4_COST),
+ # No cost: the gateway does not serve bare `gpt-5` to a task run, so there is no rate
+ # anyone can check it against.
CatalogModel("gpt-5", CODEX, _STANDARD),
- CatalogModel("gpt-5.5", CODEX, (*_STANDARD, XHIGH)),
- CatalogModel("gpt-5.6-sol", CODEX, _THROUGH_MAX),
- CatalogModel("gpt-5.6-terra", CODEX, _THROUGH_MAX),
- CatalogModel("gpt-5.6-luna", CODEX, _THROUGH_MAX),
- CatalogModel("gpt-6-astra", CODEX, _THROUGH_MAX),
+ CatalogModel("gpt-5.5", CODEX, (*_STANDARD, XHIGH), cost=_GPT_PRO_COST),
+ CatalogModel("gpt-5.6-sol", CODEX, _THROUGH_MAX, cost=_GPT_PRO_COST),
+ CatalogModel("gpt-5.6-terra", CODEX, _THROUGH_MAX, cost=_GPT_MID_COST),
+ CatalogModel("gpt-5.6-luna", CODEX, _THROUGH_MAX, cost=_GPT_LIGHT_COST),
+ CatalogModel("gpt-6-astra", CODEX, _THROUGH_MAX, cost=_GPT_FRONTIER_COST),
)
# Depths a whole model family exposes, used when no exact id matches. OpenAI ships
@@ -248,6 +306,74 @@ def display_name_for_model(model_id: str) -> str:
return (model.label if model else None) or format_model_id(normalized)
+# A mid-range anchor, so both the cheap end and the expensive end read as a useful ratio.
+COST_BASELINE_MODEL = "claude-sonnet-5"
+
+# Past this divergence between the input and output ratios, one number stops describing both
+# and the multiplier is marked approximate rather than dropped.
+_COST_RATIO_TOLERANCE = 0.1
+
+
+def cost_for_model(model_id: str) -> ModelCost | None:
+ """What this model lists at, or ``None`` when no public rate covers it."""
+ model = _MODEL_BY_ID.get(normalize_model_id(model_id))
+ return model.cost if model else None
+
+
+def _baseline_cost() -> ModelCost:
+ baseline = cost_for_model(COST_BASELINE_MODEL)
+ if baseline is None:
+ raise RuntimeError(f"the cost baseline {COST_BASELINE_MODEL!r} must carry a cost")
+ return baseline
+
+
+def cost_multiplier_for(model_id: str) -> tuple[float, bool] | None:
+ """This model's per-token cost relative to the baseline, and whether it is approximate.
+
+ Input and output rarely scale together, so one multiplier is the mean of both ratios.
+ """
+ cost = cost_for_model(model_id)
+ if cost is None:
+ return None
+ baseline = _baseline_cost()
+ input_ratio = cost.input_per_mtok / baseline.input_per_mtok
+ output_ratio = cost.output_per_mtok / baseline.output_per_mtok
+ spread = abs(input_ratio - output_ratio) / max(input_ratio, output_ratio)
+ return (input_ratio + output_ratio) / 2, spread > _COST_RATIO_TOLERANCE
+
+
+def _format_multiplier(multiplier: float) -> str:
+ """Round to the precision that stays meaningful at this magnitude: `5×`, `1.5×`, `0.06×`."""
+ if multiplier >= 10:
+ return str(round(multiplier))
+ if multiplier >= 0.95:
+ one_decimal = round(multiplier, 1)
+ return str(int(one_decimal)) if one_decimal.is_integer() else f"{one_decimal:.1f}"
+ return str(round(multiplier, 2))
+
+
+def cost_multiplier_label(model_id: str) -> str | None:
+ """The multiplier a picker shows beside a model, `2.5×` or `≈0.55×`, or ``None``.
+
+ Resolved here so the web composer, the Slack picker and the desktop app cannot quote one
+ model differently.
+ """
+ resolved = cost_multiplier_for(model_id)
+ if resolved is None:
+ return None
+ multiplier, approximate = resolved
+ return f"{'≈' if approximate else ''}{_format_multiplier(multiplier)}×"
+
+
+def format_cost_rates(cost: ModelCost) -> str:
+ """The rates behind a multiplier, for a tooltip: `Input $2 · Output $10 per 1M tokens`."""
+
+ def money(amount: float) -> str:
+ return f"${amount:.0f}" if float(amount).is_integer() else f"${amount:.2f}"
+
+ return f"Input {money(cost.input_per_mtok)} · Output {money(cost.output_per_mtok)} per 1M tokens"
+
+
def reasoning_efforts_for(runtime_adapter: str, model_id: str) -> tuple[str, ...]:
"""The efforts this model may run at, empty when it takes no effort at all.
@@ -274,6 +400,7 @@ __all__ = [
"ANTHROPIC",
"CLAUDE",
"CODEX",
+ "COST_BASELINE_MODEL",
"DEFAULT_MODEL_BY_RUNTIME_ADAPTER",
"FALLBACK_REASONING_EFFORTS_BY_RUNTIME_ADAPTER",
"MODELS",
@@ -283,6 +410,11 @@ __all__ = [
"access_flag_for_model",
"RUNTIME_ADAPTERS",
"CatalogModel",
+ "ModelCost",
+ "cost_for_model",
+ "cost_multiplier_for",
+ "cost_multiplier_label",
+ "format_cost_rates",
"label_for_model",
"models_for_runtime_adapter",
"normalize_model_id",
diff --git a/products/tasks/backend/presentation/serializers.py b/products/tasks/backend/presentation/serializers.py
index 61c5e959d14b..e64d61c455c6 100644
--- a/products/tasks/backend/presentation/serializers.py
+++ b/products/tasks/backend/presentation/serializers.py
@@ -2961,10 +2961,19 @@ class ModelChoiceSerializer(DataclassSerializer):
child=serializers.ChoiceField(choices=[effort.value for effort in PUBLIC_REASONING_EFFORTS]),
help_text="Reasoning efforts this model accepts, in ascending order. Empty for a model with no effort control.",
)
+ cost_multiplier = serializers.CharField(
+ allow_null=True,
+ required=False,
+ help_text=(
+ "Per-token cost against the catalogue baseline, ready to display, such as '2.5x' or "
+ "'~0.55x'. Prefixed when the input and output rates diverge enough that one number "
+ "flatters either. Null for a model the catalogue quotes no rate for."
+ ),
+ )
class Meta:
dataclass = ModelChoice
- fields = ["runtime_adapter", "model", "display_name", "supported_efforts"]
+ fields = ["runtime_adapter", "model", "display_name", "supported_efforts", "cost_multiplier"]
class ModelCatalogueResponseSerializer(serializers.Serializer):
diff --git a/products/tasks/backend/tests/__snapshots__/test_model_catalog/test_every_model_resolves_to_the_recorded_triple.json b/products/tasks/backend/tests/__snapshots__/test_model_catalog/test_every_model_resolves_to_the_recorded_triple.json
index 479e2d53f7c6..2f792a9af324 100644
--- a/products/tasks/backend/tests/__snapshots__/test_model_catalog/test_every_model_resolves_to_the_recorded_triple.json
+++ b/products/tasks/backend/tests/__snapshots__/test_model_catalog/test_every_model_resolves_to_the_recorded_triple.json
@@ -46,85 +46,127 @@
"default_model": "claude-sonnet-5",
"fallback_reasoning_efforts": [],
"models": {
- "@cf/zai-org/glm-5.2": [
- "high",
- "max"
- ],
- "claude-fable-5": [
- "low",
- "medium",
- "high",
- "xhigh",
- "max",
- "ultracode"
- ],
- "claude-fable-5-1": [
- "low",
- "medium",
- "high",
- "xhigh",
- "max",
- "ultracode"
- ],
- "claude-opus-4-5": [
- "low",
- "medium",
- "high"
- ],
- "claude-opus-4-6": [
- "low",
- "medium",
- "high",
- "xhigh",
- "max"
- ],
- "claude-opus-4-7": [
- "low",
- "medium",
- "high",
- "xhigh",
- "max",
- "ultracode"
- ],
- "claude-opus-4-8": [
- "low",
- "medium",
- "high",
- "xhigh",
- "max",
- "ultracode"
- ],
- "claude-opus-5": [
- "low",
- "medium",
- "high",
- "xhigh",
- "max",
- "ultracode"
- ],
- "claude-sonnet-4-6": [
- "low",
- "medium",
- "high"
- ],
- "claude-sonnet-5": [
- "low",
- "medium",
- "high",
- "xhigh",
- "max",
- "ultracode"
- ],
- "deepseek-ai/deepseek-v4-flash-0731": [],
- "moonshotai/kimi-k3": [],
- "zai-org/glm-5.3": [
- "high",
- "max"
- ],
- "zai-org/glm-5.3-flash": [
- "high",
- "max"
- ]
+ "@cf/zai-org/glm-5.2": {
+ "cost_multiplier": "≈0.57×",
+ "reasoning_efforts": [
+ "high",
+ "max"
+ ]
+ },
+ "claude-fable-5": {
+ "cost_multiplier": "5×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultracode"
+ ]
+ },
+ "claude-fable-5-1": {
+ "cost_multiplier": "5×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultracode"
+ ]
+ },
+ "claude-opus-4-5": {
+ "cost_multiplier": "2.5×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high"
+ ]
+ },
+ "claude-opus-4-6": {
+ "cost_multiplier": "2.5×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ]
+ },
+ "claude-opus-4-7": {
+ "cost_multiplier": "2.5×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultracode"
+ ]
+ },
+ "claude-opus-4-8": {
+ "cost_multiplier": "2.5×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultracode"
+ ]
+ },
+ "claude-opus-5": {
+ "cost_multiplier": "2.5×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultracode"
+ ]
+ },
+ "claude-sonnet-4-6": {
+ "cost_multiplier": "1.5×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high"
+ ]
+ },
+ "claude-sonnet-5": {
+ "cost_multiplier": "1×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultracode"
+ ]
+ },
+ "deepseek-ai/deepseek-v4-flash-0731": {
+ "cost_multiplier": "≈0.05×",
+ "reasoning_efforts": []
+ },
+ "moonshotai/kimi-k3": {
+ "cost_multiplier": "1.5×",
+ "reasoning_efforts": []
+ },
+ "zai-org/glm-5.3": {
+ "cost_multiplier": "≈0.57×",
+ "reasoning_efforts": [
+ "high",
+ "max"
+ ]
+ },
+ "zai-org/glm-5.3-flash": {
+ "cost_multiplier": "≈0.06×",
+ "reasoning_efforts": [
+ "high",
+ "max"
+ ]
+ }
},
"provider": "anthropic"
},
@@ -136,45 +178,63 @@
"high"
],
"models": {
- "gpt-5": [
- "low",
- "medium",
- "high"
- ],
- "gpt-5.5": [
- "low",
- "medium",
- "high",
- "xhigh"
- ],
- "gpt-5.6-luna": [
- "low",
- "medium",
- "high",
- "xhigh",
- "max"
- ],
- "gpt-5.6-sol": [
- "low",
- "medium",
- "high",
- "xhigh",
- "max"
- ],
- "gpt-5.6-terra": [
- "low",
- "medium",
- "high",
- "xhigh",
- "max"
- ],
- "gpt-6-astra": [
- "low",
- "medium",
- "high",
- "xhigh",
- "max"
- ]
+ "gpt-5": {
+ "cost_multiplier": null,
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high"
+ ]
+ },
+ "gpt-5.5": {
+ "cost_multiplier": "≈2.8×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ]
+ },
+ "gpt-5.6-luna": {
+ "cost_multiplier": "≈0.55×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ]
+ },
+ "gpt-5.6-sol": {
+ "cost_multiplier": "≈2.8×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ]
+ },
+ "gpt-5.6-terra": {
+ "cost_multiplier": "≈1.4×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ]
+ },
+ "gpt-6-astra": {
+ "cost_multiplier": "5×",
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ]
+ }
},
"provider": "openai"
}
diff --git a/products/tasks/backend/tests/test_model_catalog.py b/products/tasks/backend/tests/test_model_catalog.py
index c3cd6008eaac..9545d7b9bd55 100644
--- a/products/tasks/backend/tests/test_model_catalog.py
+++ b/products/tasks/backend/tests/test_model_catalog.py
@@ -45,7 +45,10 @@ def _resolved_catalog() -> dict[str, Any]:
model_catalog.FALLBACK_REASONING_EFFORTS_BY_RUNTIME_ADAPTER.get(adapter, ())
),
"models": {
- model_id: list(model_catalog.reasoning_efforts_for(adapter, model_id))
+ model_id: {
+ "reasoning_efforts": list(model_catalog.reasoning_efforts_for(adapter, model_id)),
+ "cost_multiplier": model_catalog.cost_multiplier_label(model_id),
+ }
for model_id in model_catalog.models_for_runtime_adapter(adapter)
},
}
@@ -128,6 +131,38 @@ def test_default_model_is_one_the_catalog_serves() -> None:
)
+def test_cost_baseline_is_a_model_the_catalog_prices() -> None:
+ assert model_catalog.cost_for_model(model_catalog.COST_BASELINE_MODEL) is not None, (
+ f"the cost baseline '{model_catalog.COST_BASELINE_MODEL}' carries no cost, so every multiplier "
+ f"raises and no picker can render"
+ )
+
+
+ "model,expected",
+ [
+ ("claude-sonnet-5", "1×"),
+ ("claude-opus-5", "2.5×"),
+ ("anthropic/claude-opus-5", "2.5×"),
+ ("gpt-5.6-sol", "≈2.8×"),
+ ("zai-org/glm-5.3-flash", "≈0.06×"),
+ ("gpt-5", None),
+ ("claude-imaginary-9", None),
+ ],
+ ids=[
+ "baseline_is_one",
+ "input_and_output_agree",
+ "provider_qualified_id",
+ "diverging_rates_are_approximate",
+ "cheap_model_keeps_two_decimals",
+ "unpriced_model",
+ "unknown_model",
+ ],
+)
+def test_cost_multiplier_reads_against_the_baseline(model: str, expected: str | None) -> None:
+ assert model_catalog.cost_multiplier_label(model) == expected
+
+
def test_labels_are_set_only_where_the_derived_name_is_wrong() -> None:
# A pin that the formatter would produce anyway is dead weight that outlives the
# formatter improving, so assert the property rather than restating the six strings.
diff --git a/products/tasks/frontend/generated/api.schemas.ts b/products/tasks/frontend/generated/api.schemas.ts
index d8d05cdb0673..392180f9e703 100644
--- a/products/tasks/frontend/generated/api.schemas.ts
+++ b/products/tasks/frontend/generated/api.schemas.ts
@@ -4676,6 +4676,11 @@ export interface ModelChoiceApi {
display_name: string
/** Reasoning efforts this model accepts, in ascending order. Empty for a model with no effort control. */
supported_efforts: ReasoningEffortEnumApi[]
+ /**
+ * Per-token cost against the catalogue baseline, ready to display, such as '2.5x' or '~0.55x'. Prefixed when the input and output rates diverge enough that one number flatters either. Null for a model the catalogue quotes no rate for.
+ * @nullable
+ */
+ cost_multiplier?: string | null
}
export interface ModelCatalogueResponseApi {
diff --git a/products/tasks/frontend/modelCatalog.generated.ts b/products/tasks/frontend/modelCatalog.generated.ts
index a9564bfc62cd..883edca47a9c 100644
--- a/products/tasks/frontend/modelCatalog.generated.ts
+++ b/products/tasks/frontend/modelCatalog.generated.ts
@@ -3,9 +3,9 @@
// Regenerate with `hogli build:task-model-catalog`. Do not edit.
//
// The single definition of a task agent run's triple: runtime adapter,
-// model, and reasoning effort. The backend validates a run against this
-// same data, so a picker built on this file can only offer a selection
-// the API will accept.
+// model, and reasoning effort, plus what each model costs. The backend
+// validates a run against this same data, so a picker built on this file
+// can only offer a selection the API will accept.
export type RuntimeAdapter = 'claude' | 'codex'
@@ -20,6 +20,11 @@ export type ByRuntimeAdapter<T> = Record<RuntimeAdapter, T>
/** Efforts per adapter, absent where the adapter has no fallback. */
type FallbackEfforts = Partial<ByRuntimeAdapter<readonly ReasoningEffort[]>>
+export interface ModelCost {
+ inputPerMtok: number
+ outputPerMtok: number
+}
+
export interface CatalogModel {
id: string
runtimeAdapter: RuntimeAdapter
@@ -32,8 +37,23 @@ export interface CatalogModel {
means generally available. Governs display only — the server decides
whether a run may use it. */
accessFlag?: string
+ /** List price in US dollars per million tokens. Absent for a model no
+ public price list covers, which a picker shows with no cost at all. */
+ cost?: ModelCost
+ /** Per-token cost against Claude Sonnet 5, ready to render: `2.5×`,
+ `≈0.55×`. Prefixed when input and output rates diverge enough that one
+ number flatters either. Absent whenever `cost` is. */
+ costMultiplier?: string
+ /** The rates behind the multiplier, ready to render. Absent whenever
+ `cost` is. */
+ costSummary?: string
}
+/** The model `1×` refers to. */
+export const COST_BASELINE_MODEL = 'claude-sonnet-5'
+
+export const COST_BASELINE_LABEL = 'Claude Sonnet 5'
+
/** Which vendor API each runtime adapter speaks. */
export const PROVIDER_BY_RUNTIME_ADAPTER: ByRuntimeAdapter<string> = {
claude: 'anthropic',
@@ -49,6 +69,12 @@ export const MODELS: readonly CatalogModel[] = [
reasoningEfforts: ['high', 'max'],
label: 'GLM-5.2',
accessFlag: 'posthog-code-glm-model',
+ cost: {
+ inputPerMtok: 1.4,
+ outputPerMtok: 4.4,
+ },
+ costMultiplier: '≈0.57×',
+ costSummary: 'Input $1.40 · Output $4.40 per 1M tokens',
},
{
id: 'zai-org/glm-5.3',
@@ -56,6 +82,12 @@ export const MODELS: readonly CatalogModel[] = [
reasoningEfforts: ['high', 'max'],
label: 'GLM-5.3',
accessFlag: 'posthog-code-glm-53-model',
+ cost: {
+ inputPerMtok: 1.4,
+ outputPerMtok: 4.4,
+ },
+ costMultiplier: '≈0.57×',
+ costSummary: 'Input $1.40 · Output $4.40 per 1M tokens',
},
{
id: 'zai-org/glm-5.3-flash',
@@ -63,6 +95,12 @@ export const MODELS: readonly CatalogModel[] = [
reasoningEfforts: ['high', 'max'],
label: 'GLM-5.3 Flash',
accessFlag: 'posthog-code-glm-53-flash-model',
+ cost: {
+ inputPerMtok: 0.15,
+ outputPerMtok: 0.5,
+ },
+ costMultiplier: '≈0.06×',
+ costSummary: 'Input $0.15 · Output $0.50 per 1M tokens',
},
{
id: 'moonshotai/kimi-k3',
@@ -70,6 +108,12 @@ export const MODELS: readonly CatalogModel[] = [
reasoningEfforts: [],
label: 'Kimi K3',
accessFlag: 'tasks-kimi-k3',
+ cost: {
+ inputPerMtok: 3,
+ outputPerMtok: 15,
+ },
+ costMultiplier: '1.5×',
+ costSummary: 'Input $3 · Output $15 per 1M tokens',
},
{
id: 'deepseek-ai/deepseek-v4-flash-0731',
@@ -77,60 +121,120 @@ export const MODELS: readonly CatalogModel[] = [
reasoningEfforts: [],
label: 'DeepSeek V4 Flash',
accessFlag: 'posthog-code-deepseek-model',
+ cost: {
+ inputPerMtok: 0.13,
+ outputPerMtok: 0.26,
+ },
+ costMultiplier: '≈0.05×',
+ costSummary: 'Input $0.13 · Output $0.26 per 1M tokens',
},
{
id: 'claude-opus-4-5',
runtimeAdapter: 'claude',
reasoningEfforts: ['low', 'medium', 'high'],
label: 'Claude Opus 4.5',
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 25,
+ },
+ costMultiplier: '2.5×',
+ costSummary: 'Input $5 · Output $25 per 1M tokens',
},
{
id: 'claude-opus-4-6',
runtimeAdapter: 'claude',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
label: 'Claude Opus 4.6',
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 25,
+ },
+ costMultiplier: '2.5×',
+ costSummary: 'Input $5 · Output $25 per 1M tokens',
},
{
id: 'claude-opus-4-7',
runtimeAdapter: 'claude',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max', 'ultracode'],
label: 'Claude Opus 4.7',
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 25,
+ },
+ costMultiplier: '2.5×',
+ costSummary: 'Input $5 · Output $25 per 1M tokens',
},
{
id: 'claude-opus-4-8',
runtimeAdapter: 'claude',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max', 'ultracode'],
label: 'Claude Opus 4.8',
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 25,
+ },
+ costMultiplier: '2.5×',
+ costSummary: 'Input $5 · Output $25 per 1M tokens',
},
{
id: 'claude-opus-5',
runtimeAdapter: 'claude',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max', 'ultracode'],
label: 'Claude Opus 5',
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 25,
+ },
+ costMultiplier: '2.5×',
+ costSummary: 'Input $5 · Output $25 per 1M tokens',
},
{
id: 'claude-fable-5',
runtimeAdapter: 'claude',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max', 'ultracode'],
label: 'Claude Fable 5',
+ cost: {
+ inputPerMtok: 10,
+ outputPerMtok: 50,
+ },
+ costMultiplier: '5×',
+ costSummary: 'Input $10 · Output $50 per 1M tokens',
},
{
id: 'claude-fable-5-1',
runtimeAdapter: 'claude',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max', 'ultracode'],
label: 'Claude Fable 5.1',
+ cost: {
+ inputPerMtok: 10,
+ outputPerMtok: 50,
+ },
+ costMultiplier: '5×',
+ costSummary: 'Input $10 · Output $50 per 1M tokens',
},
{
id: 'claude-sonnet-5',
runtimeAdapter: 'claude',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max', 'ultracode'],
label: 'Claude Sonnet 5',
+ cost: {
+ inputPerMtok: 2,
+ outputPerMtok: 10,
+ },
+ costMultiplier: '1×',
+ costSummary: 'Input $2 · Output $10 per 1M tokens',
},
{
id: 'claude-sonnet-4-6',
runtimeAdapter: 'claude',
reasoningEfforts: ['low', 'medium', 'high'],
label: 'Claude Sonnet 4.6',
+ cost: {
+ inputPerMtok: 3,
+ outputPerMtok: 15,
+ },
+ costMultiplier: '1.5×',
+ costSummary: 'Input $3 · Output $15 per 1M tokens',
},
{
id: 'gpt-5',
@@ -143,30 +247,60 @@ export const MODELS: readonly CatalogModel[] = [
runtimeAdapter: 'codex',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh'],
label: 'GPT-5.5',
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 30,
+ },
+ costMultiplier: '≈2.8×',
+ costSummary: 'Input $5 · Output $30 per 1M tokens',
},
{
id: 'gpt-5.6-sol',
runtimeAdapter: 'codex',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
label: 'GPT-5.6 Sol',
+ cost: {
+ inputPerMtok: 5,
+ outputPerMtok: 30,
+ },
+ costMultiplier: '≈2.8×',
+ costSummary: 'Input $5 · Output $30 per 1M tokens',
},
{
id: 'gpt-5.6-terra',
runtimeAdapter: 'codex',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
label: 'GPT-5.6 Terra',
+ cost: {
+ inputPerMtok: 2.5,
+ outputPerMtok: 15,
+ },
+ costMultiplier: '≈1.4×',
+ costSummary: 'Input $2.50 · Output $15 per 1M tokens',
},
{
id: 'gpt-5.6-luna',
runtimeAdapter: 'codex',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
label: 'GPT-5.6 Luna',
+ cost: {
+ inputPerMtok: 1,
+ outputPerMtok: 6,
+ },
+ costMultiplier: '≈0.55×',
+ costSummary: 'Input $1 · Output $6 per 1M tokens',
},
{
id: 'gpt-6-astra',
runtimeAdapter: 'codex',
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
label: 'GPT-6 Astra',
+ cost: {
+ inputPerMtok: 10,
+ outputPerMtok: 50,
+ },
+ costMultiplier: '5×',
+ costSummary: 'Input $10 · Output $50 per 1M tokens',
},
]
diff --git a/products/tasks/scripts/build_model_catalog.py b/products/tasks/scripts/build_model_catalog.py
index b3a45456c33f..bbd8487af88a 100755
--- a/products/tasks/scripts/build_model_catalog.py
+++ b/products/tasks/scripts/build_model_catalog.py
@@ -49,9 +49,9 @@ HEADER = """// AUTO-GENERATED by products/tasks/scripts/build_model_catalog.py f
// Regenerate with `hogli build:task-model-catalog`. Do not edit.
//
// The single definition of a task agent run's triple: runtime adapter,
-// model, and reasoning effort. The backend validates a run against this
-// same data, so a picker built on this file can only offer a selection
-// the API will accept."""
+// model, and reasoning effort, plus what each model costs. The backend
+// validates a run against this same data, so a picker built on this file
+// can only offer a selection the API will accept."""
@dataclass(frozen=True)
@@ -69,6 +69,11 @@ class Style:
raise RuntimeError(f"unexpected character in catalog value: {value!r}")
return f"{self.quote}{value}{self.quote}"
+ @staticmethod
+ def n(value: float) -> str:
+ """A number literal, written the way a hand-typed rate would be: `5`, not `5.0`."""
+ return str(int(value)) if float(value).is_integer() else repr(float(value))
+
def array(self, values: tuple[str, ...], *, prefix: str, suffix: str, depth: int) -> str:
"""An array literal, wrapped one item per line when the single-line form is too wide."""
pad = self.indent * depth
@@ -103,6 +108,29 @@ def render(catalog: dict[str, Any], style: Style) -> str:
models: tuple[Any, ...] = catalog["MODELS"]
efforts: tuple[str, ...] = catalog["REASONING_EFFORTS"]
display_name = catalog["display_name_for_model"]
+ multiplier_label = catalog["cost_multiplier_label"]
+ cost_rates = catalog["format_cost_rates"]
+ baseline_id = style.s(catalog["COST_BASELINE_MODEL"])
+ baseline_label = display_name(catalog["COST_BASELINE_MODEL"])
+ baseline_label_literal = style.s(baseline_label)
+
+ def cost_lines(model: Any) -> list[str]:
+ """The rates, and the two strings read off them, or nothing for an unpriced model.
+
+ Both strings are rendered here rather than in TypeScript so a model quotes the same
+ cost in the web app, Slack and the desktop app without three formatters agreeing by
+ hand. Only the numbers stay machine-readable, for a caller estimating a spend.
+ """
+ if model.cost is None:
+ return []
+ return [
+ f"{i}{i}cost: {{",
+ f"{i}{i}{i}inputPerMtok: {style.n(model.cost.input_per_mtok)},",
+ f"{i}{i}{i}outputPerMtok: {style.n(model.cost.output_per_mtok)},",
+ f"{i}{i}}},",
+ f"{i}{i}costMultiplier: {style.s(multiplier_label(model.id))},",
+ f"{i}{i}costSummary: {style.s(cost_rates(model.cost))},",
+ ]
def model_entry(model: Any) -> str:
return "\n".join(
@@ -113,6 +141,7 @@ def render(catalog: dict[str, Any], style: Style) -> str:
style.array(model.reasoning_efforts, prefix="reasoningEfforts: ", suffix=",", depth=2),
f"{i}{i}label: {style.s(display_name(model.id))},",
*([f"{i}{i}accessFlag: {style.s(model.access_flag)},"] if model.access_flag else []),
+ *cost_lines(model),
f"{i}}},",
]
)
@@ -149,6 +178,11 @@ export type ByRuntimeAdapter<T> = Record<RuntimeAdapter, T>{semi}
/** Efforts per adapter, absent where the adapter has no fallback. */
type FallbackEfforts = Partial<ByRuntimeAdapter<readonly ReasoningEffort[]>>{semi}
+export interface ModelCost {{
+{i}inputPerMtok: number{semi}
+{i}outputPerMtok: number{semi}
+}}
+
export interface CatalogModel {{
{i}id: string{semi}
{i}runtimeAdapter: RuntimeAdapter{semi}
@@ -161,8 +195,23 @@ export interface CatalogModel {{
{i} means generally available. Governs display only — the server decides
{i} whether a run may use it. */
{i}accessFlag?: string{semi}
+{i}/** List price in US dollars per million tokens. Absent for a model no
+{i} public price list covers, which a picker shows with no cost at all. */
+{i}cost?: ModelCost{semi}
+{i}/** Per-token cost against {baseline_label}, ready to render: `2.5×`,
+{i} `≈0.55×`. Prefixed when input and output rates diverge enough that one
+{i} number flatters either. Absent whenever `cost` is. */
+{i}costMultiplier?: string{semi}
+{i}/** The rates behind the multiplier, ready to render. Absent whenever
+{i} `cost` is. */
+{i}costSummary?: string{semi}
}}
+/** The model `1×` refers to. */
+export const COST_BASELINE_MODEL = {baseline_id}{semi}
+
+export const COST_BASELINE_LABEL = {baseline_label_literal}{semi}
+
/** Which vendor API each runtime adapter speaks. */
export const PROVIDER_BY_RUNTIME_ADAPTER: ByRuntimeAdapter<string> = {{
{provider_entries}
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index a224b9b8061b..731fab5990e8 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -56111,6 +56111,11 @@ export namespace Schemas {
display_name: string;
/** Reasoning efforts this model accepts, in ascending order. Empty for a model with no effort control. */
supported_efforts: ReasoningEffortEnum[];
+ /**
+ * Per-token cost against the catalogue baseline, ready to display, such as '2.5x' or '~0.55x'. Prefixed when the input and output rates diverge enough that one number flatters either. Null for a model the catalogue quotes no rate for.
+ * @nullable
+ */
+ cost_multiplier?: string | null;
}
export interface ModelCatalogueResponse {