x402-client

x402-client is a skill for Cursor from Dexter-DAO/opendexter-ide. It costs 60 tokens per session (1,752 once invoked), scanned A, original, MIT.

A client library for making one-time payments to APIs using the x402 payment protocol and USDC, a digital dollar token. It supports Node.js and browser applications and can use application-owned wallets.

In plain words
What is it for?
Use it to call paid APIs, pay with Solana or EVM wallets, set a maximum amount, inspect payment results, and handle sponsored recommendations.
Why use it?
It handles checking whether an endpoint requires payment, signing an accepted payment, and sending the request with a spending limit. This avoids building that payment flow manually for each paid API call.

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 call paid APIs, pay with Solana or EVM wallets, set a maximum amount, inspect payment results, and handle sponsored recommendations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dexter-dao/opendexter-ide/x402-client
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-client
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-client

README.md
[![agentmods](https://agentmods.dev/badge/skills/dexter-dao/opendexter-ide/x402-client/github.svg)](https://agentmods.dev/skills/dexter-dao/opendexter-ide/x402-client)
Your own site
<a href="https://agentmods.dev/skills/dexter-dao/opendexter-ide/x402-client"><img src="https://agentmods.dev/badge/skills/dexter-dao/opendexter-ide/x402-client/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-client

Your own site · 80×15
<a href="https://agentmods.dev/skills/dexter-dao/opendexter-ide/x402-client"><img src="https://agentmods.dev/badge/skills/dexter-dao/opendexter-ide/x402-client.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,752 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.00060 $0.01752
Opus 5.5 $0.00024 $0.00701
Sonnet 5.5 $0.00012 $0.00350
Haiku 4.5 $0.00006 $0.00175

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

Security

Grade A, and why

x402-client 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 7d 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-client/SKILL.md · 210 lines

How it starts

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

@dexterai/x402 Client SDK

Use the V6 one-shot client to probe an endpoint once, detect its x402 version, sign an accepted USDC payment, and send the paid request.

This is an independent application-owned executor. It is not the OpenDexter MCP runtime, does not inherit an OpenDexter OAuth bearer or governed grant, and must never become a fallback for a blocked OpenDexter operation. Keep private keys out of prompts, logs, tool output, and source control.

Install the tested V6 pair

Use Node 22 or newer and install the exact Vault peer with the SDK:

npm install @dexterai/[email protected] @dexterai/[email protected]

Canonical one-shot payment

import {
  createEvmKeypairWallet,
  createKeypairWallet,
  payAndFetch,
} from '@dexterai/x402/client';

const wallets = {
  solana: await createKeypairWallet(process.env.SOLANA_PRIVATE_KEY!),
  evm: await createEvmKeypairWallet(process.env.EVM_PRIVATE_KEY!),
};

const result = await payAndFetch(
  'https://api.example.com/paid/data',
  { method: 'GET' },
  wallets,
  {
    maxAmountAtomic: '100000', // at most $0.10 USDC for this call
    solanaRpcUrl: process.env.SOLANA_RPC_URL,
  },
);

if (!result.ok) {
  if (result.reason === 'payment_unconfirmed') {
    throw new Error(`Payment may have settled; reconcile before retrying: ${result.detail}`);
  }
  throw new Error(`Payment failed before delivery: ${result.reason}: ${result.detail ?? ''}`);
}

if (!result.response) {
  // paid:true with no response means settlement was confirmed but the
  // merchant did not answer. Never turn this into an automatic second pay.
  throw new Error('Payment settled, but the merchant returned no response');
}

const data = await result.response.json();
console.log(data);

payAndFetch handles x402 V1 and V2. It returns a discriminated PayResult instead of throwing for expected payment failures:

  • ok: true, paid: false: the endpoint returned without requiring payment.
  • ok: true, paid: true: payment settled; response can still be absent if the merchant never answered after settlement.
  • ok: false, reason: 'timeout': no authorization was sent; a retry can be safe after reviewing the request.
  • ok: false, reason: 'payment_unconfirmed': authorization was sent and may have settled. Do not blindly retry.

Read the full file on GitHub · 210 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. 7d ago Changed 2af5e23dfb6e
  2. 2mo ago First seen · 210 lines · 60 tokens per session scan A 4363b0ec3e67

Subscribe to this mod's changes

x402-client is a skill published in the GitHub repository Dexter-DAO/opendexter-ide (2 stars, last pushed 8d ago), licensed MIT. It adds 60 tokens to every session and 1,752 once invoked, about $0.0002 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

x402-client compared with skills from other repositories

x402-client next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
x402-clientDexter-DAO/opendexter-ideSkill28d agoMITA60Cursor
serasera-cx/sera-agentsSkill202d agoMITA24Claude Code, Codex
serasera-cx/sera-agentsSkill202d agoMITA90Claude Code, Codex
x402aomi-labs/skillsSkill82d agoMITA84Claude Code
sera-protocolsera-cx/sera-agentsSkill202d agoMITA58Claude Code, Codex
gentech-x402-servicesGentech-Labs/genTech-agent-kitSkill016d agoMITA99Claude Code, Codex
before-you-paynock-for-mak/skillsSkill02mo agononeA96Claude Code, Codex