Urgent.News

650+ sources. One page. See who else covered it.

Editions

Tech

Paywall Any API Endpoint With Two Prices: Sats or Compute

You built an API. It works. Then the scrapers show up. Not paying customers. Bots hammering your endpoint a thousand times a minute, running up your compute bill, and giving you nothing back. The usual fix is API keys, a signup flow, a Stripe integration, a dashboard, and a support inbox for people who lost their key. That is a lot of plumbing to answer one question: did this caller give up…

Pay-to-Compute API Endpoint: Two Pricing Options for Protection Against Scrapers

API creators often face the challenge of unwanted scraping and bot traffic, leading to high compute costs and no return for their services. Traditional solutions involve setting up API keys, a signup flow, and a support system. However, this approach requires significant effort and can be cumbersome for users.

A simpler alternative is to implement a pay-to-compute model, where every API request incurs a cost. Callers can either pay a small amount in satoshis (sats) via a Lightning invoice or solve a compute-intensive proof-of-work puzzle. This model eliminates the need for accounts, keys, or dashboards, as the payment itself serves as authorization.

The gate.powforge.dev server demonstrates this two-price idea. Callers can choose either path to access the gated response. The compute path requires solving a SHA-256 partial collision, with difficulty adjustable based on server resources. The solution cost for the caller is the electricity consumed and the time spent solving the puzzle. The sats path involves settling a Lightning invoice for a fixed amount (10 sats, which amounts to a tenth of a cent).

Both payment methods grant the same access to the gated response, ensuring that no free-riding occurs. The server-side verification process is straightforward and requires minimal resources. It simply checks the provided proof-of-work solution against the predefined difficulty.

The pay-to-compute API offers a straightforward solution to protect against scrapers and bots without the need for complex authentication systems. The server-side verification is minimal, while the cost of compute or sats falls on the caller, making it an effective and lightweight protective measure for API providers.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Bloom Filters

One-liner: A probabilistic data structure that tells you if an element is definitely not in a set, or possibly in a set — using very little memory.

  • Bloom filters quickly tell if something is definitely not in a set or maybe it is.
  • They use a big array of bits and hash functions to add and check items.
  • Bloom filters save massive memory but can give false positives.

Your Browser Automation Clicks Might Be Landing 25% Off — And Nothing Will Tell You

I spent a day pointing an AI agent at a browser to publish one product across four marketplaces. Most of it worked. The parts that didn't work failed in the worst possible way: silently , with no…

  • Browser automation clicks fail silently, no error messages
  • Coordinate systems differ between automation tool and page
  • Scaling factor of 0.7484 corrects click landing issues

X Open Sources Its Ranking and Filtering Algorithms

An anonymous reader shared this report from TechCrunch: X is significantly expanding its open source codebase, which includes the app's "For You" algorithm and its core ranking engine, and adding a…

  • X open sources core ranking and filtering algorithms on GitHub
  • For You timeline algorithm and ranking model parameters released
  • Transparency tool lets users download aggregate stats as JSON

How I Cut MCP Token Usage by 91% (and Learned a Humbling Lesson About Tokenizers)

The Problem When you add MCP servers to your AI coding agent, each one dumps its full JSON schema into context. 255 tools across all servers = 39,964 tokens.

  • MCP servers consume large token space by adding full JSON schema to context
  • Mcptoon compresses JSON schema by 91%, reducing 39,964 tokens to 3,511
  • Mcptoon returns results in human-readable TOON format, saving even more tokens

More from Sunday 16 August →