Loading...
Loading...
Help users set up authentication for the Alph.ai trading API. Use when user needs to "login", "authenticate", "set up cookie", "configure access", or before calling any authenticated API endpoints like trading or order management.
npx skill4agent add ben-alph-ai/crypto-trading-api auth-helperdex_cookiedex_cookiedex_cookie1. User logs in at https://www.alph.ai
2. Browser receives dex_cookie from server
3. User copies dex_cookie value
4. Agent uses it in API calls as: Cookie: dex_cookie=<value>dex_cookie1. Open https://www.alph.ai in your browser
2. Log in to your account
3. Press F12 to open Developer Tools
4. Go to Application tab → Cookies → www.alph.ai
5. Find "dex_cookie" in the list
6. Copy the Value (it looks like: NWMx...NA==)1. After login, press F12 → Network tab
2. Click any page that loads data
3. Click any API request (to b.alph.ai)
4. In Request Headers, find "Cookie:"
5. Copy the dex_cookie=... value# Add to your shell profile (~/.zshrc or ~/.bashrc)
export ALPH_DEX_COOKIE="NWMxMmEwN2Qt...NA=="
# Reload
source ~/.zshrc# Store in a file with restricted permissions
echo "NWMxMmEwN2Qt...NA==" > ~/.alph_cookie
chmod 600 ~/.alph_cookie
# Read when needed
export ALPH_DEX_COOKIE=$(cat ~/.alph_cookie)# Store
security add-generic-password -a "alph-ai" -s "dex-cookie" -w "NWMxMmEwN2Qt...NA=="
# Retrieve
export ALPH_DEX_COOKIE=$(security find-generic-password -a "alph-ai" -s "dex-cookie" -w)# Test with a simple authenticated endpoint
curl -s -X POST "https://b.alph.ai/smart-web-gateway/order/statistic" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{"chain":"sol"}'{
"code": "200",
"data": {
"code": 200,
"orderCount": 638,
"success": true
}
}{
"code": "403",
"msg": "token error"
}curl -s "https://b.alph.ai/smart-web-gateway/..." \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" -H "Content-Type: application/json" \
-d '{"chain":"sol", ...}'UUID + timestamp5c12a07d-6db2-404d-88e3-2832a084d3811771918855874==dex_cookie{"code":"403","msg":"token error"}dex_cookiedex_cookiechmod 600.alph_cookie.gitignore| Feature | Auth Required? |
|---|---|
| Token prices, ticker data | No |
| Holder stats, whale tracking | No |
| Smart wallet list & analytics | No |
| Hot token discovery | No |
| Place orders (buy/sell) | Yes |
| Limit/pending orders | Yes |
| Copy trading (follow wallets) | Yes |
| Order history & statistics | Yes |
| Buy/sell settings | Yes |
| Wallet management | Yes |
dex_cookie==dex_cookie=Cookie: dex_cookie=..."chain":"sol"User: "I want to check my orders"
Agent:
1. Check if ALPH_DEX_COOKIE env var exists
2. If not:
"To use trading features, you need to set up authentication first.
Please:
1. Log in at https://www.alph.ai
2. Press F12 → Application → Cookies → www.alph.ai
3. Copy the 'dex_cookie' value
4. Tell me the value (or set it as env var: export ALPH_DEX_COOKIE=...)"
3. If yes: proceed to call order API with the cookie
4. If API returns 403: "Your session has expired. Please re-login and get a new cookie."dex_cookie