Swap API Errors Reference

Troubleshoot Carbium Swap API authentication, request-shape, route-building, and missing transaction payload failures before the flow reaches signing or RPC submission.

Swap API Errors Reference

Use this page when a Carbium Swap API request fails before a signed transaction reaches Solana.

The fastest way to debug Swap API errors is to identify the layer first:

LayerTypical signalStay on this page?
Authentication401, 403, or an auth error bodyYes
Request shapewrong parameter family, missing required query field, unexpected empty payloadYes
Route buildingno pool, no route, provider-level miss, unsupported pair at the requested sizeYes
Transaction payload buildQ1 quote succeeds but txn is empty when your app expected oneYes
Signingwallet, signer, custody, or deserialization failure after a payload existsNo
RPC submissionpreflight, blockhash, confirmation, or on-chain program errorNo

This page owns the pre-sign failure lane. Use Executing Swaps once a transaction payload exists, and use RPC Errors Reference after the signed transaction is sent through RPC.

Part of the Carbium Solana infrastructure stack.


First isolate the surface

Carbium's current docs expose two request families. Most avoidable errors come from mixing them.

SurfaceRequest familyParameter styleBest starting page
GET /api/v2/quoteCurrent Q1 quote flowsrc_mint, dst_mint, amount_in, slippage_bps, optional user_accountQ1
GET /api/v1/quote, GET /api/v1/quote/allOlder quote pathsfromMint, toMint, amount, slippage, optional provider fieldsAPI Commands
GET /api/v1/swapOlder transaction-build pathowner, fromMint, toMint, amount, slippage, provider, optional execution flagsSwap

If you send fromMint to Q1, or src_mint to a v1 path, fix the request shape before changing route, slippage, token pair, or provider. Use Swap API Request Families when you need the full v2 vs v1 map.


Authentication failures

Every Swap API request should send the Swap API key in the X-API-KEY header.

HTTP statusVerified meaningFirst fix
401API key missingAdd the X-API-KEY header from your backend
403API key invalidReplace the key, confirm it is a Swap API key, or regenerate it in the API dashboard

Verified public response bodies:

{"error":"API key missing"}
{"error":"Invalid API key"}

Do not put the Swap API key in frontend code. If you are unsure which key is being used, start from Get your API key and Carbium Auth Matrix. RPC keys and Swap API keys are separate.


Request-shape failures

Before treating an error as a route or liquidity problem, confirm the request is internally consistent.

Q1 request checklist

A Q1 quote request should look like this:

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

Check these fields first:

FieldCommon mistake
src_mintSending a symbol such as SOL instead of a mint address
dst_mintUsing the wrong output mint or a copied token address from another chain
amount_inSending UI units instead of smallest units
slippage_bpsSending percentage text instead of basis points
user_accountOmitting it when your app expects an executable txn

Older v1 request checklist

Older v1 quote and swap paths use fromMint, toMint, amount, and slippage. The v1 swap path also requires owner and provider.

Keep the whole request on one family. A request that mixes Q1 fields with v1 fields is not a reliable test of route availability.


Route and pool lookup failures

The published Carbium quote and swap references document this 400 response for route-building failures:

{ "error": { "message": "No pool found" } }

The All Quote guide also shows provider-level route misses inside a broader response:

{
  "meteora-dlmm": {
    "error": "Could not find any route",
    "error_code": "COULD_NOT_FIND_ANY_ROUTE"
  }
}

Treat these as route diagnostics, not authentication diagnostics.

SymptomLikely causeFirst fix
No pool foundSelected provider or pool cannot serve the pairRemove the pool hint, switch provider, or test a known liquid pair
COULD_NOT_FIND_ANY_ROUTE for one providerThat provider has no valid route at that sizeCheck other providers in the same response
Empty or unusable quote for an illiquid pairPair exists but not at that amount or route shapeReduce size, change pair, or retry another route source
Route exists but output is worse than expectedPrice impact, slippage, or liquidity depth changedRequote close to signing time and enforce your minimum output

A route miss does not prove the whole API is down. It usually means the requested pair, size, provider, pool hint, or route source does not resolve cleanly.


Missing txn on Q1

Q1 can work as both a quote-only surface and a transaction-build surface. The difference is user_account.

SymptomWhat it meansFix
Quote response succeeds but txn is emptyYou requested pricing without an executable transaction payloadAdd user_account
txn exists but signing failsThe Swap API build step succeededDebug wallet, signer, custody, or deserialization
txn exists and RPC send failsThe problem moved to submission or on-chain executionUse RPC and transaction-debugging docs

Executable Q1 request shape:

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'

If your integration expects quote-only behavior, omit user_account. If it expects an executable payload, require user_account and fail fast when txn is empty.


When to leave this page

Move out of Swap API error triage when the API returned a transaction payload and the next failure happens after that.

Failure appears during...Use
Wallet signing, backend signing, or transaction deserializationExecuting Swaps
Sending a signed transaction through RPCSending Transactions through Carbium RPC
BlockhashNotFound, expired block height, or duplicate-send uncertaintyBlockhash Expiry Recovery Playbook
HTTP or JSON-RPC errors from the RPC endpointRPC Errors Reference
Simulation or preflight logsDebug Solana Transaction Simulation

The boundary matters because rebuilding a quote will not fix a signer bug, and changing RPC endpoints will not fix a missing X-API-KEY header.


Support payload

When you need help, preserve the smallest useful evidence set:

  • endpoint path and request family, without secrets
  • HTTP status and response body
  • token mints, raw amount, slippage, provider, and pool hint if used
  • whether user_account was included
  • whether the response contained txn
  • timestamp and environment
  • transaction signature only if the flow reached RPC submission

Redact X-API-KEY, private keys, wallet seed phrases, and any full backend secret values before sharing logs.

For new builds, start with Q1, keep keys backend-side, and use this page only until you know whether the failure is auth, request shape, routing, or transaction payload generation.