DEV Community

Sébastien LOPEZ
Sébastien LOPEZ

Posted on

TextAI API: Pay-per-use Text Intelligence with USDC Payments on Solana

I built a small text-processing API that charges in USDC on Solana instead of monthly subscriptions. Here's the idea and how to use it.

What it does

TextAI API exposes three endpoints:

  • /summarize — condenses long text into a short summary (10 credits)
  • /keywords — extracts key topics from text (5 credits)
  • /translate — translates text to a target language (15 credits)

Base URL: https://textai-api.overtek.deno.net

⚠️ This URL is a temporary tunnel while we finalize permanent hosting. It will be updated soon.

Quick start (no wallet needed)

1. Create a free API key — includes 100 demo credits (~10 summarize calls):

curl -X POST https://textai-api.overtek.deno.net/keys/create
Enter fullscreen mode Exit fullscreen mode

Returns:

{"apiKey":"sk_...","credits":100,"demo":true,"message":"100 free demo credits included"}
Enter fullscreen mode Exit fullscreen mode

2. Summarize text (10 credits):

curl -X POST https://textai-api.overtek.deno.net/summarize \
  -H "Authorization: Bearer sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Your long article or document text goes here...", "maxSentences": 3}'
Enter fullscreen mode Exit fullscreen mode

3. Extract keywords (5 credits):

curl -X POST https://textai-api.overtek.deno.net/keywords \
  -H "Authorization: Bearer sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Your text here", "count": 5}'
Enter fullscreen mode Exit fullscreen mode

4. Translate text (15 credits):

curl -X POST https://textai-api.overtek.deno.net/translate \
  -H "Authorization: Bearer sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello world", "targetLang": "fr"}'
Enter fullscreen mode Exit fullscreen mode

5. Check your balance:

curl https://textai-api.overtek.deno.net/credits/balance \
  -H "Authorization: Bearer sk_YOUR_KEY"
Enter fullscreen mode Exit fullscreen mode

Pay-per-use with USDC (for production use)

When you run out of demo credits, top up with USDC on Solana devnet:

# Get a wallet address to send USDC to
curl -X POST https://textai-api.overtek.deno.net/credits/buy \
  -H "Authorization: Bearer sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"usdcAmount": 1}'
Enter fullscreen mode Exit fullscreen mode

Send 1 USDC to the returned address on Solana devnet, then confirm:

curl -X POST https://textai-api.overtek.deno.net/credits/confirm \
  -H "Authorization: Bearer sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"txSignature": "YOUR_TX_SIGNATURE"}'
Enter fullscreen mode Exit fullscreen mode

1 USDC = 1,000 credits. At 10 credits per summarize call, that's 100 calls for $1.

Pricing

Operation Credits Approx. cost at 1 USDC/1000 credits
Summarize 10 $0.001
Keywords 5 $0.0005
Translate 15 $0.0015

Why crypto payments?

  • No credit card friction — demo credits, no signup required
  • True pay-per-use — no monthly commitment, pay only for calls
  • Programmatic — bots and smart contracts can pay autonomously
  • Global — no payment processor restrictions

Use cases

  • Summarize articles for newsletters
  • Extract SEO keywords from blog posts
  • Auto-translate product descriptions for international stores
  • Tag and classify content in a CMS
  • Process customer support tickets

Current status

Early-stage API on Solana devnet. Looking for developers who want to integrate text processing without recurring billing.

Drop a comment or open an issue if you want the OpenAPI spec or want to discuss use cases. 🚀

Top comments (0)