Skip to main content
Metis Swap V1 is deprecated. Use Swap API V2 /build instead - it replaces /quote + /swap-instructions with a single /build endpoint. See the Migration Guide.

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
Metis and Ultra are not mutually exclusive. Use Ultra for simple swaps, Metis for flows that need composability.

Prerequisites

  1. Get an API key at Portal (free)
  2. All requests need the x-api-key header
  3. Install @solana/web3.js for transaction signing and sending
  4. Have an RPC endpoint (Helius, Triton, or similar)

Quick start

You get back a quote with routing details. Pass it to /swap to build a transaction:
You get back a swapTransaction (base64 unsigned). Deserialise, sign, send via your RPC.

API reference

Base URL: https://api.jup.ag/swap/v1 Full schema at API Reference.

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.
Parameters:
Always pass 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.
What you get back:

Step 2: Build the transaction

POST /swap takes the quote and returns a serialised transaction ready to sign.
Parameters: For the full list of parameters, see the Swap API Reference.

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.
That’s the entire integration.

Error handling

Errors can surface at every stage of the swap flow.
Transaction landing depends heavily on your execution pipeline: RPC quality, priority fee/tip calibration, and network conditions all play a role.Jupiter swap program error codes come from the Anchor IDL on Solscan. For the full error reference, see Common Errors.

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.
Always submit transactions on-chain with skipPreflight: true rather than simulating locally. Block explorers like Solscan capture account state on failed transactions, which is far more useful for debugging. If you do simulate locally and it fails, log the base64-encoded swapTransaction so you can inspect it later.
If a swap fails, re-quote and try again. Quotes go stale quickly, so never reuse a previous quote response.

Route debugging

The quote response includes mostReliableAmmsQuoteReport: the markets that would have quoted for this pair.
Each key is an AMM address, each value is the quoted output amount. Compare with the chosen route’s 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.
Use 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.
Always pass 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.
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.
A fast, well-connected RPC with stake-weighted connections will land transactions more reliably. Bad RPCs or poor fee calibration lead to delayed, expired, or dropped transactions.See how Jupiter broadcasts transactions.

Common questions

Jupiter routes through 74+ DEXes, but not every token has a routable market. New markets on supported DEXes get instant routing with a grace period based on token age (up to 30 days). After the grace period, the market must meet liquidity criteria. If no route is found, the token may not have graduated from its bonding curve, or its market doesn’t meet the requirements. See Market Listing for the full criteria.
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.
Price moved between quote and landing. Re-quote with fresh pricing and send faster. For volatile tokens, increase slippageBps.
Yes. They access the same liquidity. Use Ultra for simple swaps, Metis for flows that need custom instructions, CPI, or full transaction control.
Use dexes to restrict to specific DEXes, or excludeDexes to block them. Get the full list from GET /program-id-to-label.
/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