Conversation
Strips all USDC/OUSDC payment options from the x402 middleware routes and removes associated constants and network registrations. The gateway now only accepts $OPG (Base Testnet, eip155:84532) for both the pre-check and dynamic settlement. Removed: - EVM_NETWORK (OG EVM / eip155:10740) and its scheme registrations - USDC_ADDRESS, CHAT_COMPLETIONS_USDC_AMOUNT, COMPLETIONS_USDC_AMOUNT - USDC entry in ASSET_DECIMALS_BY_ADDRESS - POST /v1/completions route (was USDC-only) - OUSDC PaymentOption from POST /v1/chat/completions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mirrors the /v1/chat/completions payment setup: accepts OPG on Base Testnet (eip155:84532) via the upto scheme, with a 0.05 OPG session pre-check ceiling. Adds COMPLETIONS_OPG_AMOUNT constant alongside the existing CHAT_COMPLETIONS_OPG_AMOUNT in definitions.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
USDC_ADDRESS no longer exists in definitions.py since the gateway was updated to accept OPG only. Removes the USDC import, _usdc_requirements helper, _expected_cost_usdc helper, and the TestDynamicSessionCostCalculatorUSDC test class that relied on them. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
adambalogh
reviewed
Mar 31, 2026
tee_gateway/definitions.py
Outdated
| # based on actual token usage, so clients are never overcharged beyond what they consumed. | ||
| CHAT_COMPLETIONS_OPG_SESSION_MAX_SPEND: str = "100000000000000000" | ||
| # /v1/chat/completions — 0.05 OPG precheck (18 decimals) | ||
| CHAT_COMPLETIONS_OPG_AMOUNT: str = "50000000000000000" |
Contributor
There was a problem hiding this comment.
why are we reverting this?
Collaborator
Author
There was a problem hiding this comment.
Fixed -- got mixed up when merging from previous update
…l comments Renames CHAT_COMPLETIONS_OPG_AMOUNT → CHAT_COMPLETIONS_OPG_SESSION_MAX_SPEND and COMPLETIONS_OPG_AMOUNT → COMPLETIONS_OPG_SESSION_MAX_SPEND to make the purpose explicit: these are the upper-bound caps shown during the x402 pre-check, not fixed charges. Adds the same multi-line comment block used for the chat completions constant to the completions constant as well. Updates all references in __main__.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updates both CHAT_COMPLETIONS_OPG_SESSION_MAX_SPEND and COMPLETIONS_OPG_SESSION_MAX_SPEND from 0.05 OPG to 0.1 OPG. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5495143 to
e6cb877
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove USDC option