Carbium /api and rpc reference
Quote and execute Solana token swaps, stream accounts over WebSocket/gRPC, and hit the RPC with a live try-it on every endpoint.
Authenticate every request with your key in the X-API-KEY header. The API and
the RPC use separate keys paste each below
to drive the try it panels.
Quote and execute Solana swaps. The /quote endpoint routes across multiple AMM families and returns a signed ready transaction in a single call. Quote, route, and (optionally) fee collection happen in one step. Include user_account to get a built txn ready to sign and submit.
Integrator fee
Pass treasury and fee_bps on /quote. The returned transaction collects the fee atomically inside the swap instruction. One tx, one signature, no client side bundling.
- Fee is computed on the gross output (post-swap, pre delivery) and rounded down.
- Range 0 to 500 bps, enforced both server side and onchain via
MAX_FEE_BPS. - SPL output: fee paid in the destination mint to
ATA(treasury, dst_mint). The API auto-prepends acreate_idempotent_atathe first time a treasury is seen for a mint (user pays ~0.002 SOL rent, one-time). - SOL output: fee paid as wrapped SOL via the same idempotent pattern. The treasury can unwrap by closing the ATA.
- Slippage stays on the gross output, and the fee is deterministic on top.
- Pump.fun curve answers (
fft=1): the fee is a SOL transfer to thetreasurywallet inside the same transaction, computed onamount_infor a buy and on the SOL pump.fun pays out for a sell. No treasury token account is created and nocarbium fee:line is logged. See Pump.fun Curve Quotes (fft).
Verify after landing
- Treasury ATA balance increases by
floor(quoted_out * fee_bps / 10000). - User destination balance increases by
delivered_outminusexpected_fee. - Program log contains
carbium fee: <bps> bps to treasury. - On a
pump-curveanswer: the treasury wallet's SOL balance increases byfloor(base * fee_bps / 10000), wherebaseisamount_inon a buy androutePlan[0].swapInfo.outAmounton a sell.
New improved quote endpoint. Returns a detailed quote and transaction package for performing a token swap. The response includes calculated output amounts, slippage, routing plan and a serialized transaction ready to be submitted to the blockchain.
Base URL · https://api.carbium.io/api/v2
Query parameters
| Name | Type | Req | Description |
|---|---|---|---|
| src_mint | string | REQUIRED | Input token address
· default So11111111111111111111111111111111111111112 |
| dst_mint | string | REQUIRED | Output token address
· default AT79ReYU9XtHUTF5vM6Q4oa9K8w7918Fp5SU7G1MDMQY |
| amount_in | integer | REQUIRED | Input amount (in smallest units / lamports)
· default 1000000000 |
| slippage_bps | integer | REQUIRED | Slippage tolerance (in basis points, e.g. 50 = 0.5%)
· default 50 |
| user_account | string | OPTIONAL | User wallet address (if included, the response returns a base64 txn) |
| treasury | string | OPTIONAL | Treasury address for fee collection |
| fee_bps | integer | OPTIONAL | Fee in basis points (e.g. 30 = 0.3%) |
| fft | integer | OPTIONAL | Set to 1 to price SOL / pump.fun bonding-curve pairs on the live curve and get a transaction that trades on pump.fun directly. Other pairs use normal routing. |
Try it
no key You can test without an API key. If you prefer, use your own key.
Request
Response
curl --request GET \
--url 'https://api.carbium.io/api/v2/quote?src_mint=So11111111111111111111111111111111111111112&dst_mint=AT79ReYU9XtHUTF5vM6Q4oa9K8w7918Fp5SU7G1MDMQY&amount_in=1000000000&slippage_bps=50' \
--header 'X-API-KEY: <your-api-key>'const res = await fetch("https://api.carbium.io/api/v2/quote?src_mint=So11111111111111111111111111111111111111112&dst_mint=AT79ReYU9XtHUTF5vM6Q4oa9K8w7918Fp5SU7G1MDMQY&amount_in=1000000000&slippage_bps=50", {
headers: { "X-API-KEY": "<your-api-key>" },
});
console.log(await res.json());import requests
res = requests.get(
"https://api.carbium.io/api/v2/quote",
params={"src_mint": "So11111111111111111111111111111111111111112", "dst_mint": "AT79ReYU9XtHUTF5vM6Q4oa9K8w7918Fp5SU7G1MDMQY", "amount_in": "1000000000", "slippage_bps": "50"},
headers={"X-API-KEY": "<your-api-key>"},
)
print(res.json()) Response shape
{
"success": true,
"data": {
"amount_out": "...",
"slippage_bps": 50,
"route": [ ... ],
"transaction": "<base64-encoded-transaction>"
}
} Returns the USD value of the source and destination amounts for a swap. Internally reuses the v2 /quote and CQ1 rates to derive prices.
Base URL · https://api.carbium.io/api/v2
Query parameters
| Name | Type | Req | Description |
|---|---|---|---|
| src_mint | string | REQUIRED | Source token mint address
· default So11111111111111111111111111111111111111112 |
| dst_mint | string | REQUIRED | Destination token mint address
· default EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v |
| amount_in | integer | REQUIRED | Input amount (in smallest units / lamports)
· default 1000000000 |
| slippage_bps | integer | REQUIRED | Slippage tolerance (in basis points, e.g. 50 = 0.5%)
· default 50 |
| user_account | string | OPTIONAL | User wallet address |
Try it
no key You can test without an API key. If you prefer, use your own key.
Request
Response
curl --request GET \
--url 'https://api.carbium.io/api/v2/quote-usd?src_mint=So11111111111111111111111111111111111111112&dst_mint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount_in=1000000000&slippage_bps=50' \
--header 'X-API-KEY: <your-api-key>'const res = await fetch("https://api.carbium.io/api/v2/quote-usd?src_mint=So11111111111111111111111111111111111111112&dst_mint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount_in=1000000000&slippage_bps=50", {
headers: { "X-API-KEY": "<your-api-key>" },
});
console.log(await res.json());import requests
res = requests.get(
"https://api.carbium.io/api/v2/quote-usd",
params={"src_mint": "So11111111111111111111111111111111111111112", "dst_mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "amount_in": "1000000000", "slippage_bps": "50"},
headers={"X-API-KEY": "<your-api-key>"},
)
print(res.json()) Response shape
{
"srcAmountUsd": 84.12,
"dstAmountUsd": 83.97
} Low level Solana access. Standard JSON-RPC, real time streams over WebSocket, and gRPC (Yellowstone) for high throughput subscriptions, all behind a separate RPC key (not the API key).
What's here
- RPC: standard Solana JSON-RPC (
getSlot,getBalance,getAccountInfo, …) over an HTTPSPOST. - WSS: subscribe to account and transaction changes in real time (
accountSubscribe,transactionSubscribe). The socket stays open and pushes notifications. - gRPC / HTTPS-gRPC: Yellowstone Geyser streams for the lowest latency and highest throughput.
Notes
- Use your RPC key, not the API key.
- WebSocket and gRPC keep a long lived connection. Reconnect on close and resubscribe.
- gRPC isn't callable from a browser. Use
grpcurlor a native client (Rust / Go).
Subscribe in real time to a Solana account's changes over WebSocket. Connect and send the accountSubscribe message; you'll receive an accountNotification on each change.
Base URL · wss://wss-rpc.carbium.io/?apiKey=
Try it
Request
Response
wscat -c wss://wss-rpc.carbium.io/?apiKey=
# luego envía:
> {"jsonrpc":"2.0","id":1,"method":"accountSubscribe","params":["So11111111111111111111111111111111111111112",{"encoding":"jsonParsed","commitment":"confirmed"}]}const ws = new WebSocket("wss://wss-rpc.carbium.io/?apiKey=");
ws.onopen = () => ws.send(JSON.stringify({"jsonrpc":"2.0","id":1,"method":"accountSubscribe","params":["So11111111111111111111111111111111111111112",{"encoding":"jsonParsed","commitment":"confirmed"}]}));
ws.onmessage = (e) => console.log(e.data); Response shape
{"jsonrpc":"2.0","method":"accountNotification","params":{"subscription":1,"result":{"context":{"slot":12345678},"value":{"lamports":1000000000}}}} gRPC stream (Yellowstone Geyser) of Solana accounts and transactions. Not testable from the browser: copy the grpcurl command and run it in your terminal.
Base URL · grpc.carbium.io/?apiKey=0197123c-801c
gRPC streams over HTTP/2 and a binary protocol, so a browser tab can't open them — but it takes one command from your machine:
-
Install
grpcurl(or use a native client in Rust, Go or Node). -
Copy the grpcurl snippet below and pass your RPC key in the
x-tokenmetadata. -
Point it at the server above and stream with the Yellowstone
Subscribemethod.
# gRPC — Not testable from the browser
grpcurl -d '{}' \
grpc.carbium.io/?apiKey=0197123c-801c \
geyser.Geyser/Subscribe Response shape
{"filters":["accounts"],"account":{"pubkey":"...","lamports":"1000000000","owner":"..."}} gRPC over HTTP/2 (same Yellowstone service). Not testable from the browser: use grpcurl with your .proto.
Base URL · https://grpc.carbium.io
gRPC streams over HTTP/2 and a binary protocol, so a browser tab can't open them — but it takes one command from your machine:
-
Install
grpcurl(or use a native client in Rust, Go or Node). -
Copy the grpcurl snippet below and pass your RPC key in the
x-tokenmetadata. -
Point it at the server above and stream with the Yellowstone
Subscribemethod.
# HTTP/2 gRPC — Not testable from the browser
grpcurl -d '{}' \
grpc.carbium.io \
geyser.Geyser/Subscribe Response shape
{"filters":["transactions"],"transaction":{"signature":"...","slot":"12345678"}} Solana JSON-RPC via Carbium RPC. The tester sends a live POST with the body below.
Base URL · https://rpc-service.carbium.io/?apiKey=
Try it
Request
Response
curl --request POST \
--url 'https://rpc-service.carbium.io/?apiKey=' \
--header 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"getSlot"}'const res = await fetch("https://rpc-service.carbium.io/?apiKey=", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({"jsonrpc":"2.0","id":1,"method":"getSlot"}),
});
console.log(await res.json());import requests
res = requests.post("https://rpc-service.carbium.io/?apiKey=", json={"jsonrpc":"2.0","id":1,"method":"getSlot"})
print(res.json()) Response shape
{"jsonrpc":"2.0","result":12345678,"id":1} The full Carbium documentation | guides for the Swap API, RPC, Data and the wider stack. Browse by topic below open any page for the complete walkthrough.
Overview 11
- Official Links Verify Carbium official product, documentation, support, social, blog, and community links from one trusted docs page.
- Migrating to Carbium Choose the right migration path into Carbium, separate standard RPC swaps from provider-specific products, and cut over in a safer order.
- FAQ Find current answers about Carbium RPC, Swap API, DEX, Data, official links, support, pricing, and safe onboarding paths.
- Helius Alternatives: Migrating to Carbium RPC Move standard Solana RPC traffic from Helius to Carbium, map auth and streaming endpoints, and identify which Helius-specific APIs need a separate migration plan.
- Quick Start API Start with Carbium Swap API: create a key, make one authenticated quote request, then move into Q1, execution, pricing, or production guides.
- Migrate from Jupiter to Carbium Move a Jupiter-centered Solana swap integration to Carbium by mapping quote parameters, signing boundaries, execution ownership, and rollback checks.
- Migrate from QuickNode to Carbium Replace standard QuickNode Solana RPC traffic with Carbium, map the auth and endpoint changes, and separate Streams, Yellowstone, and Metis before cutover.
- Carbium - Unified Blockchain Systems Start from the Carbium ecosystem overview: DEX, Swap API, RPC, and Data docs, with the right quick-start path for each Solana workflow.
- Quick Start RPC Start using Carbium RPC in minutes: create a key, copy your endpoint, run a first Solana JSON-RPC call, and follow the right next page for pricing, testing, or production hardening.
- Quick Start DEX Start swapping on Carbium DEX in minutes. Open the app, connect a Solana wallet, review the route, and move into gasless or deeper DEX docs only when needed.
- Support Get Carbium support faster: choose the right help path, include useful debugging context, and use the official Discord, FAQ, status, and docs links.
DEVELOPMENT 26
- Developing With Carbium Start building on Carbium with practical integration guides for wallets, swaps, RPC-backed flows, and production-safe application patterns.
- Sample Applications Explore practical sample apps built with Solana, Carbium RPC and APIs. Learn how to fetch data, run swaps, and automate Solana workflows with ready code.
- Build a Solana Arbitrage Quote Engine Build a Solana quote scanner that checks round-trip routes with Carbium Q1 before you decide whether execution is worth wiring in.
- Developing with Carbium Carbium on Solana is both coder and Ai friendly. Learn from our simple snippets or harness natural language workflows to build on Carbium.
- Carbium Auth Matrix See which Carbium key, endpoint, and auth format belongs to RPC, gRPC, and Swap API before you wire the wrong credential into production.
- API Key Security Best Practices Protect Carbium RPC and Swap API keys with environment variables, endpoint restrictions, key rotation, and safer server-side patterns.
- Carbium for Trading Bots Build Solana trading bots on Carbium with the right split between RPC, Swap API, CQ1-backed quote flows, gRPC streaming, and production-safe key handling.
- Carbium for Wallet Developers Build wallet flows with Carbium RPC, Swap API, and Token Index data while keeping signing, API keys, token metadata, and transaction relay on the right side of the client/backend boundary.
- getProgramAccounts Without Melting Your App Use Solana getProgramAccounts safely with filters, data slices, slot context, caching, and clear handoffs to streaming when raw RPC is the wrong tool.
- Safe RPC Failover Checklist Add backup Solana RPC paths without creating stale reads, duplicate transaction sends, or noisy health checks that hide the real failure.
- Solana Core Concepts Learn the Solana building blocks—accounts, programs, instructions, and transactions—and how applications use RPC to read data and submit transactions.
- Solana Development Use Carbium's Solana development hub to choose the right foundation page before moving into RPC, Swap API, Data, wallet, bot, or production guides.
- Transaction Lifecycle Follow a Solana transaction from message construction to confirmation, with Carbium handoffs for quotes, signing, RPC submission, blockhash recovery, and post-send debugging.
- Carbium Cookbook: Runnable RPC and Swap API Recipes Nine runnable Node.js recipes for Carbium Solana RPC and Swap API integrations, continuously verified against live endpoints in CI.
- Learn to Code with AI Use AI assistants with Carbium docs safely: give them the right product context, ask for verifiable Solana code, and validate every RPC or Swap API step before production.
- AI Coding Practices Understand how to validate AI-generated code, simulate transactions, and maintain safety in production. These principles keep your projects secure,…
- Get Balance with Carbium Fetch a Solana wallet balance through Carbium RPC with curl or Python, using the current endpoint and a safe server-side key pattern.
- Automated Market Making Explained Understand how automated market makers price Solana swaps, why liquidity depth and slippage matter, and where Carbium routing fits in the trade path.
- Sending Transactions through Carbium RPC Relay user-signed swap transactions through Carbium RPC with a safer backend flow, cleaner signing boundaries, and confirmation checks that avoid duplicate sends.
- Executing Swaps Execute a Carbium swap from executable Q1 quote to wallet approval, RPC submission, confirmation, and production retry handling without exposing API keys or signing material.
- Jito Bundles for Solana Swap Backends Decide when a Solana swap backend should use a normal send, priority fees, or a Jito-style bundle handoff through Carbium's documented swap execution path.
- Gasless Token Swap Build a backend-assisted gasless swap flow with Carbium's documented v1 swap surface while keeping API keys server-side and user signing inside the wallet.
- Solana Commitment Levels Choose processed, confirmed, or finalized commitment for Solana balance reads, swap confirmations, trading bots, dashboards, and settlement flows.
- Blockhash Expiry Recovery Playbook Recover safely from Solana blockhash expiry by deciding when to refresh, rebuild, re-sign, check signature status, and avoid duplicate submissions.
- Debug Solana Transaction Simulation Read a failed Solana transaction from simulateTransaction and preflight logs, and tell a signer problem apart from a routing or RPC problem.
- Quote to Swap Integration Guide Build a backend-safe Carbium swap flow from quote request to signed submission by separating API auth, signing boundaries, RPC relay, and confirmation checks.
Carbium API 17
- Legacy v1 Quote Guide Use Carbium's legacy v1 Quote API for provider-specific quote checks, response interpretation, and deciding when to use All Quote, Q1, or Swap.
- Legacy v1 All Quote Guide Use Carbium's legacy v1 All Quote API to compare provider-specific quote results, interpret route misses, and decide when to move into transaction building.
- Carbium Swap API Start from Carbium Swap API: choose the right quote and execution path, route wallet or bot builds into the right guides, and avoid mixing request families.
- Swap API Request Families Choose the correct Carbium Swap API request family before you debug parameters, route misses, missing transaction payloads, or v1/v2 migration issues.
- 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.
- CQ1 Data Layer The data layer ensures the routing engine always operates on fresh, queryable state. It combines binary native storage with real time ingestion to…
- CQ1 Routing Engine The routing engine is responsible for finding optimal swap paths across all supported liquidity sources. It combines massively parallel path evaluation…
- Custom Fee Build a standalone custom-fee transaction with Carbium's documented v1 fee endpoint, then sign and submit it through your normal transaction flow.
- CQ1 Overview The Carbium Quote 1 (CQ1) Engine is a high performance DEX aggregation system designed for sub millisecond quote generation on Solana. It combines…
- Get your API key Create a Carbium Swap API key, verify the right auth header, and make your first authenticated quote request without mixing it up with the RPC key.
- Swap API Pricing, Limits, and Quotas Choose the right Carbium Swap API plan by comparing published request ceilings, public per-swap pricing, and the point where custom terms start.
- 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.
- Pump.fun Curve Quotes (fft) Use fft=1 on Q1 to price SOL pairs with pump.fun tokens on their live bonding curve and get back a transaction that trades on pump.fun directly.
- Q1 Use Carbium Q1 to request live Solana swap quotes and, when needed, an executable transaction payload from the current /api/v2/quote flow.
- Swap Use the documented v1 Swap endpoint to build a provider-specific base64 transaction, understand required parameters, and avoid mixing it with the newer Q1 quote flow.
- Supported DEXs and Routing Sources Understand the current Solana liquidity sources Carbium can route through, why route availability changes by pair and size, and why new integrations should use the CQ1-backed v2 Swap API flow instead of legacy v1 routes.
- Txn Bundle Submit a signed Swap API transaction through Carbium's documented bundle path, understand the signedTransaction handoff, and avoid treating bundle submission as a signing step.
Carbium DEX 7
- Bulk-token Manager Bulk token manager enables users to organize, transfer, and interact with multiple tokens in bulk within a single interface.
- Referrals Earn rewards effortlessly by inviting others to join Carbium and grow the Solana ecosystem together.
- New Pairs Use New Pairs to evaluate newly visible Solana trading opportunities in Carbium DEX without skipping quote, mint, route, or wallet checks.
- In-Depth DEX Understand where Carbium DEX fits: browser swaps, gasless onboarding, API handoff, and the right next page for each Solana trading workflow.
- Gasless Swaps Use Carbium Gasless Swaps when a Solana user needs to swap without already holding SOL for the network fee.
- Carbium Mobile Experience Use Carbium DEX from a mobile browser: connect a Solana wallet, review the quote and wallet prompt, and know when to move into gasless or desktop/API docs.
- Swap on Carbium DEX Use the Carbium DEX swap screen to connect a Solana wallet, review the route, sign in-wallet, and decide when to move into gasless or API docs.
Carbium RPC 19
- Solana RPC Testing Checklist Before Production A practical checklist for testing a Solana RPC integration: verify reads, error handling, retry behaviour, traffic shape, and production readiness before real users depend on it.
- Carbium RPC Usage Monitoring The Usage page provides real time visibility into your Carbium RPC activity. You always know exactly how your infrastructure performs.
- How to Benchmark Solana RPC Providers: Latency, Errors, and Slot Freshness Compare Solana RPC endpoints with a repeatable test plan for method latency, error rate, success rate, and slot freshness. Learn what to measure, how to avoid misleading results, and how to use findings in production.
- RPC Dashboard Use the Carbium RPC Dashboard to view your account, plan, billing cycle, API usage, and remaining credits.
- RPC Pricing and Usage Tiers Choose the right Carbium RPC plan by comparing monthly credits, throughput caps, and when Business-tier gRPC starts to matter.
- Solana JSON-RPC Methods and Read-Only Calls Which Solana JSON-RPC method to call for each job, and which ones only read state: getBalance, getAccountInfo, getTokenAccountsByOwner, getProgramAccounts.
- Solana gRPC Streaming with Carbium Connect to Carbium's documented Solana streaming endpoints with the right client path, auth format, and production checks for Yellowstone-style gRPC.
- Carbium vs Helius vs QuickNode RPC Carbium, Helius and QuickNode compared on pricing model, streaming path and migration risk, with a short verdict and a migration risk matrix.
- Carbium RPC Understand where Carbium RPC fits in a Solana stack, which endpoint to use, and which deeper setup, pricing, rate-limit, or streaming page to read next.
- RPC Errors Reference Triage Carbium RPC authentication, rate-limit, JSON-RPC, and Solana transaction errors without guessing which layer failed.
- What Is Solana RPC? A practical introduction to Solana RPC: how applications read and submit on-chain data, and what to consider when moving from development to production.
- Get Your API Key Before you can make requests to Carbium RPC, you’ll need an API key. Here’s how to generate yours in seconds
- Solana RPC Rate Limits and 429 Retries What a 429 from a Solana RPC actually means, what triggers one, and the retry pattern that recovers without making the spike worse.
- Payment Methods Understand how Carbium RPC payment and credit activation fit into the plan choice, dashboard, API-key, and production rollout workflow.
- Status and Metrics Use Carbium RPC status, dashboard, and usage signals to separate normal traffic, rate-limit pressure, and incidents.
- GRPC Use Cases Strategic applications for Carbium's Layer 2 Full Block streams. Optimized for indexing, sophisticated trading, and MEV.
- Get Your Endpoint Get your free Solana RPC endpoint from Carbium. Connect instantly, generate an API key, and start building with the most price efficient RPC on Solana.
- Solana RPC Node Is Behind When a Solana RPC reports it is behind the cluster tip: probe slot freshness in one call, then decide which reads are still safe to serve.
- Your First Test Call You can test any Carbium RPC endpoint and method directly from your dashboard. How to Run a Test Call
Carbium Data 7
- Quick Start Data Make your first Carbium Data calls: search tokens, resolve one mint, batch resolve multiple mints, and load cached token logos from the public REST API.
- Solana Token Data API Use Cases Build Solana token search, wallet and portfolio views, batch mint lookups, token-logo delivery, dashboards, and agent workflows with Carbium Data's Token Index API.
- Build a Token Selector With Carbium Data Build a production-friendly Solana token selector with Carbium Data: debounced search, batch mint hydration, cached logos, nullable metadata, and rate-limit-safe client behavior.
- Token API Calls Call the public Carbium Token Index API: search tokens, resolve a mint, batch resolve up to 500 mints, and fetch cached token logos.
- Carbium Data Errors and Limits Handle Carbium Data token search misses, unknown mints, invalid batch requests, cached logo fallbacks, route limits, and HTTP 429 responses without breaking a wallet, bot, dashboard, or token selector.
- Data Rate Limits Understand Carbium Data public route limits, how to avoid 429 responses, when to batch requests, and how to design a production-friendly cache.
- Carbium Data Carbium Data is the public token data layer for Solana builders: search, mint lookup, batch resolves, metadata enrichment, and cached token logos through a free rate-limited REST API.