AgnicPay

Monetize Your AI Products

Earn revenue from every AI request in your application

Monetize Your AI Products

Build AI-powered products and earn revenue from every API call. Set your own margin, and we handle billing and payouts.

Perfect for SaaS builders, AI wrappers, and anyone building products on top of AI models.


How It Works

When you integrate AgnicPay AI Gateway into your product, you can add your own fee to every request:

Your Users  →  Your Application  →  AgnicPay AI Gateway  →  AI Models
                    ↑                                           |
                    └───────────── AI Response ←────────────────┘
  1. Your users make requests through your application
  2. You add your merchant fee (e.g., 20% margin)
  3. Users pay the AI cost + your fee
  4. You earn the difference automatically

Pricing Example

ComponentAmount
AI Model Cost$0.001
Your Fee (20%)$0.0002
User Pays$0.0012
You Earn$0.0002

Getting Started

1. Register as a Merchant

Visit pay.agnic.ai to:

  • Create your AgnicPay account
  • Get your Merchant ID (your account identifier)
  • Set up your Merchant Wallet (where you'll receive payouts)

2. Add Merchant Headers

Include three headers with every API request:

HeaderDescriptionExample
X-Merchant-IdYour AgnicPay account IDdid:privy:abc123...
X-Merchant-WalletYour payout wallet address0x1234...abcd
X-Merchant-Fee-PercentYour fee percentage (0-100)20

All three headers must be provided together. Partial headers will return an error.


Code Examples

Python

from openai import OpenAI
 
client = OpenAI(
    base_url="https://api.agnic.ai/v1",
    api_key="agnic_tok_YOUR_TOKEN",
    default_headers={
        "X-Merchant-Id": "did:privy:your-merchant-id",
        "X-Merchant-Wallet": "0xYourWalletAddress",
        "X-Merchant-Fee-Percent": "20",  # 20% margin
    }
)
 
completion = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)
 
print(completion.choices[0].message.content)

TypeScript / JavaScript

import OpenAI from 'openai';
 
const client = new OpenAI({
  baseURL: 'https://api.agnic.ai/v1',
  apiKey: 'agnic_tok_YOUR_TOKEN',
  defaultHeaders: {
    'X-Merchant-Id': 'did:privy:your-merchant-id',
    'X-Merchant-Wallet': '0xYourWalletAddress',
    'X-Merchant-Fee-Percent': '20', // 20% margin
  },
});
 
async function chat() {
  const completion = await client.chat.completions.create({
    model: 'openai/gpt-4o',
    messages: [{ role: 'user', content: 'Hello!' }],
  });
 
  console.log(completion.choices[0].message.content);
}
 
chat();

cURL

curl https://api.agnic.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer agnic_tok_YOUR_TOKEN" \
  -H "X-Merchant-Id: did:privy:your-merchant-id" \
  -H "X-Merchant-Wallet: 0xYourWalletAddress" \
  -H "X-Merchant-Fee-Percent: 20" \
  -d '{
    "model": "openai/gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Per-Request Fee

You can also set different fees per request:

import requests
 
def call_ai(prompt: str, fee_percent: int = 20):
    response = requests.post(
        "https://api.agnic.ai/v1/chat/completions",
        headers={
            "Authorization": "Bearer agnic_tok_YOUR_TOKEN",
            "Content-Type": "application/json",
            "X-Merchant-Id": "did:privy:your-merchant-id",
            "X-Merchant-Wallet": "0xYourWalletAddress",
            "X-Merchant-Fee-Percent": str(fee_percent),
        },
        json={
            "model": "openai/gpt-4o",
            "messages": [{"role": "user", "content": prompt}]
        }
    )
    return response.json()
 
# Premium feature - higher margin
premium_response = call_ai("Analyze this data...", fee_percent=30)
 
# Basic feature - lower margin
basic_response = call_ai("Quick question...", fee_percent=10)

Business Model Examples

AI Chatbot SaaS

Charge users per message with a built-in margin:

# User sends a message in your chatbot
# You earn on every interaction
 
def handle_user_message(user_message: str):
    completion = client.chat.completions.create(
        model="anthropic/claude-3.5-sonnet",
        messages=[{"role": "user", "content": user_message}]
    )
    # User pays AI cost + your 25% fee
    return completion.choices[0].message.content

Developer Tools

Add AI features to your dev tools with usage-based pricing:

# Code review feature in your IDE extension
def review_code(code: str):
    completion = client.chat.completions.create(
        model="openai/gpt-4o",
        messages=[{
            "role": "user",
            "content": f"Review this code:\n{code}"
        }]
    )
    return completion.choices[0].message.content

White-Label AI Solutions

Build AI products for clients with your own branding and pricing:

# Each client can have different margins
CLIENTS = {
    "client_a": {"fee": 15, "wallet": "0xClientAWallet..."},
    "client_b": {"fee": 25, "wallet": "0xClientBWallet..."},
}
 
def call_for_client(client_id: str, prompt: str):
    config = CLIENTS[client_id]
 
    response = requests.post(
        "https://api.agnic.ai/v1/chat/completions",
        headers={
            "Authorization": "Bearer agnic_tok_YOUR_TOKEN",
            "X-Merchant-Id": "did:privy:your-id",
            "X-Merchant-Wallet": config["wallet"],
            "X-Merchant-Fee-Percent": str(config["fee"]),
        },
        json={"model": "openai/gpt-4o", "messages": [{"role": "user", "content": prompt}]}
    )
    return response.json()

Response Headers

After a successful request, check the response headers for confirmation:

HeaderDescription
X-Agnic-Merchant-IdYour merchant ID (confirms fee was applied)
X-Agnic-Merchant-Fee-PercentThe fee percentage used

Viewing Your Earnings

Track your earnings in real-time:

  1. Log in to pay.agnic.ai
  2. Navigate to your dashboard
  3. View pending settlements and payout history

Settlements are processed automatically. Earnings accumulate and are paid out to your merchant wallet.


Fee Guidelines

Fee PercentUse Case
5-10%High-volume, low-margin products
15-25%Standard SaaS applications
30-50%Premium features, specialized tools
50%+White-glove services, enterprise solutions

Start with a moderate fee (15-20%) and adjust based on your market and value proposition.


Current Limitations

  • Streaming: Merchant fees are not currently supported with streaming responses (stream: true). Use non-streaming requests for monetized calls.

Next Steps

On this page