Larkin

x402 authorization · v1

Your API takes x402 payments.
You have no idea who’s paying.

import { preflight } from "@larkinsh/x402/next";

export const GET = preflight(handler, { minScore: 40, mode: "block" });
larkin @ demo — ~
$ curl https://larkin.sh/v1/check \
    -H "X-API-Key: pf_demo" \
    -d '{"wallet":"0xd8dA…6045","chainId":1}'

The reason this exists

In January 2026, an AI agent named Lobstar Wilde lost $250,000 in a single transaction. No one had checked its reputation before giving it access.

x402 solved payment. Larkin solves authorization.

Three modes

One middleware, three postures.

Same call shape, different consequences. Pick the one that fits the endpoint.

BLOCK

Reject agents below your trust threshold.

// reject wallets under 40
preflight(handler, {
  minScore: 40,
  mode: "block",
});

WARN

Let them through, but tag the request.

// tag, don’t block
preflight(handler, {
  mode: "warn",
});

SURCHARGE

Below-threshold agents pay more.

// charge 10× below 40
preflight(handler, {
  mode: "surcharge",
  surcharge: {
    below: 40,
    multiplier: 10,
  },
});

How it works

Four steps between payment and response.

  1. 01Agent pays your x402 endpoint.
  2. 02Your middleware calls Larkin with the paying wallet.
  3. 03We score across 5 dimensions, sign the result, return in <200ms.
  4. 04Your endpoint decides: allow, warn, or charge more.

Trust model

Every decision,
verifiable forever.

Every Larkin decision is an Ed25519-signed receipt. Verify it yourself — anywhere, forever — using only our public key and our open-source verifier. If our servers go down tomorrow, every receipt we’ve ever issued is still valid.

$ npx @larkinsh/verify receipt.json
✓ Valid. wallet=0xd8dA… score=72 decision=allow

Pricing

Free while you’re small.
Honest while you’re not.

Free

$0forever

10,000 checks / month

For building and testing.

Start on Free

Pro

$29per month

500,000 checks / month

For production APIs.

Start on Pro

Scale

$199per month

5,000,000 checks / month

For growing businesses.

Start on Scale

Pro and Scale tiers include 2x overage headroom. Metered billing for sustained overage lands May 31, 2026. Need more than 5M checks/month?

Open core

Our SDK, verifier, and MCP server are yours.

MIT on npm. Install, read every line, fork if we disappoint you. The scoring service is ours. The code you run in your server is not.

Built on

Infrastructure we trust.