This source did not publish a separate summary. Review SKILL.md before using the skill.
SKILL.md
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.
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:
Parameter
Type
Required
Description
amount
number
yes
Amount in base units
user_key
string
yes
User's Solana public key
strategy_id
string
yes
Breeze strategy ID (default: 43620ba3-354c-456b-aa3c-5bf7fa46a6d4, or any valid strategy)
base_asset
string
yes
Token mint address
all
boolean
no
Withdraw entire position
exclude_fees
boolean
no
Exclude fees from amount (recommended: true)
unwrap_wsol_ata
boolean
no
Unwrap WSOL to native SOL after withdraw
create_wsol_ata
boolean
no
Create WSOL ATA if it doesn't exist
detect_wsol_ata
boolean
no
Auto-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:
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
Token
Mint
Decimals
USDC
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
6
USDT
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
6
USDS
USDSwr9ApdHk5bvJKMjzff41FfuX8bSxdKcR81vTwcA
6
SOL
So11111111111111111111111111111111111111112
9
JitoSOL
J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn
9
mSOL
mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So
9
JupSOL
jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v
9
JLP
27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4
6
Environment Variables
Variable
Required
Default
Description
WALLET_PRIVATE_KEY
yes
—
Base58-encoded Solana private key
STRATEGY_ID
no
43620ba3-354c-456b-aa3c-5bf7fa46a6d4
Breeze strategy ID — any valid strategy ID works
X402_API_URL
no
https://x402.breeze.baby
x402 payment API URL
SOLANA_RPC_URL
no
https://api.mainnet-beta.solana.com
Solana RPC endpoint
BASE_ASSET
no
USDC mint
Default 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.