Swap API Errors Reference
Troubleshoot Carbium Swap API auth, routing, and quote-build failures using the currently documented request shapes and published error examples.
Swap API Errors Reference
Use this page when a Carbium Swap API request fails before a signed transaction reaches Solana. It covers the currently documented error lane for:
- missing or invalid API authentication
- quote or swap requests that cannot find a route or pool
- executable quote requests that return no
txn
This page does not cover on-chain transaction failures after signing and submission. For that stage, move to your RPC confirmation flow and application logs.
Part of the Carbium Solana infrastructure stack.
What this page owns
Carbium's current docs expose two request families:
| Surface | Current documented use |
|---|---|
GET /api/v2/quote | Q1 quote flow, including executable quotes when user_account is provided |
GET /api/v1/quote, GET /api/v1/swap, GET /api/v1/quote/all | Older quote and swap reference paths still documented in the API pages |
This page only covers failures that are directly documented on those surfaces. It does not invent a broader error taxonomy.
Fast triage
Check these first before you debug deeper:
- Send
X-API-KEYon every Swap API request. - Use the parameter names that match the endpoint family you chose.
- Send token amounts in smallest units.
- If you need an executable transaction from Q1, include
user_account. - If a route is missing, validate the token pair, provider, and optional pool hint before retrying.
Auth failures
These are the quickest failures to identify.
| HTTP status | Verified meaning | What to do |
|---|---|---|
401 | API key missing | Add the X-API-KEY header and retry |
403 | API key invalid | Regenerate or replace the key you are sending |
Carbium's live API surface currently returns JSON errors in this shape:
{"error":"API key missing"}{"error":"Invalid API key"}If you are not sure which key you are sending, start from Get your API key and confirm you are using the Swap API key, not an RPC key.
Route and pool lookup failures
The published Carbium quote and swap references document a 400 response for route-building failures:
{ "error": { "message": "No pool found" } }Carbium's all-quote guide also shows provider-specific route misses in the response body:
{
"meteora-dlmm": {
"error": "Could not find any route",
"error_code": "COULD_NOT_FIND_ANY_ROUTE"
}
}Use those messages as a routing diagnosis, not as an auth diagnosis.
What usually causes route failures
| Symptom | Likely cause | First fix |
|---|---|---|
No pool found | The selected provider or pool cannot serve that pair | Remove the pool hint or switch provider |
COULD_NOT_FIND_ANY_ROUTE in all-quote output | At least one provider has no valid path for that pair and size | Check other providers in the same response before failing the whole flow |
| Empty or unusable quote result for an illiquid pair | Pair exists but not at the requested amount or path | Reduce size, change pair, or retry against another provider |
Do not treat a route miss as proof that the whole API is down. It usually means the requested pair, provider, or liquidity path does not resolve cleanly.
Missing txn on Q1 executable quotes
txn on Q1 executable quotesCarbium's current Q1 build path is GET /api/v2/quote. The execution guides document one key rule:
- if
user_accountis provided, the response can include a base64txn - if
user_accountis omitted,txncan be an empty string
That means an empty txn is usually a request-shape issue, not a signing failure.
What to check
| Symptom | What it means | Fix |
|---|---|---|
Quote succeeds but txn is empty | You requested pricing without an executable transaction payload | Add user_account to the Q1 quote request |
txn exists but signing later fails | The build step succeeded; the failure moved to wallet or RPC execution | Debug the signing or submission layer, not the quote layer |
Minimal 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 it is missing.
Parameter-family mistakes
Carbium's docs currently show both older v1 parameter names and the newer Q1 v2 names. Mixing them is a common integration mistake.
| Endpoint family | Expected parameter style |
|---|---|
GET /api/v1/quote and GET /api/v1/quote/all | fromMint, toMint, amount, slippage, optional provider |
GET /api/v1/swap | owner, fromMint, toMint, amount, slippage, optional execution flags |
GET /api/v2/quote | src_mint, dst_mint, amount_in, slippage_bps, optional user_account |
If you send src_mint to a v1 path or fromMint to a v2 path, debug the request shape before you assume Carbium returned a deeper product failure.
When the failure is no longer a Swap API problem
Move out of this page when:
- the quote or transaction payload was returned successfully
- you already signed the transaction
- the failure appears during send, confirmation, or finalization
At that point the problem has shifted to transaction execution, wallet signing, RPC reliability, or on-chain state.
Use Executing Swaps for the Q1 build flow, Q1 for the current quote surface, and Get your API key if the failure starts with authentication.
Updated about 9 hours ago
