API Documentation

Complete REST API reference for the VELTRIX AI trading ecosystem. Powered by Google Gemini AI and CoinGecko real-time data.

Base URL: http://your-server/veroai/api
⚡ Gemini 2.0 Flash 📊 CoinGecko FREE 🔐 JWT Auth

🔐 Authentication

POST /auth/register Register a new user
Request Body
ParameterTypeRequiredDescription
namestringrequiredFull name
emailstringrequiredEmail address
passwordstringrequiredMin 6 characters
password_confirmationstringrequiredMust match password
Response
{ "success": true, "data": { "user": {...}, "token": "eyJ...", "refresh_token": "abc...", "onboarding_required": true } }
POST /auth/login Login with email & password
Request Body
ParameterTypeRequiredDescription
emailstringrequiredEmail address
passwordstringrequiredPassword
fcm_tokenstringoptionalFirebase push token
Response
{ "success": true, "data": { "user": {...}, "preferences": {...}, "token": "eyJ...", "refresh_token": "abc..." } }
POST /auth/onboarding Complete user onboarding 🔒 Auth
ParameterTypeRequiredDescription
trading_typestringrequiredspot, futures, or both
capital_amountnumberrequiredCapital in USD
risk_levelstringrequiredlow, medium, or high
trading_stylestringrequiredscalper, swing, or investor
POST/auth/logoutRevoke token
Authorization: Bearer {token}
POST/auth/refreshRefresh JWT token
ParameterTypeRequiredDescription
refresh_tokenstringrequiredRefresh token from login

📈 Trading Signals

GET/signals/currentGet active signals🔒
{ "success": true, "data": { "signals": [{ "symbol": "BTCUSDT", "signal_type": "LONG", "confidence": 78, "entry_price": 65000, "stop_loss": 63500, ... }] } }
GET/signals/best-tradeGet the best trade now🔒
Returns the highest confidence active signal marked as "best trade".
GET/signals/historySignal history with pagination🔒
ParamTypeDescription
pageintoptPage number (default 1)
symbolstringoptFilter by coin symbol
signal_typestringoptLONG, SHORT, WAIT
GET/signals/coinGet signals for specific coin🔒
ParamTypeDescription
symbolstringreqe.g. BTCUSDT

🌍 Market Data • CoinGecko FREE API

GET/market/pricesLive coin prices (30+ coins)🔒
Returns all tracked coins with real-time prices from CoinGecko, 24h change, and volume. Data source: CoinGecko (FREE).
GET/market/moodMarket mood with global data🔒
{ "mood": "safe|neutral|dangerous", "description": "...", "btc_price": 75547, "btc_change": -2.36, "btc_dominance": 61.5, "total_market_cap": 2.7T, "data_source": "coingecko" }
GET/market/trendingTrending coins🔒
Returns currently trending coins from CoinGecko with market cap rank and BTC price.
GET/market/globalGlobal market overview🔒
{ "total_market_cap": 2700000000000, "total_volume": 85000000000, "btc_dominance": 61.5, "eth_dominance": 7.3, "active_coins": 16500 }
GET/market/chart?symbol=BTCUSDT&days=7Price chart data🔒
Returns price history, volumes, and market caps for charting. Supports 1, 7, 30, 90, 365 day ranges.
GET/market/scanFull market scan (Premium)🔒 💎
Returns the most recent automated market scan with opportunities, best trades, and swing setups.
GET/market/topTop coins with signals🔒
Top 10 coins ranked by market cap with real-time prices.
GET/market/coin?symbol=BTCUSDTDetailed coin view🔒
Detailed coin data including: description, ATH, supply, 7d/30d change, technical indicators, OHLC data, and active signals.

🤖 AI Assistant • Powered by Google Gemini

POST/ai/chatChat with Gemini AI🔒
ParamTypeDescription
messagestringreqUser's message
session_idstringoptSession for multi-turn conversation context
{ "success": true, "data": { "message": "📊 Based on current data...", "session_id": "abc-123", "model": "gemini-2.0-flash", "timestamp": "..." } }
POST/ai/analyzeAI coin analysis🔒
ParamTypeDescription
symbolstringreqe.g. BTCUSDT
Gemini analyzes the coin with live market data. Returns: trend, support/resistance, recommendation, risk warnings.
GET/ai/market-summaryAI market summary🔒
Gemini-powered summary of top 10 coins with sentiment analysis, recommendations, and key levels.
GET/ai/historyChat history🔒
Returns chat sessions or messages within a session. Use ?session_id=xxx for specific session.
DELETE/ai/historyClear chat history🔒
Clears all AI conversation history. Use ?session_id=xxx to clear specific session.

💼 Portfolio

GET/portfolio/summaryPortfolio overview🔒
{ "portfolio": { "total_value": 15420.50, "total_pnl": 1420.50, "pnl_percentage": 10.15, "entries": [...] }, "risk_assessment": {...} }
POST/portfolio/addAdd holding🔒
ParamTypeDescription
symbolstringreqe.g. BTCUSDT
quantitynumberreqAmount held
avg_buy_pricenumberreqAverage buy price USD
PUT/portfolio/updateUpdate holding🔒
Body: { "id": 1, "quantity": 0.5, "avg_buy_price": 64000 }
DELETE/portfolio/remove?id=1Remove holding🔒
Delete portfolio entry by ID.

🔔 Alerts & Notifications

GET/alertsList notifications🔒
Paginated list of user alerts sorted by newest first.
GET/alerts/unreadUnread count🔒
{ "unread_count": 3 }
PUT/alerts/readMark as read🔒
Body: { "id": 5 }
PUT/alerts/read-allMark all read🔒
Marks all unread alerts as read.

👤 User Profile

GET/user/profileGet user profile🔒
Returns user data, preferences, and subscription info.
PUT/user/profileUpdate profile🔒
Body: { "name": "New Name", "phone": "+1234567890" }
GET/user/subscriptionSubscription info🔒
Returns current plan details, features, and expiry.
GET/plansAvailable plans
Returns all subscription plans (Free, Premium Monthly, Premium Yearly) with features. Public endpoint.

📋 Reports

GET/reports/weeklyWeekly report🔒
Returns latest weekly report with signal stats, P&L, suggestions.
GET/reports/statsUser stats🔒
Lifetime stats: avg win rate, total P&L, signals received.