Skip to content

fix: correct vendor model IDs and prices against primary docs (v1.22.1) - #122

Merged
stackbilt-admin merged 4 commits into
mainfrom
auto/bugfix/issue-112
Oct 15, 2026
Merged

stackbilt-admin merged 4 commits into
mainfrom
auto/bugfix/issue-112

Conversation

@stackbilt-admin

@stackbilt-admin stackbilt-admin commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Part of #112 (phase 1: verified corrections only). The issue stays open for phase 2.

Release: rebased onto main after v1.22.0 and includes the v1.22.1 patch bump (package.json, lockfile root entries, src/version.ts, CHANGELOG [1.22.1]).

Every value was checked against primary vendor documentation on 2026-10-15. No live or billable calls were made.

Fix Source
Anthropic 4.6 IDs claude-opus-4-6-20250618 / claude-sonnet-4-6-20250618 → claude-opus-4-6 / claude-sonnet-4-6. Model IDs are dateless from the 4.6 generation on. Models overview
claude-opus-4-20250618 → the real claude-opus-4-20250514 (retired) Model deprecations
Opus 4.6 priced at $5/$25 per MTok (was $15/$75); Opus/Sonnet 4.6 report their 1M context (was 200K); Claude 3.5 Haiku $0.80/$4 (was $0.25/$1.25). Cache reads (0.1x) and 5m/1h writes (1.25x/2x) added to Anthropic cost, streaming (including cumulative message_delta usage) and non-streaming. Pricing
Retired Claude models (Opus 4, Sonnet 4, 3.7 Sonnet, 3.5 Sonnet/Haiku, 3 Opus/Sonnet) marked retired, so routing no longer picks them Model deprecations
Workers AI Llama 3.1 8B / Llama 3 8B → $0.282/$0.827 per MTok, Mistral 7B v0.1 → $0.110/$0.190 (were $0.0001/MTok placeholders) Workers AI pricing, updated 2026-10-09
gpt-4, gpt-4-turbo and gpt-3.5-turbo carry the 2026-10-23 shutdown date. The unsupported "gpt-4o retired 2026-04-03" claim is removed. OpenAI deprecations
Cerebras prices and Workers AI models missing from Cloudflare's page are labelled unverified, with values unchanged Cerebras publishes no per-token prices

Compatibility

  • MODELS.CLAUDE_OPUS_4_6, CLAUDE_SONNET_4_6 and CLAUDE_OPUS_4 now hold the real IDs. Their literal types change because MODELS is as const; this is noted in the CHANGELOG. The old invalid strings are still accepted: the adapter, catalog lookups, getRoutingInfo/getGatewayRoutePlan and the factory entry points (quota checks, hooks, cache keys, client preflight), CreditLedger budgets/spend and schema-drift telemetry all translate them via the internal MODEL_ID_CORRECTIONS.
  • Retired models stay in the adapter allowlist, so explicit requests still pass through (and fail upstream, as they already do). Only automatic routing changes.

Phase 2 (not here; needs design decisions)

  • Urgent: OpenAI shuts down gpt-4, gpt-4-turbo and gpt-3.5-turbo on 2026-10-23. After that the OpenAI adapter's allowlist holds only gpt-4o-mini and the legacy gpt-3.5-turbo-16k. OpenAI has scheduled its gpt-4o-mini-2024-07-18 snapshot to shut down on 2027-01-14; no shutdown has been announced for the alias. This needs the custom-model escape hatch and/or a refreshed OpenAI catalog.
  • Current Anthropic lineup (4.7, 4.8, 5.x), unknown-cost semantics (no zero/placeholder rates), the Cerebras gpt-oss-120b ID (shared with Groq routing), NVIDIA zero placeholders, provenance fields, and the drift canary.

Tests

src/__tests__/catalog-accuracy.test.ts has 27 tests: adapter and catalog price parity, mapping of the old IDs to the real ones on the wire, preflight and gateway plans for the old IDs, the factory checking quota and recording usage under the real ID, retired exclusion for every use case, and cache-cost math (non-streaming, streaming via message_delta, and the no-split case) on an unchanged model ID so the cache math is isolated. Each fix was reverted in turn to confirm its test fails. Two existing tests that pinned the old invalid ID were updated. In factory.test.ts only those 2 lines are staged; the file's CRLF blob was left as is.

