Practical overview
When it fits
Use it when you are building with the OKX DEX API and want TypeScript scripts and a documented Node.js workflow for specific network operations.
Who it is for
- Developers integrating OKX DEX API operations into Node.js or TypeScript projects.
- Builders who need examples for single-chain quotes, swap-related data or cross-chain DEX requests.
- Developers adapting network-specific DEX scripts for applications or services.
Documented uses
- Request swap quotes using chain IDs, token addresses, amount and slippage parameters.
- Retrieve token, chain, liquidity and bridge information through the provided scripts.
- Explore cross-chain quote operations and the repository’s documented Solana swap command.
- Use the shared authentication utility to generate signed headers for OKX API requests.
Requirements & limits
The repository is public and provides Git clone instructions. Its setup requires OKX API credentials; a Web3 wallet is listed for generating those credentials.
- Requires Node.js 20.17.0 or later, Git and npm.
- API authentication uses a project ID, API key, secret key and passphrase.
- The README shows wallet address and private key environment values; protect secrets and avoid committing the
.envfile. - Quote requests need valid chain and token addresses, an amount in the token’s smallest unit and a slippage parameter.
- The README identifies EVM, Solana, TON and TRON, and says EVM scripts accept valid EVM chain IDs.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Request a Solana swap quote using the documented example
Generate authenticated headers and send the example SOL-to-USDC quote request.
Before you start
- The repository setup and required OKX credentials, including project ID, API key, secret key, and passphrase
- A Solana quote request using chain ID
501and token addresses shown in the README
Steps
Set the request parameters to chain ID
501, wrapped SOL as the source token, USDC as the destination token, amount10000000000in lamports, and slippage0.1.Create an ISO timestamp and set the request path to
/api/v5/dex/aggregator/quote; serialize the parameters as a query string.Use the shared
getHeadersutility with the timestamp,GETmethod, request path, and query string to generate signed headers.Send a
GETrequest tohttps://www.okx.comfollowed by the request path and query string, using the generated headers.
Expected outcome
The example sends an authenticated Solana quote request to the OKX DEX API; the README identifies `lib/solana/swap/solana-quote.ts` as the complete implementation.
Guide limitations
- The documented example shows how to send the request but does not provide a verified response or guarantee a quote.
- The example is a quote request, not a swap execution.
- The shared authentication utility requires the OKX credential environment variables.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 17 October 2026
- Original website title
- okx/dex-api-library · Official homepage title · retained in its source language

