> For the complete documentation index, see [llms.txt](https://city-protocol.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://city-protocol.gitbook.io/docs/software-development-kit/swap/getting-started.md).

# Getting Started

#### API Base URL

By default, the client uses `CITY_SWAP_API_URL` (currently `https://www.okx.com`). You can override it via the constructor:

```
const swapClient = new CitySwapClient({
  baseUrl: "https://www.okx.com",
});
```

#### Amount Input

All swap methods accept either a minimal-unit integer (`amount` as `string` or `bigint`) or a human-readable decimal string (`readableAmount`). When using `readableAmount`, you must also provide either `tokenDecimals` per call, or a `resolveTokenDecimals` function in the constructor.

```
const swapClient = new CitySwapClient({
  credentials,
  resolveTokenDecimals: async ({ tokenAddress, chainIndex }) => {
    const token = await getTokenMetadata(tokenAddress, chainIndex);
    return token.decimals;
  },
});
```
