Skip to main content

API Types

Every Raze.bot endpoint requires an API key. There is no unauthenticated tier.

Trading

  • /swap/sol/buy, /swap/sol/sell, /swap/sol/buy-sell, /swap/sol/sell-buy
  • /swap/sol/quote/:mint, /swap/sol/quote/stream (WebSocket), /swap/sol/instructions
  • /perp/sol/*

Data

  • History (https://api.raze.bot/api/sol/*), Streaming (wss://ws.raze.bot/ws/sol), Solana RPC (https://rpc.raze.bot)

Fees

The router adds no fee of its own. Tip and platform fee come from your request (tipWallet/tipLamports, feeWallet/feeBps) — omit them and the built transaction carries neither. feeBps is capped on-chain at 1000 (10%) and is charged only on routes that go through the Raze CPI router.

Authentication

Pass your API key via header or query parameter:

Response Format

All APIs return JSON with a consistent structure:
Error responses:

HTTP Status Codes

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 the Raze Solana RPC relay (POST /tx) or any standard Solana RPC endpoint

Best Practices

  • Store API keys in environment variables
  • Never expose private keys in code
  • Use .gitignore for sensitive files
  • Always check success field in responses
  • Implement retry logic with exponential backoff
  • Log errors for debugging
  • Use the nearest server region
  • Cache quotes when appropriate
  • Batch transactions when possible
  • 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 API key

Rate Limits

Understand usage limits