x402-client

x402-client is a skill for Claude Code, Codex from Dexter-DAO/opendexter-ide. It costs 60 tokens per session (1,760 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 Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

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: Claude Code, Codex.

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,760 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.01760
Opus 5 $0.00030 $0.00880
Sonnet 5 $0.00012 $0.00352
Haiku 4.5 $0.00006 $0.00176

Measured 10d ago against content hash 4363b0ec3e67, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 10d 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. 10d 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 5d ago), licensed MIT. It adds 60 tokens to every session and 1,760 once invoked, about $0.0003 per session on Opus 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

defi-protocol-templates

Implement DeFi protocols with production-ready templates for staking, AMMs, governance, and flash loans. Use when building decentralized finance applications or smart contract protocols.

wshobson/agents · 38 tokens

sera

Multi-currency settlement skill — quote, swap, and settle across 40 stablecoins via Sera Protocol.

sera-cx/sera-agents · 24 tokens

sera

Multi-currency settlement for AI agents. Quote, swap, and settle across 40 stablecoins (USDC, USDT, EURC, XSGD, JPYC, MYRT, TGBP, BRZ, MXNT, IDRT, AUDD, and more) and 22 fiat currencies via Sera Protocol. 55 tools — quotes, swaps, treasury management, FX deal scanning, and a maker spread ladder.

sera-cx/sera-agents · 90 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

sera-protocol

Build, review, or explain integrations with Sera Protocol for stablecoin FX, multi-currency settlement, Sera MCP, Sera Agents, or x402. Use for quotes, corridors, settlement workflows, agent integrations, and Sera Protocol API or contract questions.

sera-cx/sera-agents · 58 tokens

gentech-x402-services

GenTech Labs paid API gateway — 7 x402 pay-per-call services on Base USDC: token security, market data, agent discovery, DeFi LP analytics, wallet analysis, NFT search. Use when an agent needs token risk scoring, token prices, onchain agent discovery, LP/pool analytics, wallet portfolio data, or NFT collection search…

Gentech-Labs/genTech-agent-kit · 99 tokens