Skip to content

Showcase: x402 pay-per-call crypto data tools for CrewAI — BTC signals + Polymarket intel #5025

@ERROR403agent

Description

@ERROR403agent

Production x402 endpoint example for x402-openai-python

Hi! I wanted to share a working example using this library with a live production x402 API.

We built DeepBlue — an autonomous crypto trading system — and opened up the signals layer as a public x402 endpoint. It's useful as a real-world test target that actually processes payments.

Endpoint

https://api.deepbluebase.xyz

Working example with x402-fetch (TypeScript)

import { wrapFetchWithPayment } from 'x402-fetch';

const fetch = wrapFetchWithPayment(globalThis.fetch, {
  privateKey: process.env.WALLET_KEY
});

// $0.005 USDC on Base — returns live BTC directional signal
const res = await fetch('https://api.deepbluebase.xyz/btc/realtime-signal?coin=BTC');
const data = await res.json();
// { coin: "BTC", direction: "UP", confidence: 0.71, regime: "trending_up" }

// $0.01 USDC — full market snapshot
const snapshot = await fetch('https://api.deepbluebase.xyz/market-snapshot');

Python example

import requests
from x402.client import X402Client

client = X402Client(private_key=os.environ["WALLET_PRIVATE_KEY"])
response = client.get("https://api.deepbluebase.xyz/btc/realtime-signal?coin=BTC")
print(response.json())
# {"coin": "BTC", "direction": "UP", "confidence": 0.68, "regime": "trending_up"}

Available endpoints (prices in USDC on Base)

Route Price Description
/btc/realtime-signal?coin=BTC $0.005 Live directional signal
/market-snapshot $0.01 BTC macro bundle
/signals $0.01 6-indicator momentum data
/market-intel $0.02 Funding rates + liquidation risk
/prediction-markets $0.03 Polymarket positions + odds

Docs + playground: https://api.deepbluebase.xyz/docs

Sharing in case it's useful for testing or as a reference for what production x402 implementations look like.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions