API Commands

Choose the right Carbium Swap API command, understand the v2 Q1 and v1 request families, and jump to the matching guide or API reference.

API Commands

Use this page as the command map for Carbium Swap API. It tells you which command family to start with, which parameter names belong together, and where to go for the full guide or API reference.

Part of the Carbium Solana infrastructure stack.


Pick the command by job

JobCommandBest starting pageAPI reference
Get a current quote and optionally build an executable transactionGET /api/v2/quoteQ1Get / Quote
Build a transaction through the older direct swap surfaceGET /api/v1/swapSwapGet / Swap
Compare quotes across documented providersGET /api/v1/quote/allAll QuoteGet / All Quote
Build a standalone custom-fee transactionGET /api/v1/fee/customCustom FeeGet / Custom Fee
Submit a signed transaction through the bundle pathGET /api/v1/swap/bundleTxn BundleGet / Txn Bundle

For most new integrations, start with Q1. The older v1 command family is still documented and useful when you are maintaining provider-specific swap paths, all-quote comparisons, custom fee flows, or bundle submission.


Do not mix request families

Carbium's current docs expose two parameter styles. Keep each style with its matching base path.

FamilyBase pathParameter style
Current Q1 flowhttps://api.carbium.io/api/v2/quotesrc_mint, dst_mint, amount_in, slippage_bps, optional user_account
Older v1 quote and swap flowhttps://api.carbium.io/api/v1/*fromMint, toMint, amount, slippage, plus endpoint-specific fields
📘

If a request fails, check the endpoint family before changing the token pair or slippage. Sending fromMint to Q1, or src_mint to a v1 endpoint, creates avoidable debugging noise.


Minimal command examples

Q1 quote and transaction build

Use Q1 when you want the current quote surface and an optional executable txn payload.

curl --request GET \
  --url 'https://api.carbium.io/api/v2/quote?src_mint=So11111111111111111111111111111111111111112&dst_mint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount_in=1000000&slippage_bps=50&user_account=YOUR_WALLET' \
  --header 'X-API-KEY: YOUR_API_KEY'

Use Q1 for the full request and response shape. Use Executing Swaps after you receive a transaction payload and need to sign, submit, and confirm it.

Older direct swap build

Use the older direct swap surface when you are working with the documented v1 provider and execution-flag fields.

curl --request GET \
  --url 'https://api.carbium.io/api/v1/swap?owner=YOUR_WALLET&fromMint=So11111111111111111111111111111111111111112&toMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=1000000&slippage=50&provider=raydium' \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --header 'accept: text/plain'

The v1 swap reference also documents optional fields such as pool, feeLamports, feeReceiver, priorityMicroLamports, mevSafe, and gasless.

All quote comparison

Use all quote when you want provider-by-provider quote visibility instead of one executable flow.

curl --request GET \
  --url 'https://api.carbium.io/api/v1/quote/all?fromMint=So11111111111111111111111111111111111111112&toMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=1000000&slippage=50' \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --header 'accept: text/plain'

An all-quote response can include valid results for some providers and route misses for others. Treat provider-level misses as routing signals, not as proof that the whole API is unavailable.


Command map by integration stage

StageUse thisStop when
AuthenticateGet your API keyYour backend can send X-API-KEY successfully
QuoteGET /api/v2/quote or GET /api/v1/quote/allYou have a route, output amount, and slippage boundary
Build transactionQ1 with user_account, or GET /api/v1/swapYou have a base64 transaction payload
SignYour wallet, backend signer, or custody flowThe transaction is signed by the required signer
SubmitCarbium RPC or the documented bundle pathYou have a transaction signature, bundle id, or failure reason
DebugSwap API Errors ReferenceYou know whether the failure is auth, routing, request shape, signing, or RPC submission

This page stops at command selection. It does not replace the endpoint reference, the Q1 guide, or the execution guide.


Fast checks before opening a support thread

  • Confirm the API key belongs to Swap API access, not RPC access.
  • Send the key in the X-API-KEY header.
  • Keep Q1 parameter names on the v2 path.
  • Keep fromMint, toMint, amount, and slippage on the v1 paths.
  • Send amounts in smallest units.
  • Include user_account when your Q1 flow expects an executable txn.
  • Move to Swap API Errors Reference when auth, route, or request-shape failures appear before signing.
🔶

Start with Q1 for new executable quote flows, then use carbium.io when you are ready to provision platform access or evaluate the full stack.