Natural language prompts you can send to any AI assistant with gmgn-cli skills installed:
```
buy 0.1 SOL of <token_address>
sell 50% of <token_address> on BSC
check order status <order_id>
is <token_address> safe to buy on solana?
show top holders of <token_address>
show my wallet holdings on SOL
query token details for 0x1234...
show trading stats for wallet <wallet_address> on BSC
```
---
## Setup
### 0. Prepare
Before applying for an API Key, get two things ready:
**Generate an Ed25519 key pair**
Download and run the [Binance Asymmetric Key Generator](https://github.com/binance/asymmetric-key-generator/releases). You will need the **public key** when filling out the API Key application, and the **private key** in your `.env` later (for swap / order).
**Get your public egress IP** (for the IP whitelist)
```bash
curl ip.me
```
Or visit **https://ip.me** in your browser.
### 1. Get an API Key
Apply at **https://gmgn.ai/ai** — enter the public key and your IP address from the step above.
### 2. Configure
**Option A — Global config (recommended)**
Create `~/.config/gmgn/.env` once — works from any directory:
```bash
mkdir -p ~/.config/gmgn
cat > ~/.config/gmgn/.env << 'EOF'
GMGN_API_KEY=your_api_key_here
# Required for swap / order (private key from step 0):
Default: formatted JSON. Use `--raw` for single-line JSON (pipe-friendly):
```bash
npx gmgn-cli token info --chain sol --address <addr> --raw | jq '.price'
```
---
## Security & Disclaimer
**About `GMGN_PRIVATE_KEY`**
`GMGN_PRIVATE_KEY` is a **request-signing key** used to authenticate API calls to the GMGN OpenAPI service. It is not a blockchain wallet private key and does not directly control on-chain assets. If compromised, an attacker could forge authenticated API requests on your behalf — rotate it immediately via the GMGN dashboard if you suspect exposure.
- Never commit your `.env` file to version control — add it to `.gitignore`
- Do not share `GMGN_API_KEY` or `GMGN_PRIVATE_KEY` in logs, screenshots, or chat messages
- Use a pinned install (`npm install -g gmgn-cli@1.0.1`) rather than `npx gmgn-cli` to avoid executing unintended package updates alongside your credentials
**Disclaimer**
Use of this tool and any financial decisions made based on its output are entirely at your own risk. GMGN is not liable for any trading losses, errors, or unauthorized access resulting from improper credential management.
The npm package is published with provenance attestation, linking each release to a specific git commit and CI pipeline run. Verify with: