# Pay with app

> Pay with app is an open-source agent skill for finance and payments. Pays OKX Agent Payments Protocol 402 challenges on X Layer, funding USDT0 via Uniswap. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/Uniswap/uniswap-ai/tree/main/packages/plugins/uniswap-trading/skills/pay-with-app
- **Repository:** https://github.com/uniswap/uniswap-ai
- **GitHub stars:** 236
- **License:** MIT
- **Skill name:** pay-with-app
- **Collection:** https://github.com/Uniswap/uniswap-ai
- **Categories:** [finance and payments](https://ai-powered.com/categories/finance-and-payments)
- **Listing updated:** 2026-12-02

## About

This skill handles HTTP 402 payment challenges from OKX's Agent Payments Protocol (APP) when the requested network is X Layer (chain 196). It walks the agent through parsing the challenge, checking the payer wallet's balance of the requested asset, and funding it through the Uniswap Trading API if it is short. It then signs an EIP-3009 TransferWithAuthorization and retries the original request with an X-PAYMENT header.

The skill enforces several gates: it refuses challenges that are not x402 version 1, use a scheme other than exact, or request a zero amount, and it requires a separate user confirmation before each transaction, including each swap, bridge and signature. Challenges on other chains are routed to the sibling pay-with-any-token skill.

It expects a PRIVATE_KEY environment variable, a Uniswap API key only when cross-chain funding is needed, jq, Foundry's cast, Node 18 or newer, and the viem library, which it offers to install into a cache directory after asking the user.

## When your agent uses it

> Pay HTTP 402 payment challenges issued by OKX's Agent Payments Protocol (APP) on X Layer using tokens from any chain via the Uniswap Trading API. Use this skill whenever the user encounters a 402 challenge whose network resolves to X Layer (chain 196), mentions "APP", "Agent Payments Protocol", "OKX agent payment", "OKX Onchain OS", "OKX agentic wallet", "x402 on X Layer", "USDT0", "x42", "Instant Payment", "Batch Payment", "pay for X Layer API", or wants to pay an OKX-backed merchant. Even when the user does not explicitly say APP, prefer this skill for any 402 challenge whose network resolves to X Layer (chain 196). For 402 challenges on other chains (Ethereum, Base, Arbitrum, Tempo) use pay-with-any-token instead.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/Uniswap/uniswap-ai/tree/HEAD/packages/plugins/uniswap-trading/skills/pay-with-app)
- [Asks for: Read, Glob, Grep, Bash(curl:*), Bash(jq:*), Bash(cast:*), Bash(openssl:*), Bash(npx:*)…](https://github.com/Uniswap/uniswap-ai/blob/HEAD/packages/plugins/uniswap-trading/skills/pay-with-app/SKILL.md)
- [License: MIT](https://github.com/Uniswap/uniswap-ai/tree/HEAD/packages/plugins/uniswap-trading/skills/pay-with-app)

## Features

- **402 challenge parsing:** Reads the x402 challenge fields and validates version, scheme, network and amount before any payment step.
- **X Layer network check:** Confirms the challenge resolves to chain 196 and hands other networks to the sibling skill.
- **Balance check and funding:** Compares the wallet's X Layer balance against the requested asset and routes funds via the Uniswap Trading API when short.
- **EIP-3009 signing:** Builds the typed-data authorization using the token's own EIP-712 domain values and signs it with viem.
- **Per-transaction confirmation gates:** Requires a separate explicit user approval before each approval, swap, bridge or signature step.
- **Supported asset guidance:** Documents USDT0, USDG and USDC on X Layer, including the caveat that USDC lacks reliable routing there.

## Good for

- Pay an OKX APP-backed API that returns a 402 on X Layer
- Top up USDT0 on X Layer from a same-chain swap before paying a merchant
- Check whether a 402 challenge is valid before signing anything
- Retry a paid request with a signed X-PAYMENT header

## Install

### Claude Code

This skill ships in the `uniswap-trading` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add Uniswap/uniswap-ai
/plugin install uniswap-trading@uniswap-ai
```

Or copy only this skill to `~/.claude/skills/pay-with-app`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/pay-with-app &&
cp -R "$tmp/packages/plugins/uniswap-trading/skills/pay-with-app" ~/.claude/skills/pay-with-app &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/pay-with-app` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/pay-with-app` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/pay-with-app &&
cp -R "$tmp/packages/plugins/uniswap-trading/skills/pay-with-app" ~/.agents/skills/pay-with-app &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/pay-with-app` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/pay-with-app` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/pay-with-app &&
cp -R "$tmp/packages/plugins/uniswap-trading/skills/pay-with-app" ~/.cursor/skills/pay-with-app &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/pay-with-app` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/Uniswap/uniswap-ai.git --path packages/plugins/uniswap-trading/skills/pay-with-app
```

Or copy the folder to `~/.gemini/skills/pay-with-app` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/pay-with-app`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/pay-with-app &&
cp -R "$tmp/packages/plugins/uniswap-trading/skills/pay-with-app" ~/.copilot/skills/pay-with-app &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/pay-with-app` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git
```

Then copy `uniswap-ai/packages/plugins/uniswap-trading/skills/pay-with-app` into your agent's skills folder as `pay-with-app`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

A PRIVATE_KEY environment variable, jq, Foundry's cast, Node 18 or newer and the viem package. A UNISWAP_API_KEY is needed only when the wallet must be funded through cross-chain routing.

### Which 402 challenges does Pay with app handle?

Only those whose network resolves to X Layer (chain 196) and whose scheme is exact in x402 version 1. Challenges on other chains should go to pay-with-any-token.

### Does Pay with app sign transactions without asking?

No. Each transaction, including approvals, swaps, bridges and the EIP-3009 signature, requires a separate confirmation from the user before it runs.

### Can Pay with app bridge funds from other chains to X Layer?

Not reliably in this version. The documentation says Across does not currently support X Layer as a destination, so the cross-chain step is expected to be done outside the skill by the user.

### How do I install Pay with app in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/pay-with-app to use it in all your projects, or to .claude/skills/pay-with-app in one project. Or install the uniswap-trading plugin, which includes it: /plugin marketplace add Uniswap/uniswap-ai, then /plugin install uniswap-trading@uniswap-ai.

### Does Pay with app run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Pay with app?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Pay with app?

The closest alternatives to Pay with app are Pay with any token, Agent payment x402, Pay via agent wallet, Accept agent payments and Use agent wallet.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Pay with any token](https://ai-powered.com/skills/pay-with-any-token): Pay with any token is an open-source agent skill for finance and payments.
- [Agent payment x402](https://ai-powered.com/skills/agent-payment-x402): Agent payment x402 is an open-source agent skill for finance and payments.
- [Pay via agent wallet](https://ai-powered.com/skills/pay-via-agent-wallet): Pay via agent wallet is an open-source agent skill for finance and payments.
- [Accept agent payments](https://ai-powered.com/skills/accept-agent-payments): Accept agent payments is an open-source agent skill for finance and payments.
- [Use agent wallet](https://ai-powered.com/skills/use-agent-wallet): Use agent wallet is an open-source agent skill for finance and payments.
- [Fund agent wallet](https://ai-powered.com/skills/fund-agent-wallet): Fund agent wallet is an open-source agent skill for finance and payments.
- [Use circle CLI](https://ai-powered.com/skills/use-circle-cli): Use circle CLI is an open-source agent skill for finance and payments.
- [Unify balance](https://ai-powered.com/skills/unify-balance): Unify balance is an open-source agent skill for finance and payments.

---
Source: https://ai-powered.com/skills/pay-with-app
