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:
| Layer | Typical signal | Stay on this page? |
|---|---|---|
| Authentication | 401, 403, or an auth error body | Yes |
| Request shape | wrong parameter family, missing required query field, unexpected empty payload | Yes |
| Route building | no pool, no route, provider-level miss, unsupported pair at the requested size | Yes |
| Transaction payload build | Q1 quote succeeds but txn is empty when your app expected one | Yes |
| Signing | wallet, signer, custody, or deserialization failure after a payload exists | No |
| RPC submission | preflight, blockhash, confirmation, or on-chain program error | No |
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.
| Surface | Request family | Parameter style | Best starting page |
|---|---|---|---|
GET /api/v2/quote | Current Q1 quote flow | src_mint, dst_mint, amount_in, slippage_bps, optional user_account | Q1 |
GET /api/v1/quote, GET /api/v1/quote/all | Older quote paths | fromMint, toMint, amount, slippage, optional provider fields | API Commands |
GET /api/v1/swap | Older transaction-build path | owner, fromMint, toMint, amount, slippage, provider, optional execution flags | Swap |
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 status | Verified meaning | First fix |
|---|---|---|
401 | API key missing | Add the X-API-KEY header from your backend |
403 | API key invalid | Replace 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:
| Field | Common mistake |
|---|---|
src_mint | Sending a symbol such as SOL instead of a mint address |
dst_mint | Using the wrong output mint or a copied token address from another chain |
amount_in | Sending UI units instead of smallest units |
slippage_bps | Sending percentage text instead of basis points |
user_account | Omitting it when your app expects an executable txn |
Older v1 request checklist
v1 request checklistOlder 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.
| Symptom | Likely cause | First fix |
|---|---|---|
No pool found | Selected provider or pool cannot serve the pair | Remove the pool hint, switch provider, or test a known liquid pair |
COULD_NOT_FIND_ANY_ROUTE for one provider | That provider has no valid route at that size | Check other providers in the same response |
| Empty or unusable quote for an illiquid pair | Pair exists but not at that amount or route shape | Reduce size, change pair, or retry another route source |
| Route exists but output is worse than expected | Price impact, slippage, or liquidity depth changed | Requote 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
txn on Q1Q1 can work as both a quote-only surface and a transaction-build surface. The difference is user_account.
| Symptom | What it means | Fix |
|---|---|---|
Quote response succeeds but txn is empty | You requested pricing without an executable transaction payload | Add user_account |
txn exists but signing fails | The Swap API build step succeeded | Debug wallet, signer, custody, or deserialization |
txn exists and RPC send fails | The problem moved to submission or on-chain execution | Use 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 deserialization | Executing Swaps |
| Sending a signed transaction through RPC | Sending Transactions through Carbium RPC |
BlockhashNotFound, expired block height, or duplicate-send uncertainty | Blockhash Expiry Recovery Playbook |
| HTTP or JSON-RPC errors from the RPC endpoint | RPC Errors Reference |
| Simulation or preflight logs | Debug 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_accountwas 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.
