Getting Started
Quick Start
Get up and running with PYRE in under 5 minutes.
Prerequisites
- A Solana wallet (Phantom, Solflare, etc.)
- $PYRE tokens in your wallet
- Node.js 18+ (for SDK usage)
Step 1: Connect Your Wallet
Go to the PYRE app and connect your Solana wallet (Phantom, Solflare, etc.):
Step 2: Make Your First API Call
Use the Playground to test APIs interactively, or call them directly:
cURL
curl "https://pyrefm.xyz/api/data/crypto?symbol=SOL" \
-H "x-wallet-address: YOUR_WALLET_ADDRESS" \
-H "x-payment-proof: BASE64_PAYMENT_PROOF"Step 3: Approve Payment & Burn
When you make an API call, the system will prompt for $PYRE payment. 30% is burned forever, making the token deflationary!
Response Example
{
"success": true,
"data": {
"symbol": "SOL",
"price": 125.43,
"change24h": "+5.67%"
},
"_payment": {
"amount": 20,
"burned": 6, // 30% burned! 🔥
"txHash": "abc123..."
}
}Step 4: Handling Payments
When you make an API call, the SDK will automatically prompt for payment approval. Here's how the flow works:
1
SDK calculates required $PYRE
Based on current token price and API cost
2
Wallet prompts for approval
Shows breakdown: burn, provider, holders, treasury
3
Transaction executed
30% burned, rest distributed
✓
API response returned
Includes payment receipt with burn amount
Complete Example: JavaScript
JavaScript / fetch
// Example: AI Chat API
async function chatWithAI(message) {
const response = await fetch('https://pyrefm.xyz/api/ai/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-wallet-address': 'YOUR_WALLET_ADDRESS',
'x-payment-proof': paymentProof, // From wallet transaction
},
body: JSON.stringify({ message }),
});
const data = await response.json();
console.log('AI Response:', data.data.message);
console.log('Tokens burned:', data._payment.burned, '🔥');
return data;
}
// Use it
chatWithAI('Explain blockchain in simple terms');Example: cURL
cURL
curl -X POST https://pyrefm.xyz/api/ai/chat \
-H "Content-Type: application/json" \
-H "x-wallet-address: YOUR_WALLET_ADDRESS" \
-H "x-payment-proof: BASE64_ENCODED_TX_PROOF" \
-d '{"message": "Hello, AI!"}'