Prime API vs. Stableswapper: This page covers the Prime API path, which operates through Coinbase Prime’s centralized infrastructure. If you need to swap tokens directly onchain (without Prime), see the Stableswapper Quickstart instead.
Prerequisites
- A Coinbase Prime account with API credentials configured. See the Prime Quickstart for setup instructions.
- Your portfolio ID and wallet ID. See Wallets for how to retrieve these.
Creating a conversion
Use the Create Conversion endpoint to convert between USDC and your custom stablecoin. ReplaceCBTUSD with your custom stablecoin symbol.
- Python
- TS/JS
Tracking a conversion
Use the transaction ID returned by the Create Conversion endpoint to track its status via Get Transaction by ID. Conversions typically reach a terminal state within a few seconds. For code examples on tracking transactions, see the Prime Conversions guide.What to read next
Prime Withdrawals
Withdraw converted custom stablecoins to an onchain wallet
Stableswapper Quickstart
Swap tokens directly onchain via the Stableswapper program