# 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;
  },
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://city-protocol.gitbook.io/docs/software-development-kit/swap/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
