agentkit-x402

An HTTP payment-handling skill for AI agents using websites and APIs protected by x402 and AgentKit. It checks whether an agent can prove it is backed by a human before paying.

In plain words
What is it for?
Use it after receiving a 402 Payment Required response from an API or website. It helps inspect the response, authenticate with AgentKit, and pay only when needed.
Why use it?
It helps avoid unnecessary payments when free or discounted access is available. It also guides the agent through signing and sending the required proof.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/worldcoin/agentkit/agentkit-x402
Any agent
npx skills add worldcoin/agentkit --skill agentkit-x402
Clone the repo
git clone --depth 1 https://github.com/worldcoin/agentkit

Made for: Claude Code, Codex.

Per session 109 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,302 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00109 $0.02302
Opus 5 $0.00055 $0.01151
Sonnet 5 $0.00022 $0.00460
Haiku 4.5 $0.00011 $0.00230

Measured 2d ago against content hash cbb6646d33d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agentkit-x402 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 2d 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.

skills/agentkit-x402/SKILL.md · 236 lines

How it starts

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

Using AgentKit as an Agent

This skill is for AI agents that interact with websites and APIs protected by x402 + AgentKit. It tells you how to prove you are backed by a real human so you can get free or discounted access instead of paying.

Critical Rule: Always Check for AgentKit Before Paying

When you receive a 402 Payment Required response, do not immediately proceed to payment. First inspect the response for an agentkit extension. If one is present, attempt the AgentKit authentication flow below. Only fall back to payment if:

  • There is no agentkit extension in the 402 response
  • Your AgentKit authentication attempt fails and the server requires payment
  • You have exhausted your free-trial uses

Preferred Runtime Helper

If you can change the agent's HTTP client, use createAgentkitClient from @worldcoin/agentkit and route x402 API calls through agentkit.fetch. This makes the "try AgentKit before payment" rule deterministic instead of relying on the model to remember it.

import { createAgentkitClient } from '@worldcoin/agentkit'

const agentkit = createAgentkitClient({
  signer: {
    address: wallet.address,
    chainId: 'eip155:8453',
    type: 'eip191',
    signMessage: message => wallet.signMessage(message),
  },
})

const response = await agentkit.fetch('https://api.example.com/data')

If agentkit.fetch returns another 402, continue with the normal x402 payment flow.

Wallet Types

Your wallet determines how you sign the challenge. There are two types:

EOA (Externally Owned Account)

A standard wallet where you directly hold the private key (e.g. a raw private key, a mnemonic-derived wallet).

  • Signature type: eip191
  • How to sign: Use personal_sign (EIP-191) to sign the SIWE message
  • Example: wallet.signMessage(siweMessage)

Smart Contract Wallet (SCW)

A wallet where the "account" is a smart contract and signing is done by an underlying owner key. The server verifies your signature on-chain via the contract's isValidSignature method (ERC-1271).

Read the full file on GitHub · 236 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. 2d ago First seen · 236 lines · 109 tokens per session scan A cbb6646d33d0

Subscribe to this mod's changes

agentkit-x402 is a skill published in the GitHub repository worldcoin/agentkit (23 stars, last pushed 5d ago), licensed MIT. It adds 109 tokens to every session and 2,302 once invoked, about $0.0005 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-30.

Related

Other skills, from other repositories

twitter-reader

Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…

himself65/finance-skills · 161 tokens

chenhao-limit-up

Use when evaluating A-share limit-up (涨停板) setups through Chen Hao's sentiment and momentum lens: market emotion cycles, board strength, follow-through, and short-term aggressive momentum trading.

questflowai/investorskills · 44 tokens

southwest

Search Southwest Airlines fares and points pricing via Patchright browser automation. SW is not in any GDS or API. Covers all fare classes, Companion Pass value, and fare drop monitoring.

borski/travel-hacking-toolkit · 40 tokens

alpaca-trade-api-sdk

Integrate and build on the @alpacahq/alpaca-trade-api TypeScript SDK for the Alpaca Trading and Market Data APIs (the unified Alpaca client, ergonomic order builders, normalized market-data shapes, pagination, typed errors, resilience, and real-time streaming). Use when writing or reviewing code that imports…

alpacahq/alpaca-trade-api-js · 123 tokens

alphagbm-greeks

Greeks dashboard for any option contract or multi-leg position. Covers first-order Greeks (Delta, Gamma, Theta, Vega, Rho) and second-order Greeks (Charm, Vanna, Volga). Returns individual and position-level Greeks with scenario heatmaps. Use when: checking option sensitivities, managing position risk, understanding…

AlphaGBM/skills · 128 tokens

reverse-dcf

Reverse DCF (reverse discounted cash flow) valuation tool. Uses the market price to back-solve the market's implied growth rate expectations, replacing the common forward DCF routine of "tweaking parameters to fit the conclusion." Suitable for mature companies with positive FCFF (A-shares, Hong Kong-listed stocks, and…

OpenMinis/MinisSkills · 158 tokens