Skip to main content

AI Agent Payment Processing SDK - Non-custodial USDC payments for AI agents with bundled intelligence services

Project description

coinrailz

AI Agent Payment Processing SDK - Non-custodial USDC payments for AI agents with bundled intelligence services.

Features

  • Non-custodial: Your wallet, your keys. We never custody funds.
  • Low fees: 1.5% + $0.01 per transaction ($0.05 minimum)
  • Multi-chain: Base Chain primary, with Ethereum, Polygon, Arbitrum support
  • Intelligence bundle: 41 x402 microservices for market data, analytics, and more
  • CDP wallets: Automatic wallet creation via Coinbase Developer Platform
  • Type-safe: Full Pydantic models for all API responses

Installation

pip install coinrailz

Get Your API Key

Instant API Key - Pay $1 (USDC/USDT on Base or Solana) and get your API key immediately. No account required!

  1. Visit https://coinrailz.com/api-keys
  2. Send $1 to the platform wallet
  3. Verify your transaction and receive your key + $5 starter credits

Key Persistence: Your API key is permanent and works across ALL services. One key = unlimited access (credits are deducted per use). You can top up credits anytime with the same key.

Quick Start

from coinrailz import CoinRailz

# Initialize the client
client = CoinRailz(api_key="cr_live_...")  # Get your API key at https://coinrailz.com/api-keys

# Send a payment (1.5% + $0.01 fee)
result = client.send(
    to="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    amount=100,
    memo="Service payment"
)

if result.success:
    print(f"Payment sent: {result.transaction_id}")
    print(f"Fee: ${result.fee}")
    print(f"Net amount: ${result.net_amount}")

API Reference

Initialization

from coinrailz import CoinRailz

client = CoinRailz(
    api_key="cr_live_...",  # Required
    base_url="https://coinrailz.com",  # Optional, for self-hosted
    timeout=30,  # Optional, request timeout in seconds
    enable_intelligence=False  # Optional, enable x402 intelligence services
)

Send Payment

Send USDC to an address. Fee: 1.5% + $0.01

result = client.send(
    to="0x...",  # Recipient address
    amount=100,  # Amount in USDC
    currency="USDC",  # Optional, default USDC
    memo="Payment for services",  # Optional
    metadata={"order_id": "123"}  # Optional, custom data
)

# Response (SendPaymentResult)
# result.success = True
# result.transaction_id = "sdk_tx_..."
# result.status = "pending"
# result.amount = 100
# result.fee = 1.51
# result.net_amount = 98.49
# result.fee_breakdown.rate = "1.5% + $0.01"

Create Invoice

Create a payment invoice for receiving funds.

invoice = client.create_invoice(
    amount=50,
    description="AI assistant service fee",
    expires_in=15  # Minutes, default 15
)

# Response (InvoiceResult)
# invoice.invoice_id = "sdk_inv_..."
# invoice.payment_address = "0x..."
# invoice.status = "pending"

Get Reports

Get activity reports for your account.

report = client.get_reports(
    period="weekly",  # "daily" | "weekly" | "monthly"
    format="json"  # "json" | "markdown"
)

# Response (ReportResult)
# report.summary.total_transactions = 42
# report.summary.total_volume_usd = 5280.50

Get Balance

Get your wallet balance.

balance = client.get_balance()

# Response (BalanceResult)
# balance.balances.USDC = 1250.00
# balance.balances.ETH = 0.05

Create Wallet

Create a new CDP wallet.

wallet = client.create_wallet()

# Response (WalletResult)
# wallet.wallet_id = "sdk_wallet_..."
# wallet.address = "0x..."
# wallet.status = "active"

Intelligence Services

Access 41 bundled x402 microservices (requires bundle subscription or +0.35% per call).

client = CoinRailz(
    api_key="cr_live_...",
    enable_intelligence=True
)

# Get wallet risk score
risk = client.intelligence("wallet-risk", {"address": "0x..."})

# Get trade signals
signals = client.intelligence("trade-signals", {"token": "ETH"})

# Get token sentiment
sentiment = client.intelligence("token-sentiment", {"token": "BTC"})

Context Manager

The client supports context manager protocol for automatic cleanup:

with CoinRailz(api_key="cr_live_...") as client:
    result = client.send(to="0x...", amount=100)

Error Handling

from coinrailz import CoinRailz, ApiError

result = client.send(to="0x...", amount=100)

if isinstance(result, ApiError):
    print(f"Error: {result.error}")
    print(f"Message: {result.message}")

    # Handle specific errors
    if result.error == "INVALID_API_KEY":
        # Regenerate API key
        pass
    elif result.error == "RATE_LIMITED":
        # Wait and retry
        pass

Pricing

Tier Volume Processing Fee
Starter $0-$10K/mo 1.5% + $0.01
Growth $10K-$100K/mo 1.25% + $0.01
Platform $100K+/mo 0.9% + $0.01

Intelligence Bundle: +0.35% per transaction OR $79/month flat

Transaction Limits

  • Minimum transaction: $0.05 USDC
  • Maximum transaction: $100,000 USDC (contact sales for higher limits)

Refunds & Disputes

Due to the non-custodial nature of blockchain transactions:

  • Refunds are not supported - All blockchain transactions are final and irreversible
  • Disputes: For transaction issues, contact support@coinrailz.com with your transaction ID
  • Prevention: Always verify recipient addresses before sending

Legal

This SDK provides non-custodial payment routing. Coin Railz does not hold, custody, or control user funds at any time. Users maintain full control of their wallets and private keys.

See Terms of Service for full legal terms.

Support

License

MIT License - see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coinrailz-1.0.1.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coinrailz-1.0.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file coinrailz-1.0.1.tar.gz.

File metadata

  • Download URL: coinrailz-1.0.1.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for coinrailz-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d3dd8706162315ed6bd8886cc70011f81e8fcd375c26271f5d385f87635ada1b
MD5 2c56e7d3898c51ce6f25a69ed9e0e9a7
BLAKE2b-256 c60f022e9eab802ab50e6e49ed4babab6fdd114a66027543f30eba76cf82fee8

See more details on using hashes here.

File details

Details for the file coinrailz-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: coinrailz-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for coinrailz-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4d6e524ed58e757069e64627a7c8473f80f3db0d3b96d2007762bbd70330791e
MD5 6535e7314595bc5eeb0822bd376bf618
BLAKE2b-256 64ae4ca072f76f6723035f05222d017a2de565ae03ccf3105ee73665f0e1ad44

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page