API Types
Raze.bot offers two API tiers:Router V3 (Public API)
- No authentication required for buy/sell
- 0.001 SOL minimum tip + 0.5% swap fee (deducted from transactions)
- Endpoints:
/swap/sol/buy,/swap/sol/sell
Premium API
- Requires API key (
Authorization: Bearer sk_...orX-API-Key: sk_...) - Endpoints:
/swap/sol/quote/:mint,/swap/sol/instructions,/api/sol/*
Authentication
Router V3
No authentication needed. Fees are included in transactions.Premium API
Pass your API key via header or 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:Best 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
Next Steps
Portal Setup
Get your Premium API key
Rate Limits
Understand usage limits
