v4.0.0
Removed (BREAKING)
The v1-era public exports are gone, completing the 3.9.0 deprecation. The payment engine is unchanged — payAndFetch (client) and x402Middleware (server) have been the canonical paths since 3.x and cover everything the removed helpers did.
- client:
createX402Client,wrapFetch(and theX402Client,X402ClientConfig,WrapFetchOptionstypes). →payAndFetch(url, init, wallets). - server:
x402AccessPass,x402BrowserSupport,escapeHtml. →x402Middleware. - server:
createDynamicPricing,formatPricing. → compute the price per request in your handler and pass it tox402Middleware. - server: the entire token/model pricing surface —
createTokenPricing,countTokens,getAvailableModels,isValidModel,formatTokenPricing,MODEL_PRICING,MODEL_REGISTRY,MODEL_PRICING_MAP,getModel,findModel,isValidModelId,getAvailableModelIds,getModelsByTier,getModelsByFamily,getActiveModels,getTextModels,getCheapestModel,estimateCost,formatModelPricing(and their types). This wrapped a hardcoded January-2026 OpenAI snapshot that goes stale fast; price requests with your model provider's live API and pass the amount tox402Middleware. - server:
stripePayTo. → aPayToProvidermap onx402Middleware. (getStripeProviderNetworkstays internal.) - react:
useAccessPass. →useX402Payment.
Notes
- EVM one-shot pay-per-call is unchanged.
payAndFetchremains the live EVM path until Tabs reaches EVM. ThecreateX402Client/wrapFetchimplementations are retained internally — they still powerpayAndFetch, the v2 strategy, anduseX402Payment; only their public exports were removed. - To stay on the old surface, pin
@dexterai/x402@^3.