Skip to main content
Source: rekko_tools.py in the rekko-skill repo
RekkoClient is an async HTTP client that wraps all Rekko API endpoints. It supports both API key auth and x402 USDC micropayments on Base L2.

Installation

pip install httpx

# For x402 autopay (optional)
pip install "x402[fastapi]" eth-account

Constructor

from rekko_tools import RekkoClient

# API key auth (reads REKKO_API_KEY from env)
client = RekkoClient()

# Explicit API key
client = RekkoClient(api_key="rk_free_...")

# x402 autopay with a signer
from eth_account import Account
signer = Account.from_key("0x...")
client = RekkoClient(signer=signer)

# x402 autopay (reads X402_PRIVATE_KEY from env)
client = RekkoClient()  # auto-detects if X402_PRIVATE_KEY is set
Use as an async context manager:
async with RekkoClient() as client:
    markets = await client.list_markets()

Methods

Market Intelligence

MethodTierDescription
list_markets(source, limit)ListingBrowse current prediction markets
get_market(platform, market_id)ListingGet details for a single market
search_markets(query, limit)ListingSearch markets by keyword
get_market_history(platform, market_id, period, max_points)ListingPrice history

Screening & Discovery

MethodTierDescription
screen_markets(market_ids, platform, min_volume_24h, min_score, limit)InsightBatch screen markets by score
get_calibration(category, period, mode)FreeSignal accuracy metrics

Deep Research

MethodTierDescription
analyze_market(bet_text, platform)InsightStart async analysis (returns analysis_id)
check_analysis_status(analysis_id)InsightPoll analysis completion
get_analysis(analysis_id)InsightGet completed analysis result
list_analyses(limit)InsightList recent analyses

Strategy & Portfolio

MethodTierDescription
get_strategy(market_query, risk_limit)StrategyFull analysis + signal (blocking, 30-90s)
get_portfolio_strategy(market_query, portfolio, bankroll_usd, max_position_pct)StrategyPortfolio-aware signal
get_consensus(market_id, platform, period)StrategyConsensus from agent trades

Arbitrage

MethodTierDescription
get_arbitrage(min_spread)DeepCross-platform arb opportunities (cached)
get_arbitrage_live(min_spread)DeepFresh arbitrage scan (10-30s)

Correlation

MethodTierDescription
get_correlation(market_ids, platform, period)DeepCross-market correlation graph

Trading

MethodTierDescription
place_shadow_trade(ticker, side, size_usd)StrategyPaper trade for tracking
report_trade(market_id, platform, side, size_usd, price)StrategyReport trade for consensus
get_portfolio(mode)StrategyPositions and P&L
get_performance(mode)StrategyAggregate trading stats
check_resolutions()StrategySettle resolved markets

Webhooks

MethodTierDescription
create_webhook(url, events, secret)DeepRegister event webhook
list_webhooks()DeepList webhooks
delete_webhook(webhook_id)DeepRemove a webhook

x402 payment flow

When x402 is enabled, the client handles the payment handshake automatically:
  1. Client makes a request to api.rekko.ai
  2. Server returns HTTP 402 with a payment envelope
  3. Client signs a USDC payment on Base L2 (chain ID 8453)
  4. Client retries the request with the signed payment proof
  5. Server verifies and settles the payment, returns data
No manual header parsing needed — RekkoClient handles the entire loop.

Pricing tiers

TierCost/callExample methods
Free$0.00get_calibration
Listing$0.01list_markets, search_markets, get_market_history
Insight$0.10analyze_market, screen_markets
Strategy$2.00get_strategy, get_portfolio_strategy, get_consensus
Deep$5.00get_arbitrage, get_correlation, create_webhook