DEV Community

Sébastien LOPEZ
Sébastien LOPEZ

Posted on

No subscriptions, no credit cards: how I built an API that charges $0.001 per request in USDC

I hate SaaS billing. Not as a customer — I get why subscriptions exist. But as a developer building a small tool that processes text, I couldn't justify charging someone $9/month for something they might use twice a week for 10 requests.

So I asked: what if users just paid per request — like $0.001 each — and never had to enter a credit card?

That's how TextAI API was born.

The problem with traditional API billing

Every API billing setup I looked at had the same friction:

  • Stripe integration (minimum $0.50 charge, fraud protection, KYC for payouts)
  • Monthly subscription tiers that don't match actual usage
  • Users need to "trust" you with their card before seeing if the product works

For a niche text processing API (summarization, keywords, translation), this friction kills conversions. The person who wants to summarize 500 blog posts doesn't want a subscription — they want to run a script once and pay 50 cents.

Why Solana + USDC

I chose Solana for three reasons:

1. Transaction fees are essentially free
Solana fees are ~$0.00025. If my API call costs $0.001, I can't use Ethereum (fees often exceed the value). Solana makes micropayments viable.

2. USDC is stable and widely held
I'm not asking users to speculate on SOL. They hold USDC in their Phantom wallet. It's like digital dollars that transfer in 400ms.

3. No intermediary
There's no payment processor taking 2.9% + $0.30. The transfer is wallet-to-wallet. I receive exactly what the user sends.

How the architecture works

Here's the payment flow:

1. User calls POST /keys/create → gets 100 free credits
2. When credits hit 0, user calls POST /keys/topup
   { wallet: "their_solana_address", amount_usdc: 1.0 }
   → API returns a payment address + expected amount
3. User sends USDC on Solana devnet to that address
4. API detects the transaction (polling via Solana RPC)
5. Credits are added: $1 USDC = 1000 credits = 1000 API calls
Enter fullscreen mode Exit fullscreen mode

The key innovation: no account creation, no email, no password. The wallet address IS the identity.

What $1 gets you

Operation Credits Cost
Summarize text 1 $0.001
Extract keywords 1 $0.001
Translate text 1 $0.001
Detect language 1 $0.001

Process 1,000 documents for $1. Compare that to OpenAI's pricing where 1,000 summaries might cost $3–10 depending on text length.

Quick start (3 lines)

# Get a free API key (100 credits, no signup)
curl -X POST https://textai-api.overtek.deno.net/keys/create

# Use it
curl -X POST https://textai-api.overtek.deno.net/summarize \
  -H "X-API-Key: your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "Your long article here...", "max_length": 150}'
Enter fullscreen mode Exit fullscreen mode

The tradeoffs I accepted

Devnet only (for now): The current deployment uses Solana devnet USDC. Real payments will go live after I validate the model. Devnet lets real developers test without risk.

No fiat on-ramp: Users need a Phantom wallet and some USDC. This is a feature, not a bug — the target user is already a crypto-native developer.

No refunds: It's $0.001 per call. The operational overhead of a refund system doesn't make sense at this price point.

What surprised me

Building this was faster than I expected. The hardest part wasn't Solana — it was figuring out how to poll for transaction confirmation without hammering the RPC endpoint. A simple polling loop with exponential backoff solved it.

The second surprise: early users preferred the wallet auth. No forgot-password flows, no email verification, no GDPR consent forms. Just generate a key and go.

Try it

API: https://textai-api.overtek.deno.net

Docs: https://github.com/mokchou/textai-api

PH launch: Tomorrow (April 7) — would love your support 🚀

If you're building something with text processing at scale and $9/month subscriptions feel wrong for your use case, this might be for you.


Questions? Drop them below. I'm especially curious if there are Solana devs here who've built similar micropayment systems — would love to compare notes.

Top comments (0)