# API Details

## API Keys

All calls require an API Key. Contact us to get one. Include this API Key in the `X-API-KEY` header of all requests to our service.

## Chain Options

For API calls that require a chain name, the available chain names are: `ETHEREUM`, `VECHAIN`, `BSC`, `MATIC`, `BASE`, `OPTIMISM`.

### API Endpoints

* GET /swaps: Returns swap details. Must contain a query string of `?swapId=345...` or `?firstAddress=0x123...&firstChain=VECHAIN&secondAddress=0x234...&secondChain=ETHEREUM`
* **POST /swaps:** Create a Swap. Payload is&#x20;

  ```
  SwapDetails {
    sourceChain: ChainName;
    sourceContractId: string; // prefixed with 0x
    sourceSender: string; // prefixed with 0x
    targetChain: ChainName;
    targetTokenAddress: string; // prefixed with 0x
    targetReceiver: string; // prefixed with 0x
    sourceFeeTx: string; // prefixed with 0x
    targetFeeTx: string; // prefixed with 0x
  }
  ```
* **GET /gas-estimates:** Shows the required fees for a Swap. Requires query string of `?sourceChain=VECHAIN&targetChain=ETHEREUM`
* **GET /tokens:** Shows the available tokens for swapping.


---

# 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://docs.safeswap.io/builders/api-integration-guide/api-details.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.
