> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gank.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# api overview

> programmatic access to gank

# api

base url: `https://gank.dev/api/v2`

## auth

```
Authorization: Bearer <jwt-token>
```

or api key:

```
X-API-Key: <api-key>
```

jwt from telegram auth. api keys for programmatic/ai access (restricted to ai-owned wallets).

## endpoint map

### wallets

| method   | endpoint                       | what                           |
| -------- | ------------------------------ | ------------------------------ |
| `POST`   | `/wallets`                     | create wallet                  |
| `PUT`    | `/wallets`                     | save/update wallet             |
| `GET`    | `/wallets/user`                | list wallets                   |
| `POST`   | `/wallets/balances`            | batch balance check            |
| `POST`   | `/wallets/token-balances`      | token balances                 |
| `GET`    | `/wallets/:id/balance`         | single wallet balance          |
| `GET`    | `/wallets/:id/assets`          | wallet token assets            |
| `POST`   | `/wallets/transfer`            | transfer sol                   |
| `POST`   | `/wallets/split`               | split sol to multiple wallets  |
| `POST`   | `/wallets/import`              | import wallet from private key |
| `DELETE` | `/wallets/:wallet_type/:id`    | delete wallet                  |
| `PATCH`  | `/wallets/:wallet_type/:id`    | update wallet metadata         |
| `POST`   | `/wallets/dev/:id/active`      | set active dev wallet          |
| `POST`   | `/wallets/vamp-all`            | vamp recovery                  |
| `POST`   | `/wallets/clean-funds/quote`   | privacy swap quote             |
| `POST`   | `/wallets/clean-funds/prepare` | prepare privacy swap           |
| `POST`   | `/wallets/clean-funds`         | initiate privacy swap          |
| `GET`    | `/wallets/clean-funds/status`  | check swap progress            |
| `GET`    | `/wallets/clean-funds/history` | swap history                   |

### trading (phases)

| method | endpoint                    | what                       |
| ------ | --------------------------- | -------------------------- |
| `POST` | `/phases/regular/buy`       | buy token (regular wallet) |
| `POST` | `/phases/regular/sell`      | sell token                 |
| `POST` | `/phases/swarm/buy`         | swarm buy (multi-wallet)   |
| `POST` | `/phases/swarm/sell`        | swarm sell                 |
| `POST` | `/phases/swarm/consolidate` | consolidate wallets        |
| `POST` | `/phases/volume/start`      | start volume bot           |
| `POST` | `/phases/volume/stop`       | stop volume bot            |
| `POST` | `/phases/vamp/execute`      | vamp all to destination    |

### launch

| method   | endpoint                 | what                 |
| -------- | ------------------------ | -------------------- |
| `POST`   | `/launch`                | launch token         |
| `GET`    | `/launch/history`        | launch history       |
| `GET`    | `/launch/:id`            | launch details       |
| `GET`    | `/launch/:id/wallets`    | launch wallets       |
| `GET`    | `/launch/by-token/:mint` | launch by token mint |
| `GET`    | `/launch/configs`        | saved launch configs |
| `PUT`    | `/launch/configs`        | save launch config   |
| `DELETE` | `/launch/configs/:name`  | delete launch config |
| `POST`   | `/launch/reserve-mint`   | reserve vanity mint  |

### positions & tokens

| method | endpoint                        | what                |
| ------ | ------------------------------- | ------------------- |
| `GET`  | `/user/positions`               | all token positions |
| `GET`  | `/user/trade-history`           | trade history       |
| `GET`  | `/token/:mint`                  | token info          |
| `GET`  | `/token/:mint/ohlcv/:timeframe` | ohlcv candles       |
| `GET`  | `/search`                       | search tokens       |

### fees

| method | endpoint              | what                  |
| ------ | --------------------- | --------------------- |
| `GET`  | `/fees/preferences`   | fee preferences       |
| `POST` | `/fees/preferences`   | save fee preferences  |
| `GET`  | `/fees/network`       | network fee estimates |
| `GET`  | `/fees/creator`       | creator fee balance   |
| `POST` | `/fees/creator/claim` | claim creator fees    |

### sniper

| method   | endpoint            | what                  |
| -------- | ------------------- | --------------------- |
| `PATCH`  | `/sniper/config`    | update sniper config  |
| `POST`   | `/sniper/watchlist` | add to watchlist      |
| `DELETE` | `/sniper/watchlist` | remove from watchlist |
| `POST`   | `/sniper/execute`   | execute snipe         |

### copy trading

| method   | endpoint             | what          |
| -------- | -------------------- | ------------- |
| `GET`    | `/copytrade`         | list configs  |
| `POST`   | `/copytrade`         | create config |
| `PATCH`  | `/copytrade`         | update config |
| `DELETE` | `/copytrade`         | delete config |
| `POST`   | `/copytrade/execute` | execute copy  |

### api keys

| method   | endpoint            | what           |
| -------- | ------------------- | -------------- |
| `GET`    | `/api-keys`         | list api keys  |
| `POST`   | `/api-keys`         | create api key |
| `DELETE` | `/api-keys/:key_id` | revoke api key |

## responses

success:

```json theme={null}
{ "success": true, ... }
```

errors:

```json theme={null}
{ "success": false, "error": "what went wrong" }
```
