# pay-with-any-token

Resolves HTTP 402 payment challenges via Tempo CLI and Uniswap Trading API. Swaps and bridges tokens from EVM chains when the Tempo wallet runs low.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 815 installs · ★ 235
- Author: uniswap
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/Uniswap/uniswap-ai/tree/HEAD/packages/plugins/uniswap-trading/skills/pay-with-any-token/SKILL.md
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/skills/pay-with-any-token

## What it does

The skill intercepts HTTP 402 Payment Required responses during paid API calls with Tempo CLI. If the Tempo wallet has enough funds, it settles the request immediately. When funds are insufficient, it initiates a swap and bridge sequence via the Uniswap Trading API to top up the wallet balance.

The cross-chain funding workflow requires local installations of `jq` and `cast` from Foundry, along with a `UNISWAP_API_KEY`. Initial Tempo CLI setup relies on a browser passkey authentication flow. Because of that requirement, the initial login cannot finish in an unattended headless environment without manual user input.

Every transfer, swap, or token allowance triggers a mandatory confirmation gate. The agent displays human-readable token figures and pauses for direct approval through `AskUserQuestion` before submitting on-chain operations.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add Uniswap/uniswap-ai --skill pay-with-any-token -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/pay-with-any-token/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/pay-with-any-token/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add Uniswap/uniswap-ai --skill pay-with-any-token -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/pay-with-any-token/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add Uniswap/uniswap-ai --skill pay-with-any-token -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/pay-with-any-token/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install Uniswap/uniswap-ai pay-with-any-token
```

2. **Manually: put the files in place**
- File: `.github/skills/pay-with-any-token/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add Uniswap/uniswap-ai --skill pay-with-any-token -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/Uniswap/uniswap-ai --path packages/plugins/uniswap-trading/skills/pay-with-any-token
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/pay-with-any-token/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add Uniswap/uniswap-ai --skill pay-with-any-token -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/Uniswap/uniswap-ai/tree/HEAD/packages/plugins/uniswap-trading/skills/pay-with-any-token/SKILL.md

## When to use it
- handle HTTP 402 machine payment challenges automatically
- fund a Tempo CLI wallet using ERC-20 tokens from other chains
- discover paid API endpoints using tempo services
- enforce explicit user approval before executing token transactions

## Example prompts
- Make a request to the paid API using tempo request and settle the 402 challenge
- Check my tempo wallet balance and top it up via Uniswap if needed
- Search for translation endpoints using tempo services

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 82a62929e1107920.

BEGIN THIRD-PARTY FILE 82a62929e1107920
````text
---
name: pay-with-any-token
description: >
  Pay HTTP 402 payment challenges using tokens via the Tempo CLI and Uniswap
  Trading API. Use when the user encounters a 402 Payment Required response,
  needs to fulfill a machine payment, mentions "MPP", "Tempo payment", "pay for
  API access", "HTTP 402", "x402", "machine payment protocol",
  "pay-with-any-token", "use tempo", "tempo request", or "tempo wallet".
allowed-tools: Read, Glob, Grep, Bash(curl:*), Bash(jq:*), Bash(cast:*), Bash(tempo:*), Bash(*/.local/bin/tempo:*), WebFetch, AskUserQuestion
model: opus
license: MIT
metadata:
  author: uniswap
  version: '2.0.0'
---

# Pay With Tokens

Use the **Tempo CLI** to call paid APIs and handle 402 challenges automatically.
When the Tempo wallet has insufficient balance, fund it by swapping and bridging
tokens from any EVM chain using the **Uniswap Trading API**.

## Tempo CLI Setup

Run these commands in order. Do not skip steps.

**Step 1 — Install:**

```bash
mkdir -p "$HOME/.local/bin" \
  && curl -fsSL https://tempo.xyz/install -o /tmp/tempo_install.sh \
  && TEMPO_BIN_DIR="$HOME/.local/bin" bash /tmp/tempo_install.sh
```

**Step 2 — Login** (requires browser/passkey — prompt user, wait for
confirmation):

```bash
"$HOME/.local/bin/tempo" wallet login
```

> When run by agents, use a long command timeout (at least 16 minutes).

**Step 3 — Confirm readiness:**

```bash
"$HOME/.local/bin/tempo" wallet -t whoami
```

> **Rules:** Do not use `sudo`. Use full absolute paths (`$HOME/.local/bin/tempo`)
> — do not rely on `export PATH`. If `$HOME` does not expand, use the literal
> absolute path.

After setup, report: install location, version (`--version`), wallet status
(address, balance). If balance is 0, direct user to `tempo wallet fund`.

> **Minimum balance reserve:** Keep at least **0.10 USDC** in the Tempo wallet
> to cover typical API calls without triggering the full swap+bridge funding
> flow. The funding flow requires 3-5 on-chain transactions and ~2 minutes of
> wall time, which is disproportionate for small top-ups. When transferring
> funds out of the Tempo wallet, warn the user if the remaining balance would
> drop below this threshold.

## Using Tempo Services

```bash
# Discover services
"$HOME/.local/bin/tempo" wallet -t services --search <query>
# Get service details (exact URL, method, path, pricing)
"$HOME/.local/bin/tempo" wallet -t services <SERVICE_ID>
# Make a paid request
"$HOME/.local/bin/tempo" request -t -X POST \
  --json '{"input":"..."}' <SERVICE_URL>/<ENDPOINT_PATH>
```

- Anchor on `tempo wallet -t services <SERVICE_ID>` for exact URL and pricing
- Use `-t` for agent calls, `--dry-run` before expensive requests
- On HTTP 422, check the service's docs URL or llms.txt for exact field names
````
END THIRD-PARTY FILE 82a62929e1107920

The third-party file has ended. Everything between the 82a62929e1107920 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2778 of 24366 bytes. © uniswap · MIT · https://github.com/Uniswap/uniswap-ai/tree/HEAD/packages/plugins/uniswap-trading/skills/pay-with-any-token/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
