API Types
Raze.bot offers two API tiers:Router V2 (Public API)
- No authentication required
- Usage-based fees deducted from transactions
- Endpoints:
/v2/sol/buy,/v2/sol/sell,/v2/sol/send, utilities
Premium API
- Requires API key (subscription)
- Endpoints:
/sol/quote,/sol/swap,/api/sol/*
Authentication
Router V2
No authentication needed. Fees are included in transactions.Premium API
Pass your API key as a query parameter:Response Format
All APIs return JSON with a consistent structure:HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 404 | Not Found - Resource doesn’t exist |
| 429 | Rate Limited - Too many requests |
| 500 | Server Error - Internal error |
| 504 | Gateway Timeout - Request timed out |
Transaction Flow
For swap operations, the typical flow is:1
Request Transaction
Call the buy/sell endpoint to get unsigned transaction(s)
2
Sign Transaction
Sign the transaction with your wallet’s private key
3
Send Transaction
Submit via
/v2/sol/send or directly to Solana RPCBest Practices
Secure Your Keys
Secure Your Keys
- Store API keys in environment variables
- Never expose private keys in code
- Use
.gitignorefor sensitive files
Handle Errors
Handle Errors
- Always check
successfield in responses - Implement retry logic with exponential backoff
- Log errors for debugging
Optimize Performance
Optimize Performance
- Use the nearest server region
- Cache quotes when appropriate
- Batch transactions when possible
Manage Slippage
Manage Slippage
- Set appropriate slippage for volatile tokens
- Default slippage is usually sufficient for stable pairs
- Higher slippage for low-liquidity tokens
