▸ Human API — Non-Custodial
Generate unsigned Solana transactions via a single POST request. Sign them locally with your private key and submit through your own RPC. Your keys never leave your machine.
https://plugy.fun/api/tradeReturns a base64-encoded unsigned Solana transaction · No authentication required · Platform fee included in TX
Platform Fee
Every transaction includes a percentage-based SOL fee transferred to the PLUGy platform wallet. For buys, the fee is calculated on the SOL input amount. For sells, on the estimated SOL output. The fee instruction is embedded in the unsigned transaction — you can inspect it before signing. The exact fee amount is returned in the fee response field.
| Parameter | Type | Req | Description |
|---|---|---|---|
publicKey | string | ✓ | Your wallet public key |
action | "buy" | "sell" | "create" | "collectCreatorFee" | ✓ | Trade direction, "create" to launch a token, or "collectCreatorFee" to claim accumulated creator rewards |
mint | string | ✓ | Token contract address — not needed for create |
amount | number | string | ✓ | SOL or token amount. Sell supports "100%" — not needed for create |
denominatedInSol | "true" | "false" | ✓ | "true" if amount is in SOL, "false" if tokens — not needed for create |
slippage | number | ✓ | Percent slippage allowed (0–100) |
priorityFee | number | ✓ | Priority fee in SOL |
pool | string | — | "pump", "pumpswap", "launchlab" (Raydium), "meteora", or "auto" (default) |
tokenMetadata | object | — | Create only: { name, symbol, description, file (URL or base64), twitter?, telegram?, website? } |
devBuyAmount | number | — | Create only: dev-buy in SOL (default 0) |
mintPublicKey | string | — | Create only: pass mint address only — server skips mint signing, you sign client-side with both wallet + mint keypair |
mintSecretKey | string | — | Create only: base64 or bs58 secret key — server signs with mint keypair for you (agent use) |
creatorRewards | boolean | — | Create only: true = creator-rewards token · false (default) = cashback token |
{
"success": true,
"action": "buy",
"pool": "pump",
"transaction": "base64...",
"estimatedTokens": 12345.678,
"maxSolCost": 0.011,
"fee": { "sol": 0.000025, "rate": "0.25%" }
}{
"success": true,
"action": "sell",
"pool": "pump",
"transaction": "base64...",
"estimatedSol": 0.05,
"minSolOutput": 0.045,
"fee": { "sol": 0.000125, "rate": "0.25%" }
}{
"success": true,
"action": "create",
"transaction": "base64...",
"mintAddress": "NewToken...",
"mintSignedByServer": true,
"mintSecretKey": "base64... (only when server generated mint; absent when mintPublicKey was provided)",
"metadataUri": "https://...",
"hasDevBuy": true,
"estimatedTokens": 1000000,
"fee": { "sol": 0.005, "rate": "0.25%" }
}{
"success": true,
"action": "collectCreatorFee",
"transaction": "base64...",
"pendingBcSol": 0.038491,
"pendingAmmSol": 0.012300,
"totalPendingSol": 0.050791,
"message": "Sign and submit this transaction
to collect 0.050791 SOL in creator fees
(0.038491 SOL from bonding curve,
0.012300 SOL from PumpSwap)."
}Buy examples
import { Connection, Keypair, VersionedTransaction } from '@solana/web3.js';
import bs58 from 'bs58';
const res = await fetch('https://plugy.fun/api/trade', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
publicKey: "YOUR_WALLET_PUBLIC_KEY",
action: "buy",
mint: "TOKEN_MINT_ADDRESS",
amount: 0.01,
denominatedInSol: "true",
slippage: 10,
priorityFee: 0.005,
pool: "auto"
})
});
const { transaction } = await res.json();
const tx = VersionedTransaction.deserialize(Buffer.from(transaction, 'base64'));
const keypair = Keypair.fromSecretKey(bs58.decode('YOUR_PRIVATE_KEY'));
tx.sign([keypair]);
const connection = new Connection('YOUR_RPC_ENDPOINT');
const sig = await connection.sendRawTransaction(tx.serialize());
console.log(`https://solscan.io/tx/${sig}`);Sell examples
const res = await fetch('https://plugy.fun/api/trade', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
publicKey: "YOUR_WALLET_PUBLIC_KEY",
action: "sell",
mint: "TOKEN_MINT_ADDRESS",
amount: "100%",
denominatedInSol: "false",
slippage: 10,
priorityFee: 0.005,
pool: "auto"
})
});
const { transaction } = await res.json();
// Sign & send as usual...Create token example
curl -X POST https://plugy.fun/api/trade \
-H "Content-Type: application/json" \
-d '{
"publicKey": "YOUR_WALLET_PUBLIC_KEY",
"action": "create",
"tokenMetadata": {
"name": "My Token",
"symbol": "MTK",
"description": "A cool PumpFun token",
"file": "https://example.com/logo.png",
"twitter": "https://x.com/mytoken",
"telegram": "https://t.me/mytoken",
"website": "https://mytoken.fun"
},
"devBuyAmount": 1,
"slippage": 10,
"priorityFee": 0.005,
"creatorRewards": false
}'
# With pre-generated mint address (recommended — mintPublicKey, no secret sent to server):
# Step 1 — generate locally:
# const kp = Keypair.generate();
# // save kp.secretKey — you need it for client-side signing
# Step 2 — pass only the public key:
# add "mintPublicKey": "<kp.publicKey.toBase58()>"
# Response will have mintSignedByServer: false — sign TX with BOTH wallet + mint keypair.
#
# Alternative — mintSecretKey (server signs for you, mainly for agent API):
# add "mintSecretKey": "<base64 secret>"▸ Collect creator fees
NEWEvery time someone buys or sells your token, pump.fun accumulates a small SOL reward for you as the creator. Fees come from two separate vaults depending on where the token is traded:
Bonding curve vault
Accumulates native SOL during bonding curve trading on pump.fun. Available immediately — no migration required.
PumpSwap AMM vault
Accumulates WSOL after your token graduates and migrates to PumpSwap. Automatically unwrapped to SOL on claim.
The collectCreatorFee action checks both vaults in parallel and builds a single transaction that collects everything available in one shot. Only publicKey and priorityFee are required — no mint needed.
⚠ The returned transaction is a legacy Transaction (not VersionedTransaction). Use Transaction.from() to deserialize, not VersionedTransaction.deserialize().
Collect creator fees examples
import { Connection, Keypair, Transaction } from '@solana/web3.js';
import bs58 from 'bs58';
const res = await fetch('https://plugy.fun/api/trade', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
publicKey: "YOUR_WALLET_PUBLIC_KEY",
action: "collectCreatorFee",
priorityFee: 0.0001,
})
});
const data = await res.json();
// Check what's pending before signing:
console.log(`Bonding curve: ${data.pendingBcSol} SOL`);
console.log(`PumpSwap AMM: ${data.pendingAmmSol} SOL`);
console.log(`Total: ${data.totalPendingSol} SOL`);
// Creator fee TX is a legacy Transaction (not VersionedTransaction)
const tx = Transaction.from(Buffer.from(data.transaction, 'base64'));
const keypair = Keypair.fromSecretKey(bs58.decode('YOUR_PRIVATE_KEY'));
tx.sign(keypair);
const connection = new Connection('YOUR_RPC_ENDPOINT');
const sig = await connection.sendRawTransaction(tx.serialize());
console.log(`https://solscan.io/tx/${sig}`);