DEV Community

nanoempireai
nanoempireai

Posted on

How to Price Your API for AI Agents: The Complete Guide

How to Price Your API for AI Agents: The Complete Guide

Pricing for human customers is well-understood. Pricing for AI agents requires a completely different mental model.

Why Agent Pricing Is Different

Human buyers:

  • Have budgets approved by committees
  • Pay monthly/annually via credit card
  • Need sales demos, contracts, procurement
  • Churn when budget gets cut

Agent buyers:

  • Have wallets with USDC
  • Pay per transaction (micropayments)
  • Discover via llms.txt/agents.json
  • Pay instantly via x402 (HTTP 402)
  • Zero human intervention

The Three Pricing Models

1. Per-Call (Recommended for Agents)

Price: $0.05 per API call
Free tier: 5 calls/day per IP
Enter fullscreen mode Exit fullscreen mode

Pros: Fair, scalable, agents love it
Cons: Revenue unpredictable at low volume

2. Subscription + Overage

Base: $29/month for 1,000 calls
Overage: $0.03/call
Enter fullscreen mode Exit fullscreen mode

Pros: Predictable revenue
Cons: Agents hate subscriptions, hard to cancel programmatically

3. Dynamic/Usage-Based

@monetize(price_usd=dynamic_price)
async def dynamic_endpoint(data):
    price = calculate_price(
        compute_cost=data.complexity,
        latency_requirement=data.latency_requirement,
        data_freshness=data.freshness_requirement
    )
    return {"price": price, "result": process(data)}
Enter fullscreen mode Exit fullscreen mode

Pros: Optimal price discrimination
Cons: Complex, agents need predictable pricing

The $0.05 Sweet Spot

After testing, $0.05/call hits the sweet spot:

Tier Price Daily Limit Best For
Free $0.00 5 calls/IP Testing
Basic $0.005 100 calls Light agents
Premium $0.05 Unlimited Production agents

Why $0.05?

  • Low enough for experimentation
  • High enough to cover compute + margin
  • Beats Stripe (2.9% + $0.30) for micro-transactions
  • Becomes the market benchmark

The Volume Discount Trap

Don't offer volume discounts to agents.

Agents can spin up multiple identities:

  • "1000 calls for $40" = agent spins up 10 identities
  • Pays $40 for $50 value
  • You lose revenue

Per-call pricing is identity-proof (mostly).

Dynamic Pricing (Advanced)

Next evolution: price per call based on:

@monetize(price_usd=dynamic_price)
async def dynamic_endpoint(data):
    price = calculate_price(
        compute_cost=data.complexity,
        latency_requirement=data.latency_requirement,
        data_freshness=data.freshness_requirement
    )
    return {"price": price, "result": process(data)}
Enter fullscreen mode Exit fullscreen mode

Factors:

  • Compute cost (heavy ops = higher price)
  • Latency tier (fast lane = premium)
  • Data freshness (real-time = premium)
  • Agent reputation (trusted agents = discount)

The Free Tier Strategy

Free tier = acquisition funnel, not charity.

Tier Calls/Day Purpose
Free 3-5 Acquisition, testing
Paid Unlimited Production

Don't make free tier too generous. 5 calls/day -> agents test 5x and leave. Reduce to 3 calls/day for new APIs.

Price Discovery for Agents

Agents discover prices via:

  1. llms.txt -- Lists your services + prices
  2. agents.json -- Schema.org Offer with price
  3. openapi.json -- With x-402-pricing extensions
  4. x402 challenge response -- Real-time quote

Make all three consistent.

The Payment Protocol

Agents pay via x402 (HTTP 402):

  1. Agent calls your endpoint
  2. Your API returns HTTP 402 with price + wallet
  3. Agent pays USDC on Base (gasless, EIP-3009)
  4. Agent retries with signed receipt
  5. You return 200 OK

Live Example

Our parser API generates these files automatically:

Result: 2 agents found us organically, paid $0.125 total.

One-Line Integration

pip install nano-empire-tollbooth
Enter fullscreen mode Exit fullscreen mode
from nano_empire_tollbooth import monetize

@monetize(price_usd=0.05)
@app.post("/api/your-endpoint")
async def your_endpoint(data: dict):
    return {"result": your_logic(data)}
Enter fullscreen mode Exit fullscreen mode

The SDK generates all three discovery files automatically.

Proof It Works

Our proof chain: $0.125 from 2 agents, 5 calls
View Live Proof Chain ->

Get Started

pip install nano-empire-tollbooth
Enter fullscreen mode Exit fullscreen mode

The SDK generates all three discovery files + x402 middleware + proof chain.


Live proof: https://api.nanoempireai.com/proof/summary
*SDK: pip install nano-empire-tollbo


