Skip to main content

Introduction

The HTTPayer Python SDK provides a simple interface for accessing 402-protected APIs using either proxy mode (API key) or relay mode (private key).

Installation

Quick Start

Proxy Mode

Relay Mode

Direct Mode

When privacy_mode=False, the SDK does not call the HTTPayer server, it attempts to call the target API directly. Ideal for when you don’t need cross-chain or privacy. If the target API returns payment instructions on the selected network, the SDK will pay them directly.

Key Features

  • Multiple Access Patterns: Proxy (API key), Relay (private key + privacy/cross-chain), or Direct (private key, no relay, single-chain)
  • Auto-handles 402: Automatically processes payment flows
  • Cross-chain Support: Pay on one chain, access APIs on another
  • Privacy Mode: Route payments through HTTPayer relay
  • Simulation: Preview costs without executing payments

Next Steps