TL;DR
Metis is Jupiter’s routing engine, powering every swap on jup.ag. Get a quote, build a transaction, sign and send. Three API calls for a complete swap with full control over routing, fees, and execution. Base URL:https://api.jup.ag/swap/v1
When to use Metis
Ultra handles everything for you: routing, slippage, MEV protection, and transaction sending. No RPC node required. Metis gives you full control. Use Metis when you need:- Custom instructions in the same transaction (token transfers, program calls, memos)
- CPI from your Solana program to call Jupiter’s swap on-chain
- Your own transaction broadcasting via your RPC or Jito
- Full control over fees including priority fees, compute budget, and platform fees
- Route filtering to include or exclude specific DEXes
Prerequisites
- Get an API key at Portal (free)
- All requests need the
x-api-keyheader - Install
@solana/web3.jsfor transaction signing and sending - Have an RPC endpoint (Helius, Triton, or similar)
Quick start
/swap to build a transaction:
swapTransaction (base64 unsigned). Deserialise, sign, send via your RPC.
API reference
Base URL:https://api.jup.ag/swap/v1
The swap flow
Three steps: get a quote, build the transaction, sign and send.Step 1: Get a quote
GET /quote takes the token pair, amount, and slippage. It returns the best route across 74+ DEXes.
instructionVersion=V2. V2 instructions support nativeDestinationAccount for receiving native SOL, platform fees on Token-2022 swap pairs, and all future features. All examples in this guide use V2.Step 2: Build the transaction
POST /swap takes the quote and returns a serialised transaction ready to sign.
Step 3: Sign and send
The response contains a base64-encoded serialised transaction. Deserialise, sign, send via your RPC.Full working example
End-to-end: swap 1 SOL to USDC, from scratch.Error handling
Errors can surface at every stage of the swap flow.During quoting
During quoting
During transaction building
During transaction building
During transaction execution
During transaction execution
Execution debugging
When something fails, log the end-to-end flow: the URL and parameters used, the API responses, and the transaction signature. This makes issues reproducible.Route debugging
The quote response includesmostReliableAmmsQuoteReport: the markets that would have quoted for this pair.
outAmount to verify routing decisions. Map AMM addresses to DEX names with GET /program-id-to-label.
Optimise execution
Priority fees, compute units, slippage, and your RPC setup all affect whether transactions land. For the full deep dive, see Send Swap Transaction.Priority fees
Priority fees
prioritizationFeeLamports with priorityLevelWithMaxLamports to set a fee level (medium, high, veryHigh) with a cap to prevent overpaying. Alternatively, use jitoTipLamports for Jito bundle tips (requires a Jito RPC). You cannot use both in the same /swap call.See how Jupiter estimates priority fees.Compute units
Compute units
dynamicComputeUnitLimit: true in /swap or /swap-instructions. This simulates the swap to set an accurate compute unit limit, which directly reduces the priority fee you pay since fees are proportional to the compute budget requested.See how Jupiter estimates compute unit limit.Slippage
Slippage
slippageBps should match the volatility of the token pair. Too tight and transactions fail with SlippageToleranceExceeded; too loose and you lose value.See how Jupiter estimates slippage.RPC and broadcasting
RPC and broadcasting
Common questions
Why is there no route found for this token?
Why is there no route found for this token?
What does priceImpactPct mean and when should I block swaps?
What does priceImpactPct mean and when should I block swaps?
priceImpactPct is a decimal from 0 to 1, not a percentage. Multiply by 100 to get the actual percentage. A value of 0.01 means 1% price impact. A value of 1 means 100% price impact, meaning the user would lose their entire input value. Always check this value before executing. If price impact exceeds your threshold (e.g. 5-10%), warn the user or block the swap entirely.Why is my transaction failing with slippage errors?
Why is my transaction failing with slippage errors?
slippageBps.Can I use Metis and Ultra together?
Can I use Metis and Ultra together?
How do I filter which DEXes are used?
How do I filter which DEXes are used?
dexes to restrict to specific DEXes, or excludeDexes to block them. Get the full list from GET /program-id-to-label.What's the difference between /swap and /swap-instructions?
What's the difference between /swap and /swap-instructions?
/swap returns a complete serialised transaction. /swap-instructions returns individual instructions you compose into your own transaction. Use /swap for standard swaps; /swap-instructions when you need custom instructions or CPI.Next steps
- Add Fees to Swap. Collect platform fees on swaps through your integration.
- Swap API Reference. Full endpoint schema and playground.
- Integrate AMM into Metis. How tokens and markets get listed in Jupiter’s routing engine.
- Ultra Swap API. Want simpler? Ultra handles everything for you.
