x402-server

x402-server is a skill for Cursor from Dexter-DAO/opendexter-ide. It costs 66 tokens per session (3,062 once invoked), scanned A, original, MIT.

A server library for adding x402 payment checks to API endpoints. It can require a payment before an endpoint's handler runs and supports crypto or Stripe settlement options.

In plain words
What is it for?
Use it to protect Express routes, set prices, choose recipient addresses or payment providers, accept supported blockchain networks, and configure sponsored or access-pass requests.
Why use it?
It removes the need to build payment verification and settlement logic around each paid API route.

Skill for Cursor

Written for Cursor: shipped in a Cursor plugin. Also seen: positional $N argument.

Part of the opendexter plugin — 5 skills, 3 commands, 1 agent shipped together

Good fit Use it to protect Express routes, set prices, choose recipient addresses or payment providers, accept supported blockchain networks, and configure sponsored or access-pass requests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dexter-dao/opendexter-ide/x402-server
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Dexter-DAO/opendexter-ide --skill x402-server
Clone the repo
git clone --depth 1 https://github.com/Dexter-DAO/opendexter-ide

Made for: Cursor.

Or install opendexter, the plugin that ships this one along with the rest of its 5 skills, 3 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for x402-server

README.md
[![agentmods](https://agentmods.dev/badge/skills/dexter-dao/opendexter-ide/x402-server/github.svg)](https://agentmods.dev/skills/dexter-dao/opendexter-ide/x402-server)
Your own site
<a href="https://agentmods.dev/skills/dexter-dao/opendexter-ide/x402-server"><img src="https://agentmods.dev/badge/skills/dexter-dao/opendexter-ide/x402-server/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for x402-server

Your own site · 80×15
<a href="https://agentmods.dev/skills/dexter-dao/opendexter-ide/x402-server"><img src="https://agentmods.dev/badge/skills/dexter-dao/opendexter-ide/x402-server.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,062 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00066 $0.03062
Opus 5.5 $0.00026 $0.01225
Sonnet 5.5 $0.00013 $0.00612
Haiku 4.5 $0.00007 $0.00306

Measured 26d ago against content hash 3301104e5e86, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

x402-server scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 26d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/mcp/skills/x402-server/SKILL.md · 333 lines

How it starts

The opening of the file, as written. The whole thing — 333 lines — stays where its author put it; the contents beside it link to each section on GitHub.

@dexterai/x402 Server SDK

Protect any API endpoint with x402 payments. One-liner Express middleware or manual verify/settle control.

npm install @dexterai/x402

One line to paywall any endpoint:

import express from 'express';
import { x402Middleware } from '@dexterai/x402/server';

const app = express();

app.get('/api/data',
  x402Middleware({
    payTo: 'YourSolanaAddress...',
    amount: '0.01', // $0.01 USD per request
  }),
  (req, res) => {
    // Only runs after successful payment
    res.json({ data: 'premium content', payer: req.x402?.payer });
  }
);

Multi-chain accept

Accept payments on multiple chains simultaneously:

app.get('/api/data',
  x402Middleware({
    payTo: {
      'solana:*': 'SolanaAddress...',
      'eip155:*': '0xEvmAddress...',
    },
    amount: '0.05',
    network: ['eip155:8453', 'eip155:137', 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp'],
  }),
  handler
);

Full X402MiddlewareConfig

Option Type Default Description
payTo string / PayToProvider / Record required Recipient address, Stripe provider, or per-network map
amount string required USD amount (e.g., "0.01" for 1 cent)
network string / string[] Solana mainnet CAIP-2 network(s) to accept payments on
asset { address, decimals } USDC Token to accept
facilitatorUrl string https://x402.dexter.cash Facilitator for verify/settle
description string Human-readable resource description
resourceUrl string request URL Override resource URL
mimeType string Response MIME type
timeoutSeconds number 120 Payment timeout
verbose boolean false Debug logging
getAmount (req) => string Dynamic amount per request
getDescription (req) => string Dynamic description per request
getResourceUrl (req) => string Dynamic resource URL per request
sponsoredAccess boolean / object false Enable ad injection into response body
onSettlement (info) => void Called after successful settlement
onVerifyFailed (info) => void Called when verification fails

Read the full file on GitHub · 333 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 26d ago Changed 3301104e5e86
  2. 1mo ago Changed 0c60c8c81759
  3. 1mo ago Changed bf22709f430e
  4. 1mo ago First seen · 333 lines · 66 tokens per session scan A 27704fdd2549

Subscribe to this mod's changes

x402-server is a skill published in the GitHub repository Dexter-DAO/opendexter-ide (2 stars, last pushed today), licensed MIT. It adds 66 tokens to every session and 3,062 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

helius

Skill "helius" from helius-labs/core-ai, covering helius — build on solana, prerequisites, 1. helius mcp server, 2. mcp router surface and 3. api key.

helius-labs/core-ai · 0 tokens

vybe-api-explorer

Explore and call the Vybe Solana API catalog through MCP — discover endpoints, inspect OpenAPI params, then run authenticated live requests. Use when the user wants to browse APIs, find a specific route, understand parameters, or execute a Vybe HTTP call.

vybenetwork/solana-mcp-vybe · 58 tokens

x402

HTTP 402 payment protocol for AI agent commerce — three-actor model (Client, Resource Server, Facilitator), ERC-3009 transferWithAuthorization, server middleware (@x402/express), client patterns in TypeScript and Python, facilitator integration, agent-to-agent payments, pricing strategies, and replay protection. Works…

aomi-labs/skills · 84 tokens

aomi-build

Scaffold new Aomi apps and plugins from API docs, OpenAPI/Swagger specs, or SDK references. aomi-build generates production-ready Rust SDK crates (lib.rs, client.rs, tool.rs) with tool schemas, preambles, host-interop flows, and validation — turning a vendor's API surface into AI-agent-callable tools. It covers the…

aomi-labs/skills · 244 tokens

trustlayer-sybil-scanner

Feedback forensics for ERC-8004 agents. Detects Sybil rings, fake reviews, rating manipulation, and reputation laundering across 20 chains. No API key needed.

BankrBot/skills · 43 tokens

powabase

Use for ANY task building on Powabase, the multi-tenant AI Backend-as-a-Service (projects on .p.powabase.ai, the /api/ surface). Triggers: RAG & knowledge bases (Sources, document upload/extraction, indexing strategies chunkembed/fulldocument/pageindex/graphindex/doc2json, retrieval vector/full-text/hybrid/tree…

powabase-ai/agent-skills · 210 tokens