The user is unable to use the official Python x402 SDK with the CDP mainnet facilitator due to a 401 Unauthorized error, despite verifying API keys and trying JWT signing. They suspect issues with the SDK's handling of CDP environment variables, missing authentication features, or gated access, indicating a need for better documentation or implementation.
I’m trying to run an x402-protected API using FastAPI + the official Python x402 SDK. Everything works on testnet using: [https://x402.org/facilitator](https://x402.org/facilitator) But when I switch to CDP mainnet: [https://api.cdp.coinbase.com/platform/v2/x402](https://api.cdp.coinbase.com/platform/v2/x402) I get: Facilitator get\_supported failed (401): Unauthorized What I’ve verified: \- App + infra works (FastAPI + Nginx + systemd) \- x402 middleware works on testnet (returns proper 402) \- CDP\_API\_KEY\_ID and CDP\_API\_KEY\_SECRET are set \- Direct curl to /supported returns 401 with: \- CDP\_API\_KEY\_ID / SECRET headers \- X-CDP-\* headers \- Tried JWT signing with ES256 using Secret API Key → still 401 \- x402 Python package doesn’t seem to read CDP env vars at all \- Docs say “just use HTTPFacilitatorClient”, but don’t show auth for Python Code looks like: facilitator = HTTPFacilitatorClient( FacilitatorConfig(url="https://api.cdp.coinbase.com/platform/v2/x402") ) server = x402ResourceServer(facilitator) server.register("eip155:8453", ExactEvmServerScheme()) app.add_middleware(PaymentMiddlewareASGI, routes=..., server=server) Error always happens during: `client.get_supported()` So I never even reach 402, just 500 Questions: 1. Has anyone actually gotten CDP x402 working in Python? 2. Does it require JWT auth (and if so what exact claims / format)? 3. Is the Python SDK missing something vs Go/TS? 4. Or is CDP facilitator access gated in some way? At this point I’ve ruled out env issues, header formats, and even direct HTTP calls. Would really appreciate if someone who has this running can share what actually works.