AI Payment Use Cases

Real-world applications of autonomous AI payments. See how ifenpay enables the future of machine-to-machine commerce.

💡 Use Case #1

AI Agent Marketplaces

Enable autonomous buying and selling of AI services in digital marketplaces without human intervention.

Data Processing Services

AI agents purchase data cleaning, transformation, or analysis from specialized agents

API Access Marketplace

Agents sell access to proprietary APIs on a pay-per-call basis

Compute Resource Trading

Agents with excess compute power sell it to agents needing temporary resources

ai_marketplace.py
import requests

# Service provider creates payment request (automatic wallet)
service_address = "nano_3provider..."
response = requests.post(
    AGENT_URL,
    json={
        "message": "payment.request 0.5",
        "mode": "strict",
        "session_id": "provider_session"
    }
)
# Returns: {"response": "success", "data": {"transaction_id": "...", "receive_address": "nano_...", ...}}

# AI agent pays instantly
pay_response = requests.post(
    AGENT_URL,
    json={
        "message": "nano.send nano_3provider... 0.5",
        "mode": "strict",
        "session_id": "buyer_session"
    }
)
# Returns: {"response": "success", "data": {"amount": "0.5", "recipient": "nano_...", "block_hash": "..."}}

# Provider checks payment status
status = requests.post(
    AGENT_URL,
    json={
        "message": "payment.status transaction_id",
        "mode": "strict",
        "session_id": "provider_session"
    }
)
model_monetization.py
import requests
import uuid

AGENT_URL = "http://127.0.0.1:7860/api/chat/stream"

# AI Model Provider receives inference request
def handle_inference(request):
    # Calculate cost
    tokens = count_tokens(request.prompt)
    cost = tokens * 0.00001  # 0.00001 NANO per token
    
    # Create payment request with ifenpay-Agent
    result = requests.post(AGENT_URL, json={
        "message": f"payment.request {cost}",
        "mode": "strict",
        "session_id": provider_session
    }).json()
    # Response: {"response": "success", "data": {"transaction_id": "...", "api_key": "...", ...}}
    
    # Extract payment details from response
    tx_id = result["data"]["transaction_id"]
    api_key = result["data"]["api_key"]
    
    # Customer sends payment
    customer_result = requests.post(AGENT_URL, json={
        "message": f"nano.send {provider_address} {cost}",
        "mode": "strict",
        "session_id": customer_session
    })
    
    # Check payment status
    status = requests.post(AGENT_URL, json={
        "message": f"payment.status {tx_id} {api_key}",
        "mode": "strict",
        "session_id": customer_session
    }).json()
    
    if status["response"] == "success":
        return run_inference(request.prompt)
🤖 Use Case #2

Pay-Per-Use AI Models

Monetize AI models with per-inference payments. Zero fees make microtransactions economically viable.

Dynamic Pricing

Calculate cost based on token usage and create payment request

Payment Verification

Use payment.status command to verify payment before serving inference

Session-Based Tracking

Track requests using session IDs and payment transaction IDs

⚡ Use Case #3

Direct Agent Payments

AI agents send and receive payments directly for compute, data, or services.

Simple Send/Receive

Use nano.send command and auto-receive on unlock for direct agent-to-agent payments

Balance Monitoring

Use balance.check command before purchasing

Auto-Receive

Payments automatically received in strict mode - no manual unlock needed

Example: Compute Trading

import requests
import uuid

AGENT_URL = "http://127.0.0.1:7860/api/chat/stream"

# Agent A needs compute, checks balance
session_a = str(uuid.uuid4())
result = requests.post(AGENT_URL, json={
    "message": f"balance.check {agent_address}",
    "mode": "strict",
    "session_id": session_a
}).json()

# Send payment to Agent B
result = requests.post(AGENT_URL, json={
    "message": f"nano.send {provider_address} 0.1",
    "mode": "strict",
    "session_id": session_a
})
# Response: {"response": "success", "data": {"amount": "0.1", "recipient": "nano_...", "block_hash": "..."}}

# Agent B auto-receives when unlocking wallet
session_b = str(uuid.uuid4())
requests.post(AGENT_URL, json={
    "message": "wallet.unlock ProviderWallet",
    "mode": "strict",
    "session_id": session_b
# Compute access granted

Data Purchase Flow

1

Create Payment Request

Seller uses payment.request command to create request

2

Buyer Pays

Buyer sends payment with nano.send command

3

Status Verification

Buyer verifies with payment.status command

4

Auto-Receive

Payment automatically received in strict mode

5

Data Delivery

Dataset automatically sent to buyer

< 30 seconds
Payment verification + delivery
📊 Use Case #4

Data Purchase Between AI Agents

Buy and sell data between AI agents with instant payment verification.

Session-Based Tracking

Track purchases using unique session_id for each AI agent interaction

Payment Verification

Use payment.status command to verify purchase completion instantly

Instant Verification

Use payment.status to verify payment completion—automatically deliver data

More AI Payment Scenarios

💳

Recurring Subscriptions

Create new transaction every billing period with /transaction/create—customers pay automatically

🤝

Multi-Agent Collaboration

Agents split costs using /send—pay each contributor their share instantly

📊

Usage Tracking

Track usage through session_id and payment.status—build audit trails and analytics

Instant Refunds

Use /send to refund overpayments—no processing delays or fees

🔐

Pay-Per-Access

Grant API/resource access only after verifying payment via /transaction/status

🤖 Open Source Solution

Integrate ifenpay-Agent

Production-ready Flask-based AI agent with 7 strict mode commands for autonomous payments. No LLM overhead, instant responses.

Machine-Readable

Structured responses with status + data format—parse {"response": "success", "data": {...}} directly

🔧

7 Commands

check.balance, nano.send, payment.request, payment.status, credits.info, credits.topup, and donate.nano

🚀

Production Ready

Flask API with SSE, automatic wallet management, comprehensive error handling

Ready to Build Your AI Payment System?

Join the AI-to-AI payment revolution. Open source agent, production-ready API, active community.