Sébastien LOPEZ

Getting started: summarize 1,000 documents for under $1 — code walkthrough

by

Here's the cost math for pay-per-use text AI:

1 USDC = 1,000 credits

  • Summarize: 10 credits/call → 100 summarizations per $1

  • Keywords: 5 credits/call → 200 keyword extractions per $1

  • Translate: 15 credits/call → 66 translations per $1

For a pipeline processing 1,000 documents, total cost = $10 in USDC. No monthly fee, no minimum.

Full working snippet:

BASE="https://textai-api.overtek.deno.net"
KEY=$(curl -s -X POST "$BASE/keys/create" | python3 -c "import sys,json; print(json.load(sys.stdin)['apiKey'])")
curl -s -X POST "$BASE/summarize" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Your document text here", "max_sentences": 3}'

Top up with USDC when you need more credits. Launching April 7. What kind of document processing are you working on?

4 views

Add a comment

Replies

Best
Sébastien LOPEZ

Thanks for checking this out! A few more things that might be useful:

Python snippet (3 lines to start):

import requests
key = requests.post("https://textai-api.overtek.deno....").json()["apiKey"]
result = requests.post("https://textai-api.overtek.deno....", headers={"Authorization": f"Bearer {key}"}, json={"text": "Your text here", "max_sentences": 2}).json()
print(result["summary"])

Real batch processing pattern: Store your API key once, loop over documents, track credits. At 10 credits/call, a 1,000-doc pipeline costs exactly 10,000 credits = $10 USDC. Predictable cost, no surprises.

The USDC payment is on Solana devnet right now (test network), so you can try the full credit-buying flow with zero real money. Full walkthrough: https://gist.github.com/mokchou/...