A gmgn api key is issued at gmgn.ai/ai, GMGN's developer registration page, and it works differently from the bearer tokens most crypto APIs hand out. You generate an Ed25519 key pair yourself, bind the public half to your GMGN account, and GMGN gives you a key identifier. Every request is then signed with your private key. Registration is free; only trades cost money, at GMGN's flat 1%.
This guide walks through how to get a GMGN API key from a blank account to a signed request, what the public demo key is for, how to store and revoke keys, and the errors people hit most. It is an independent guide; GMGN AI App Guide is not affiliated with GMGN. For what the API actually exposes, read the GMGN API overview first.
What you need before you start
- A GMGN account. Any login method works for the web terminal (Telegram, Google, email/password, Phantom, MetaMask), but remember that Telegram login and Phantom login create separate accounts that do not merge. Pick the account whose wallet you want the API to trade from. Details in GMGN login.
- A funded GMGN wallet if you intend to trade. Data-only use needs no balance.
- A machine with a tool that can generate Ed25519 keys: OpenSSL,
ssh-keygen, thelibsodium/tweetnacl/cryptographylibraries, or the helper included with the official gmgn-cli. - Google Authenticator 2FA already set up on the account. It is not strictly required to obtain the key, but it is mandatory for withdrawals and you want it enabled before you give any software trading access.
How to get a GMGN API key: step by step
Step 1: Open gmgn.ai/ai and sign in
Navigate directly to gmgn.ai/ai. Type the address yourself rather than following links from Telegram groups or search ads; known typosquats such as app-gmgn-ai.com and gmgn-app.at exist, and the API registration page is exactly the kind of page a phishing clone would copy. The GMGN phishing check guide lists the domains that are actually official.
If you see a Cloudflare "Just a moment..." page, that is GMGN's bot check, not an error. Wait, refresh, and disable aggressive VPN or ad-block settings if it loops.
Step 2: Generate an Ed25519 key pair locally
Do this on your own machine. Never use an online key generator for a key that will control trades.
Illustrative commands (check your tool's docs for exact flags):
# OpenSSL (illustrative)
openssl genpkey -algorithm ed25519 -out gmgn_private.pem
openssl pkey -in gmgn_private.pem -pubout -out gmgn_public.pem
You now have two files. The public key is what you give GMGN. The private key is what signs requests and must never be uploaded anywhere, pasted into a chat, or committed to a repository. GMGN's registration form may ask for the public key in a specific encoding (raw base64 or hex rather than PEM); follow the format the page specifies.
Step 3: Bind the public key and receive your API key
On gmgn.ai/ai, paste the public key into the registration form and submit. GMGN binds it to your account and displays an API key identifier. Copy it and store it with the private key. If the page offers an IP whitelist field, fill it in now with the static IP of the server that will run your agent; GMGN's docs describe rate limits and IP whitelist cooperation together, and a whitelisted key is both safer and less likely to be throttled.
Step 4: Make a signed test request
Sign a harmless read request, such as fetching token info on Solana, using your private key and the header scheme in docs.gmgn.ai/index/gmgn-agent-api. A 200 response with JSON confirms the binding works. If you use the official gmgn-skills or gmgn-cli, the tooling handles signing; you only supply the key files through configuration.
Step 5: Confirm what the key can and cannot do
Before pointing an agent at it, verify the boundaries yourself:
- It can read data and place trades on the bound account's wallets.
- It cannot withdraw. Withdrawals are website-only with 2FA, whitelisted addresses, a 3-hour hold after the first whitelist or an address change, and a 24-hour hold after re-binding 2FA.
- It cannot export private keys, because GMGN disabled key export on all chains around 19 March 2025.
What is the demo key gmgn_solbscbaseethmonadtron?
GMGN publishes a public demo key, gmgn_solbscbaseethmonadtron, so developers can test request and response formats without registering. The name spells out the chains it was meant to cover: Solana, BSC, Base, Ethereum, Monad, Tron.
| Property | Demo key | Your own key |
|---|---|---|
| Who can use it | Anyone | You (signature-verified) |
| Rate limits | Shared across all users; expect throttling | Per the docs, with higher limits via IP whitelist cooperation |
| Trading | Do not attempt; not tied to your funds | Trades your GMGN wallet balance |
| Stability | Can be rotated or disabled without notice | Stable until you revoke it |
| Suitable for | Reading response shapes during development | Everything else |
Use the demo key for exactly one purpose: confirming your client parses responses correctly. Then switch to your own key. Tutorials that hardcode the demo key in a trading bot are showing you a bot that cannot trade.
Is the GMGN API key free?
The key itself is free, and GMGN documents no paid API plan as of September 2026. What is not free is execution. Every buy and sell routed through the API pays the same flat 1% GMGN fee described on docs.gmgn.ai, with no surcharge for automation and no discount for API use. On Solana you also set a priority fee (0.0001–2 SOL) and optionally a tip for private nodes; those go to validators and Jito-style nodes, not GMGN, but they come out of your balance all the same.
For a bot trading small sizes, the priority fee dominates. GMGN's recommended 0.006 SOL for automated orders is 6% of a 0.1 SOL trade per leg. The full breakdown is in GMGN fees; the short version is that "gmgn api key free" is accurate for access and misleading for cost of use.
How to store your GMGN API key safely
The private key that pairs with your gmgn api key is a trading credential. Treat it the way you would treat exchange API keys with trade permission.
- Keep the private key out of source control. Add it to
.gitignorebefore the first commit. Public GitHub repos with leaked keys are scanned within minutes. - Use a secrets manager or environment variables. Load the key at runtime from a vault, an encrypted
.env, or the platform's secret store. Never bake it into a Docker image layer. - Restrict file permissions. On Unix,
chmod 600the private key file so only your user can read it. - Enable IP whitelisting. A stolen key that only works from your server's IP is far less useful to a thief.
- Fund the account for the strategy, not for storage. GMGN wallets are hosted with no key export; whatever balance the bot can see, a compromised key can trade away. Withdraw profits to a wallet you control on a schedule. See GMGN withdraw and export.
- One key per bot. If one deployment misbehaves or leaks, revoke that key alone.
- Never share the private key with AI assistants or support. GMGN support works through in-app tickets and the official Telegram group and will never need your private key. Anyone asking for it is running a scam.
How to revoke or rotate a GMGN API key
Rotation is simple because of the key-pair design:
- Generate a new Ed25519 key pair locally.
- Go to gmgn.ai/ai and bind the new public key.
- Remove or unbind the old public key.
- Update your bot's configuration to the new private key and restart it.
Once the old public key is unbound, GMGN cannot verify signatures made with the old private key, so every request from the leaked key fails. Rotate immediately if you suspect exposure, and rotate on a schedule anyway.
If you cannot access gmgn.ai/ai because your login itself is compromised, change the account password, re-bind 2FA (which triggers a 24-hour withdrawal hold, a useful side effect here), and contact support through the official channels described in GMGN support. For security incidents GMGN lists security@gmgn.ai.
Common GMGN API key errors and fixes
GMGN does not publish an exhaustive API error catalog separate from the trading error codes, so the table below combines documented trade codes with the generic HTTP failures that any signed-request API produces.
| Symptom | Likely cause | Fix |
|---|---|---|
| 401 / 403 on every request | Signature mismatch: wrong encoding, wrong bytes signed, or clock skew | Sign exactly the payload the docs specify; sync system time; confirm public key format at binding |
| 403 from a new server | IP not on your whitelist | Add the server IP at gmgn.ai/ai or remove the whitelist temporarily to confirm |
| 429 | Rate limit hit, or you are using the shared demo key | Back off with jitter, cache reads, switch to your own key |
| Cloudflare challenge HTML instead of JSON | You are calling gmgn.ai web endpoints, not papi.gmgn.ai | Use the documented API host; scraped endpoints are unsupported |
| B1 / trade_error_0x1 | Insufficient SOL for trade plus fees | Keep at least 0.05 SOL reserve; reduce size |
| B4 | Honeypot or blacklist, token unsellable | Screen with security checks before buying |
| C1 / 0x1e / 0x1773 | Slippage revert; gas and priority fee are burned | Raise slippage on volatile tokens; avoid blind retries |
| D1 / 0x28 | Liquidity pulled | Stop retrying; it is gone |
| order10006 / order10007 / order10008 | Pool under $500, buy over 20% of pool, or 100-order cap | Adjust size or cancel stale orders |
| order10013 / trade_error_40002700 | "No Available Router" | Costs nothing; see the troubleshooting page |
For the router error specifically, read GMGN No Available Router. For general outages, GMGN not working covers RPC and Cloudflare issues.
What limits apply to a GMGN API key?
Beyond rate limits, the account-level limits from GMGN's docs carry over to anything you do via API:
- Maximum 100 active limit orders per account.
- Auto-created TP/SL orders are valid for 24 hours.
- Copy trading is Solana-only, max 10 concurrent tasks, and requires Telegram login; it is a terminal feature, not an API-managed one.
- Anti-MEV requires a minimum 0.002 SOL priority fee plus 0.0001 SOL tip.
- Withdrawals: website only, 2FA mandatory, whitelist holds as described above.
Rate limits are described in the docs alongside IP whitelisting but without a fixed public number we could verify as of September 2026. Design for 429s from day one.
Key takeaways
- Get a GMGN API key by signing in at gmgn.ai/ai, generating an Ed25519 key pair locally, and binding the public key; registration is free.
- The private key signs every request and is effectively a trading credential for your hosted GMGN wallet. Store it in a secrets manager, whitelist your IP, and rotate it on any suspicion of exposure.
- The demo key gmgn_solbscbaseethmonadtron is for testing response formats only.
- The key cannot withdraw funds or export private keys, which caps the blast radius of a leak to the balance you keep on GMGN.
- Trades via the API pay the same 1% fee as the terminal; priority fees on small positions often cost more than the platform fee.
Once your key works, the fastest path to a useful agent is the official skills package: see GMGN skills, CLI and MCP. Before funding the account, read is GMGN safe for the custody picture. If you still need an account, start at Open GMGN, then come back to gmgn.ai/ai.
Frequently asked questions
How do I get a GMGN API key?
Sign in at gmgn.ai/ai with your existing GMGN account, generate an Ed25519 key pair locally, paste the public key into the registration form, and GMGN issues an API key bound to that public key. The private key stays with you and is used to sign every request.
Is the GMGN API key free?
Yes. As of September 2026 GMGN does not charge for registering or issuing an API key and documents no paid API tier. Trades executed through the API still pay GMGN's flat 1% fee on each buy and sell, plus whatever priority fee and tip you set.
What is the GMGN demo API key?
GMGN publishes a shared demo key, gmgn_solbscbaseethmonadtron, so developers can test request formats without registering. It is public, shared by everyone, and rate limited. Never use it for real trades or in production.
Can I use a GMGN API key to withdraw funds?
No. Withdrawals on GMGN require the website with Google Authenticator 2FA and whitelisted addresses. The API key can trade the balance in your GMGN wallet but cannot move it out, which limits the damage if the key leaks.
How do I revoke a GMGN API key?
Return to gmgn.ai/ai, remove or unbind the compromised key, and bind a freshly generated Ed25519 public key. Because GMGN verifies signatures against the bound public key, unbinding it invalidates every request signed with the old private key.
Open the official terminal, install the iOS or Android app, or start with the Telegram bot. Keep only trading capital in the wallet.
Sources: GMGN documentation, DefiLlama, official app store listings and GMGN's public channels. See our methodology. Last reviewed 2026-09-22.