Skip to content

feat: Use OPG Token only#47

Open
kylexqian wants to merge 7 commits intomainfrom
claude/opg-only-pricing
Open

feat: Use OPG Token only#47
kylexqian wants to merge 7 commits intomainfrom
claude/opg-only-pricing

Conversation

@kylexqian
Copy link
Copy Markdown
Collaborator

Remove USDC option

kylexqian and others added 5 commits March 31, 2026 00:19
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>
# 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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we reverting this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed -- got mixed up when merging from previous update

kylexqian and others added 2 commits April 1, 2026 00:31
…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>
@kylexqian kylexqian force-pushed the claude/opg-only-pricing branch from 5495143 to e6cb877 Compare April 1, 2026 07:33
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