Validation: 664 tests across 29 files, typecheck and the Worker import smoke test pass.

🤖 Generated with Claude Code

stackbilt-admin pushed a commit that referenced this pull request Oct 15, 2026
Review of #122: the old Claude IDs were only translated inside the
Anthropic adapter, so routing preflight and gateway plans reported them
as unknown and non-executable, and the factory checked quota and fired
hooks under the old ID while recording usage under the real one.

- getRoutingInfo/getGatewayRoutePlan and the factory entry points
  (responses, streams, client preflight) resolve the ID first.
- Streaming takes cumulative usage from message_delta too.
- Opus/Sonnet 4.6 report the 1M context; Claude 3.5 Haiku is $0.80/$4.
- gpt-4o description no longer implies an OpenAI retirement.
- Cache tests use an unchanged model ID so they isolate the cache math;
  new tests cover preflight, gateway plans, factory quota/hook IDs and
  every recommendation use case.
- CHANGELOG notes the MODELS literal-type change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
stackbilt-admin pushed a commit that referenced this pull request Oct 15, 2026
…emetry

Round-2 review of #122: per-model ledger budgets keyed by an old Claude
ID never saw spend recorded under the real ID, and a direct adapter's
onSchemaDrift reported the unresolved ID.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
kovermier and others added 4 commits October 15, 2026 14:59
Phase 1 of #112. The catalog and adapters advertised Anthropic IDs that
do not exist (claude-*-20250618), priced Workers AI Llama/Mistral models
up to 8,270x below Cloudflare's published rates, priced Claude Opus 4.6
at 3x its rate, ignored Anthropic prompt-cache charges, routed to Claude
models the API has retired, and claimed gpt-4o was retired on a date
OpenAI never announced.

- Real dateless 4.6 IDs and the real Opus 4 snapshot; the invalid IDs
  earlier releases published are still accepted and mapped to real ones.
- Anthropic cost includes cache reads (0.1x) and 5m/1h writes (1.25x/2x).
- Retired Claude models are marked retired and excluded from routing.
- Workers AI prices from Cloudflare's pricing page; unlisted models and
  Cerebras placeholders are labelled unverified.
- OpenAI gpt-4/gpt-4-turbo/gpt-3.5-turbo carry the 2026-10-23 shutdown.

Sources checked 2026-10-15; no live or billable vendor calls.

Part of #112.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review of #122: the old Claude IDs were only translated inside the
Anthropic adapter, so routing preflight and gateway plans reported them
as unknown and non-executable, and the factory checked quota and fired
hooks under the old ID while recording usage under the real one.

- getRoutingInfo/getGatewayRoutePlan and the factory entry points
  (responses, streams, client preflight) resolve the ID first.
- Streaming takes cumulative usage from message_delta too.
- Opus/Sonnet 4.6 report the 1M context; Claude 3.5 Haiku is $0.80/$4.
- gpt-4o description no longer implies an OpenAI retirement.
- Cache tests use an unchanged model ID so they isolate the cache math;
  new tests cover preflight, gateway plans, factory quota/hook IDs and
  every recommendation use case.
- CHANGELOG notes the MODELS literal-type change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…emetry

Round-2 review of #122: per-model ledger budgets keyed by an old Claude
ID never saw spend recorded under the real ID, and a direct adapter's
onSchemaDrift reported the unresolved ID.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@stackbilt-admin stackbilt-admin changed the title fix: correct vendor model IDs and prices against primary docs fix: correct vendor model IDs and prices against primary docs (v1.22.1) Oct 15, 2026
@stackbilt-admin
stackbilt-admin merged commit da86fb3 into main Oct 15, 2026
2 checks passed
@stackbilt-admin
stackbilt-admin deleted the auto/bugfix/issue-112 branch October 15, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants