Skip to content

Implement x402 protocol for crypto payments and update documentation#367

Merged
asim merged 2 commits intomainfrom
claude/track-api-usage-L6x8s
Mar 24, 2026
Merged

Implement x402 protocol for crypto payments and update documentation#367
asim merged 2 commits intomainfrom
claude/track-api-usage-L6x8s

Conversation

@asim
Copy link
Member

@asim asim commented Mar 24, 2026

No description provided.

claude added 2 commits March 24, 2026 13:52
Implement the x402 HTTP payment protocol so external clients (AI agents,
apps) can pay per-request with USDC stablecoins instead of needing a Mu
account. Set X402_PAY_TO to a wallet address to enable.

Flow: client sends request → server returns 402 with payment requirements
→ client pays on-chain → retries with X-PAYMENT header → server verifies
and settles via facilitator → serves the response.

- wallet/x402.go: protocol implementation (requirements, verify, settle)
- main.go: x402 auth bypass and quota check integration
- internal/api/mcp.go: 402 response with payment requirements on quota failure
- docs/ENVIRONMENT_VARIABLES.md: x402 configuration docs

https://claude.ai/code/session_016UhaM3HefwZjArvB7hHbpE
@asim asim merged commit a084f16 into main Mar 24, 2026
2 checks passed
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