# Send Breeze x402 to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "breeze-x402-payment-api",
    "name": "Breeze x402",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/keeganthomp/breeze-x402-payment-api",
    "canonicalUrl": "https://clawhub.ai/keeganthomp/breeze-x402-payment-api",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/breeze-x402-payment-api",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=breeze-x402-payment-api",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/breeze-x402-payment-api"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/breeze-x402-payment-api",
    "downloadUrl": "https://openagent3.xyz/downloads/breeze-x402-payment-api",
    "agentUrl": "https://openagent3.xyz/skills/breeze-x402-payment-api/agent",
    "manifestUrl": "https://openagent3.xyz/skills/breeze-x402-payment-api/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/breeze-x402-payment-api/agent.md"
  }
}
```
## Documentation

### Breeze x402 Payment API

Interact with Breeze through its x402 payment-gated HTTP API. Each protected request pays a small USDC micropayment, then returns API data or an unsigned Solana transaction.

### Quick Start: Minimum Viable Flow

This is the fastest path from zero to a working deposit. Read this before anything else.

What you need:

A Solana wallet funded with USDC and ~0.01 SOL (for transaction fees)
Node.js installed

### Step 0: Generate a wallet (skip if you already have one)

Run once to create and save a keypair:

// generate-wallet.js
const { Keypair } = require('@solana/web3.js');
const fs = require('fs');

// Install first: npm install @solana/web3.js --legacy-peer-deps
const bs58Module = require('bs58');
const bs58 = bs58Module.default || bs58Module;

const keypair = Keypair.generate();
const secretKeyBase58 = bs58.encode(keypair.secretKey);

console.log('Public key (fund this address):', keypair.publicKey.toBase58());

// Save secret key to file — never print it to the console
fs.writeFileSync('wallet-backup.json', JSON.stringify(Array.from(keypair.secretKey)));
fs.writeFileSync('.env', \`WALLET_PRIVATE_KEY=${secretKeyBase58}\\n\`);
console.log('Saved .env with WALLET_PRIVATE_KEY and wallet-backup.json — keep both secret and out of git!');

node generate-wallet.js

Fund the printed public key with USDC and at least 0.01 SOL before continuing. The .env file now contains your WALLET_PRIVATE_KEY.

### Step 1: Preflight checks

Verify everything is reachable before writing code:

# x402 server health
curl https://x402.breeze.baby/healthz

# Breeze strategy info (no auth needed)
curl https://api.breeze.baby/strategy-info/43620ba3-354c-456b-aa3c-5bf7fa46a6d4

# Wallet USDC balance (replace YOUR_WALLET_ADDRESS)
curl https://api.mainnet-beta.solana.com \\
  -X POST -H "Content-Type: application/json" \\
  -d '{"jsonrpc":"2.0","id":1,"method":"getTokenAccountsByOwner","params":["YOUR_WALLET_ADDRESS",{"mint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"},{"encoding":"jsonParsed"}]}'

Expected: healthz returns {"status":"ok"}, strategy-info returns strategy data, token query shows your USDC balance. If any of these fail, fix the connectivity issue before proceeding.

### Step 2: Install

npm install @faremeter/fetch @faremeter/payment-solana @faremeter/wallet-solana @faremeter/info @solana/web3.js bs58 --legacy-peer-deps

--legacy-peer-deps is required for npm. Without it, @faremeter/* peer dependency conflicts cause npm to silently remove @solana/web3.js.

### Step 3: Run the deposit script

Save as deposit.js and run with node deposit.js:

// deposit.js — CommonJS, no TypeScript needed
'use strict';

const { wrap } = require('@faremeter/fetch');
const { createPaymentHandler } = require('@faremeter/payment-solana/exact');
const { createLocalWallet } = require('@faremeter/wallet-solana');
const { Connection, Keypair, PublicKey, VersionedTransaction, Transaction } = require('@solana/web3.js');

// bs58 exports .default in some CJS environments
const bs58Module = require('bs58');
const bs58 = bs58Module.default || bs58Module;

async function main() {
  const WALLET_PRIVATE_KEY = process.env.WALLET_PRIVATE_KEY;
  if (!WALLET_PRIVATE_KEY) throw new Error('Set WALLET_PRIVATE_KEY env var');

  const API_URL = 'https://x402.breeze.baby';
  const STRATEGY_ID = '43620ba3-354c-456b-aa3c-5bf7fa46a6d4';
  const USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
  const DEPOSIT_AMOUNT = 1_000_000; // 1 USDC (6 decimals)

  // Setup
  const keypair = Keypair.fromSecretKey(bs58.decode(WALLET_PRIVATE_KEY));
  const connection = new Connection('https://api.mainnet-beta.solana.com');
  const wallet = await createLocalWallet('mainnet-beta', keypair);
  const paymentHandler = createPaymentHandler(wallet, new PublicKey(USDC_MINT), connection);
  const fetchWithPayment = wrap(fetch, { handlers: [paymentHandler] });

  console.log('Wallet:', keypair.publicKey.toBase58());

  // Build deposit transaction
  const res = await fetchWithPayment(\`${API_URL}/deposit\`, {
    method: 'POST',
    headers: { 'content-type': 'application/json' },
    body: JSON.stringify({
      amount: DEPOSIT_AMOUNT,
      user_key: keypair.publicKey.toBase58(),
      strategy_id: STRATEGY_ID,
      base_asset: USDC_MINT,
    }),
  });

  if (!res.ok) {
    const text = await res.text();
    throw new Error(\`Deposit failed (${res.status}): ${text}\`);
  }

  // Parse transaction string (may be bare or JSON-wrapped)
  const raw = (await res.text()).trim();
  const txString = raw.startsWith('"') ? JSON.parse(raw) : raw;

  // Sign and send (try versioned tx first, fall back to legacy)
  const bytes = Buffer.from(txString, 'base64');
  let sig;
  try {
    const tx = VersionedTransaction.deserialize(bytes);
    tx.sign([keypair]);
    sig = await connection.sendRawTransaction(tx.serialize());
  } catch {
    const tx = Transaction.from(bytes);
    tx.partialSign(keypair);
    sig = await connection.sendRawTransaction(tx.serialize());
  }

  await connection.confirmTransaction(sig, 'confirmed');
  console.log('Done! View transaction:', \`https://solscan.io/tx/${sig}\`);
}

main().catch(console.error);

# Set WALLET_PRIVATE_KEY from the .env created in Step 0
export $(cat .env | xargs) && node deposit.js

### Endpoint Paths: x402 API vs Direct REST API

These are different APIs with different paths. Do not mix them up.

APIBase URLEndpointsAuth methodx402 (this skill)https://x402.breeze.baby/balance/:fund_user<br>/deposit<br>/withdraw<br>/healthz (free)USDC micropayment via x402 protocolDirect REST APIhttps://api.breeze.baby/deposit/tx<br>/withdraw/tx<br>/strategy-info/:idx-api-key header

This skill uses the x402 API. The direct REST API uses different paths and API key auth — do not mix them.

### When to use this skill

"check my Breeze balance" or "show positions/yield"
"deposit X token into Breeze strategy"
"withdraw X token from Breeze strategy"
"sign and send the transaction built by the API"

### Required inputs

WALLET_PRIVATE_KEY (base58 secret key — see Step 0 to generate one)
Optional STRATEGY_ID (defaults to 43620ba3-354c-456b-aa3c-5bf7fa46a6d4 — you can use any Breeze strategy ID)
Optional X402_API_URL (default https://x402.breeze.baby)
Optional SOLANA_RPC_URL (default https://api.mainnet-beta.solana.com)
Optional BASE_ASSET mint (default USDC mint)

### Security rules

Never print or echo WALLET_PRIVATE_KEY.
Never return raw secret values in tool output.
If a command fails, redact secrets before showing logs.
Add wallet-backup.json to .gitignore immediately.

### Dependencies and install

# npm (--legacy-peer-deps required)
npm install @faremeter/fetch @faremeter/payment-solana @faremeter/wallet-solana @faremeter/info @solana/web3.js bs58 --legacy-peer-deps

# pnpm
pnpm add @faremeter/fetch @faremeter/payment-solana @faremeter/wallet-solana @faremeter/info @solana/web3.js bs58

# bun
bun add @faremeter/fetch @faremeter/payment-solana @faremeter/wallet-solana @faremeter/info @solana/web3.js bs58

### Setup: Payment-Wrapped Fetch (TypeScript)

Use this setup once per runtime. It automatically handles x402 challenges (402 → build payment proof → retry request):

import { wrap } from "@faremeter/fetch";
import { createPaymentHandler } from "@faremeter/payment-solana/exact";
import { createLocalWallet } from "@faremeter/wallet-solana";
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
import bs58 from "bs58";

const API_URL = (process.env.X402_API_URL ?? "https://x402.breeze.baby").replace(/\\/$/, "");
const SOLANA_RPC_URL = process.env.SOLANA_RPC_URL ?? "https://api.mainnet-beta.solana.com";
const STRATEGY_ID = process.env.STRATEGY_ID || "43620ba3-354c-456b-aa3c-5bf7fa46a6d4";
const BASE_ASSET = process.env.BASE_ASSET ?? "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
const WALLET_PRIVATE_KEY = process.env.WALLET_PRIVATE_KEY!;

const keypair = Keypair.fromSecretKey(bs58.decode(WALLET_PRIVATE_KEY));
const connection = new Connection(SOLANA_RPC_URL);
const wallet = await createLocalWallet("mainnet-beta", keypair);
const walletPublicKey = keypair.publicKey.toBase58();
const USDC_MINT = new PublicKey(BASE_ASSET);
const paymentHandler = createPaymentHandler(wallet, USDC_MINT, connection);

const fetchWithPayment = wrap(fetch, { handlers: [paymentHandler] });

### Check Balance

GET /balance/:fund_user

Returns JSON with positions, deposited amounts, yield earned, and APY.
Values are in base units. Convert to human amounts with token decimals.

const response = await fetchWithPayment(
	\`${API_URL}/balance/${encodeURIComponent(walletPublicKey)}\`,
	{ method: "GET" },
);
const balances = await response.json();

### Deposit

POST /deposit
Content-Type: application/json

Builds an unsigned deposit transaction.
amount must be base units (example: 10_000_000 = 10 USDC).

const response = await fetchWithPayment(\`${API_URL}/deposit\`, {
	method: "POST",
	headers: { "content-type": "application/json" },
	body: JSON.stringify({
		amount: 10_000_000, // 10 USDC (6 decimals)
		user_key: walletPublicKey,
		strategy_id: STRATEGY_ID,
		base_asset: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
	}),
});
const txString = await response.text(); // encoded unsigned transaction

### Withdraw

POST /withdraw
Content-Type: application/json

Builds an unsigned withdrawal transaction. Supports optional WSOL handling flags.
amount must be base units.

const response = await fetchWithPayment(\`${API_URL}/withdraw\`, {
	method: "POST",
	headers: { "content-type": "application/json" },
	body: JSON.stringify({
		amount: 5_000_000,
		user_key: walletPublicKey,
		strategy_id: STRATEGY_ID,
		base_asset: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
		all: false,
		exclude_fees: true, // always recommended
		// For wrapped SOL withdrawals only:
		// unwrap_wsol_ata: true,     // unwrap WSOL to native SOL
		// create_wsol_ata: true,     // create WSOL ATA if needed
		// detect_wsol_ata: true,     // auto-detect WSOL ATA existence
	}),
});
const txString = await response.text();

Withdraw parameters:

ParameterTypeRequiredDescriptionamountnumberyesAmount in base unitsuser_keystringyesUser's Solana public keystrategy_idstringyesBreeze strategy ID (default: 43620ba3-354c-456b-aa3c-5bf7fa46a6d4, or any valid strategy)base_assetstringyesToken mint addressallbooleannoWithdraw entire positionexclude_feesbooleannoExclude fees from amount (recommended: true)unwrap_wsol_atabooleannoUnwrap WSOL to native SOL after withdrawcreate_wsol_atabooleannoCreate WSOL ATA if it doesn't existdetect_wsol_atabooleannoAuto-detect WSOL ATA and set flags accordingly

WSOL handling: when withdrawing WSOL (So11111111111111111111111111111111111111112), pass unwrap_wsol_ata: true to receive native SOL.

### Health Check

GET /healthz

Free endpoint (no x402 payment required). Returns {"status":"ok"} when the service is running. Use this to verify connectivity before making paid requests.

### Workflow checklists

Copy a checklist into your working notes and mark each step complete.

### Balance workflow

Task Progress:

Read wallet public key input
 Call GET /balance/:fund_user with URL-encoded wallet key
 Verify response.ok; if not, capture status/body and stop
 Parse JSON response
 Convert base units to human-readable values using token decimals
 Return balances, yield, and APY clearly

### Deposit workflow

Task Progress:

Confirm token mint and decimals
 Convert user amount to base units (floor(amount * 10^decimals))
 Call POST /deposit with validated payload
 Verify response.ok; if not, capture status/body and stop
 Extract transaction string from response text
 Sign and broadcast transaction on Solana
 Confirm transaction and return explorer link

### Withdraw workflow

Task Progress:

Confirm token mint and decimals
 Convert user amount to base units unless all=true
 Set exclude_fees: true unless user asks otherwise
 For WSOL + native SOL output, set unwrap_wsol_ata: true
 Call POST /withdraw with validated payload
 Verify response.ok; if not, capture status/body and stop
 Extract transaction string from response text
 Sign and broadcast transaction on Solana
 Confirm transaction and return explorer link

### Signing and Sending Transactions

Deposit and withdraw return encoded unsigned transactions. Normalize then sign/send:

import { VersionedTransaction, Transaction } from "@solana/web3.js";

function extractTransactionString(responseText: string): string {
	const trimmed = responseText.trim();
	try {
		const parsed = JSON.parse(trimmed);
		if (typeof parsed === "string") return parsed;
		throw new Error("expected transaction string");
	} catch (e) {
		if (e instanceof SyntaxError) return trimmed;
		throw e;
	}
}

async function signAndSend(txString: string) {
	const bytes = Uint8Array.from(Buffer.from(txString, "base64"));

	// Try versioned transaction first, then legacy
	try {
		const tx = VersionedTransaction.deserialize(bytes);
		tx.sign([keypair]);
		const sig = await connection.sendRawTransaction(tx.serialize());
		await connection.confirmTransaction(sig, "confirmed");
		return sig;
	} catch {
		const tx = Transaction.from(bytes);
		tx.partialSign(keypair);
		const sig = await connection.sendRawTransaction(tx.serialize());
		await connection.confirmTransaction(sig, "confirmed");
		return sig;
	}
}

Validation loop:

Build/parse transaction string.
Try VersionedTransaction path.
If it fails, try legacy Transaction path.
Confirm transaction.
If both deserializations fail, return a clear decoding error and do not continue.

### Failure handling

400 errors: payload issue. Re-check required fields and amount positivity.
401/403: wallet/payment authorization issue. Verify wallet and x402 payment capability.
402: payment challenge not satisfied. Re-run request through wrapped fetch and do not bypass payment handler.
500+: upstream or proxy issue. Retry once with short backoff, then report failure.
Transaction send failure: return explicit error with stage (deserialize, sign, send, or confirm).

### Response format to user

For successful deposit/withdraw, return:

Action (deposit or withdraw)
Token + human amount
Base-unit amount used in request
Solana transaction signature
Explorer URL (https://solscan.io/tx/{sig})

For balance, return:

Per-token deposited amount
Yield earned
APY details when present
Note that raw API values are base units and were converted

### Supported Tokens

TokenMintDecimalsUSDCEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v6USDTEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB6USDSUSDSwr9ApdHk5bvJKMjzff41FfuX8bSxdKcR81vTwcA6SOLSo111111111111111111111111111111111111111129JitoSOLJ1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn9mSOLmSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So9JupSOLjupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v9JLP27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD46

### Environment Variables

VariableRequiredDefaultDescriptionWALLET_PRIVATE_KEYyes—Base58-encoded Solana private keySTRATEGY_IDno43620ba3-354c-456b-aa3c-5bf7fa46a6d4Breeze strategy ID — any valid strategy ID worksX402_API_URLnohttps://x402.breeze.babyx402 payment API URLSOLANA_RPC_URLnohttps://api.mainnet-beta.solana.comSolana RPC endpointBASE_ASSETnoUSDC mintDefault token mint for operations

### External Endpoints

This skill sends requests to:

https://x402.breeze.baby — Breeze x402 payment-gated API (deposits, withdrawals, balances)
https://api.mainnet-beta.solana.com — Solana RPC (transaction signing and broadcasting)

### Security & Privacy

This skill requires WALLET_PRIVATE_KEY as an environment variable for signing Solana transactions and x402 USDC micropayments. The key is read from the process environment at runtime and is never logged, printed, or returned in output. By using this skill, small USDC micropayments are sent from your wallet to gate API access. Only install this skill if you trust Breeze with your wallet's signing capability for USDC transactions.

### Additional reference

See agent-using-x402 for a full TypeScript implementation.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: keeganthomp
- Version: 1.0.7
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-30T16:55:25.780Z
- Expires at: 2026-05-07T16:55:25.780Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/breeze-x402-payment-api)
- [Send to Agent page](https://openagent3.xyz/skills/breeze-x402-payment-api/agent)
- [JSON manifest](https://openagent3.xyz/skills/breeze-x402-payment-api/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/breeze-x402-payment-api/agent.md)
- [Download page](https://openagent3.xyz/downloads/breeze-x402-payment-api)