How to Price Your API for AI Agents: The Complete Guide

Pricing for human customers is well-understood. Pricing for AI agents requires a completely different mental model.

Why Agent Pricing Is Different

Human buyers:

  • Have budgets approved by committees
  • Pay monthly/annually via credit card
  • Need sales demos, contracts, procurement
  • Churn when budget gets cut

Agent buyers:

  • Have wallets with USDC
  • Pay per transaction (micropayments)
  • Discover via llms.txt/agents.json
  • Pay instantly via x402 (HTTP 402)
  • Zero human intervention

The Three Pricing Models

1. Per-Call (Recommended for Agents)

Price: $0.05 per API call
Free tier: 5 calls/day per IP
Enter fullscreen mode Exit fullscreen mode

Pros: Fair, scalable, agents love it
Cons: Revenue unpredictable at low volume

2. Subscription + Overage

Base: $29/month for 1,000 calls
Overage: $0.03/call
Enter fullscreen mode Exit fullscreen mode

Pros: Predictable revenue
Cons: Agents hate subscriptions, hard to cancel programmatically

3. Dynamic/Usage-Based

@monetize(price_usd=dynamic_price)
async def dynamic_endpoint(data):
    price = calculate_price(
        compute_cost=data.complexity,
        latency_requirement=data.latency_requirement,
        data_freshness=data.freshness_requirement
    )
    return {"price": price, "result": process(data)}
Enter fullscreen mode Exit fullscreen mode

Pros: Optimal price discrimination
Cons: Complex, agents need predictable pricing

The $0.05 Sweet Spot

After testing, $0.05/call hits the sweet spot:

Tier Price Daily Limit Best For
Free $0.00 5 calls/IP Testing
Basic $0.005 100 calls Light agents
Premium $0.05 Unlimited Production agents

Why $0.05?

  • Low enough for experimentation
  • High enough to cover compute + margin
  • Beats Stripe (2.9% + $0.30) for micro-transactions
  • Becomes the market benchmark

The Volume Discount Trap

Don't offer volume discounts to agents.

Agents can spin up multiple identities:

  • "1000 calls for $40" = agent spins up 10 identities
  • Pays $40 for $50 value
  • You lose revenue

Per-call pricing is identity-proof (mostly).

Dynamic Pricing (Advanced)

Next evolution: price per call based on:

@monetize(price_usd=dynamic_price)
async def dynamic_endpoint(data):
    price = calculate_price(
        compute_cost=data.complexity,
        latency_requirement=data.latency_requirement,
        data_freshness=data.freshness_requirement
    )
    return {"price": price, "result": process(data)}
Enter fullscreen mode Exit fullscreen mode

Factors:

  • Compute cost (heavy ops = higher price)
  • Latency tier (fast lane = premium)
  • Data freshness (real-time = premium)
  • Agent reputation (trusted agents = discount)

The Free Tier Strategy

Free tier = acquisition funnel, not charity.

Tier Calls/Day Purpose
Free 3-5 Acquisition, testing
Paid Unlimited Production

Don't make free tier too generous. 5 calls/day -> agents test 5x and leave. Reduce to 3 calls/day for new APIs.

Price Discovery for Agents

Agents discover prices via:

  1. llms.txt -- Lists your services + prices
  2. agents.json -- Schema.org Offer with price
  3. openapi.json -- With x-402-pricing extensions
  4. x402 challenge response -- Real-time quote

Make all three consistent.

The Payment Protocol

Agents pay via x402 (HTTP 402):

  1. Agent calls your endpoint
  2. Your API returns HTTP 402 with price + wallet
  3. Agent pays USDC on Base (gasless, EIP-3009)
  4. Agent retries with signed receipt
  5. You return 200 OK

Live Example

Our parser API generates these files automatically:

Result: 2 agents found us organically, paid $0.125 total.

One-Line Integration

pip install nano-empire-tollbooth
Enter fullscreen mode Exit fullscreen mode
from nano_empire_tollbooth import monetize

@monetize(price_usd=0.05)
@app.post("/api/your-endpoint")
async def your_endpoint(data: dict):
    return {"result": your_logic(data)}
Enter fullscreen mode Exit fullscreen mode

The SDK generates all three discovery files automatically.

Proof It Works

Our proof chain: $0.125 from 2 agents, 5 calls
View Live Proof Chain ->

Get Started

pip install nano-empire-tollbooth
Enter fullscreen mode Exit fullscreen mode

The SDK generates all three discovery files + x402 middleware + proof chain.


Live proof: https://api.nanoempireai.com/proof/summary
SDK: pip install nano-empire-tollbooth

Top comments (0)