API Reference v1

← Back to Avero

Overview

AVERO exposes 80+ REST endpoints for trading data, portfolio management, broker control, and system monitoring. All endpoints are versioned under /api/v1/ with JSON request/response bodies.

# Base URL
https://api.averotrading.net/api/v1/

# Authentication: Bearer token in Authorization header
Authorization: Bearer <your-api-key>

Responses follow a consistent envelope:

{
  "ok": true,
  "data": { ... },
  "timestamp": "2026-05-30T12:00:00Z"
}

Health & Status

GET /health Liveness probe

Returns service liveness status. Used by Cloudflare Load Balancer and container orchestrators.

curl -X GET https://api.averotrading.net/health
Response: {"status": "ok", "timestamp": "2026-05-30T12:00:00Z"}
GET /ready Readiness probe

Readiness check that validates all downstream dependencies (database, broker connection, AI models).

curl -X GET https://api.averotrading.net/ready
GET /api/v1/status Full system status

Returns comprehensive system status including bot state, P&L, open positions, and trading mode.

curl -X GET https://api.averotrading.net/api/v1/status \
  -H "Authorization: Bearer <your-api-key>"

Trades

GET /api/v1/trades Recent trade history

Returns recent trade history with fill prices, fees, and AI model reasoning.

ParameterTypeReqDescription
limitintegeroptMax results (default 50, max 500)
symbolstringoptFilter by symbol
sinceISO8601optStart date
curl -X GET "https://api.averotrading.net/api/v1/trades?limit=10&symbol=AAPL" \
  -H "Authorization: Bearer <your-api-key>"
GET /api/v1/trades/export CSV export

Download trade history as CSV for external analysis.

curl -X GET "https://api.averotrading.net/api/v1/trades/export?since=2026-01-01" \
  -H "Authorization: Bearer <your-api-key>" \
  -o trades.csv

Signals

GET /api/v1/signals/{symbol} Signal history + AI reasoning

Returns the full AI signal history for a symbol, including individual model votes, confidence scores, and aggregated reasoning.

ParameterTypeReqDescription
symbolstringreqSymbol (e.g., AAPL, BTC/USD)
lookbackintegeroptBars to look back (default 50)
curl -X GET "https://api.averotrading.net/api/v1/signals/AAPL?lookback=20" \
  -H "Authorization: Bearer <your-api-key>"

Order Book

GET /api/v1/orderbook/{symbol} L2 order book snapshot

Returns Level 2 order book data with aggregated bids and asks.

curl -X GET "https://api.averotrading.net/api/v1/orderbook/BTC/USD" \
  -H "Authorization: Bearer <your-api-key>"

Options Flow

GET /api/v1/options-flow Options flow feed

Real-time options flow data including unusual options activity, put/call ratios, and block trades.

curl -X GET "https://api.averotrading.net/api/v1/options-flow?limit=20" \
  -H "Authorization: Bearer <your-api-key>"

Portfolio Rebalancing

GET /api/v1/rebalance/status Current targets & config

Returns current portfolio allocation targets, drift thresholds, and rebalance schedule.

curl -X GET "https://api.averotrading.net/api/v1/rebalance/status" \
  -H "Authorization: Bearer <your-api-key>"
GET /api/v1/rebalance/analyze Drift analysis

Analyzes current drift from target allocations and recommends rebalance trades.

curl -X GET "https://api.averotrading.net/api/v1/rebalance/analyze" \
  -H "Authorization: Bearer <your-api-key>"
POST /api/v1/rebalance/preview Preview rebalance orders

Preview the orders that would be placed during a rebalance without executing.

curl -X POST "https://api.averotrading.net/api/v1/rebalance/preview" \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"targets": {"AAPL": 0.25, "SPY": 0.25, "BTC": 0.25, "BOND": 0.25}}'
POST /api/v1/rebalance/execute Execute rebalance trades

Executes portfolio rebalance trades based on current drift or custom targets.

curl -X POST "https://api.averotrading.net/api/v1/rebalance/execute" \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"dry_run": true}'

Broker Mode

GET /api/v1/broker-mode Current mode + paper stats

Returns whether the system is in live or paper trading mode, plus paper account statistics.

curl -X GET "https://api.averotrading.net/api/v1/broker-mode" \
  -H "Authorization: Bearer <your-api-key>"
POST /api/v1/broker-mode Switch live/paper

Toggle between live and paper trading mode. Requires confirmation for live mode for safety.

curl -X POST "https://api.averotrading.net/api/v1/broker-mode" \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"mode": "paper"}'
POST /api/v1/broker-mode/reset-paper Reset paper account

Resets paper trading account to initial balance. Only available in paper mode.

curl -X POST "https://api.averotrading.net/api/v1/broker-mode/reset-paper" \
  -H "Authorization: Bearer <your-api-key>"

Workers

GET /api/v1/workers-routes List all routes

Lists all registered Celery worker routes and their current status.

curl -X GET "https://api.averotrading.net/api/v1/workers-routes" \
  -H "Authorization: Bearer <your-api-key>"
POST /api/v1/workers-routes Create a route

Register a new Celery worker route for distributed task execution.

curl -X POST "https://api.averotrading.net/api/v1/workers-routes" \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"name": "signal-worker", "queue": "signals", "concurrency": 4}'
DELETE /api/v1/workers-routes/{id} Delete a route

Remove a Celery worker route by ID.

curl -X DELETE "https://api.averotrading.net/api/v1/workers-routes/route_abc123" \
  -H "Authorization: Bearer <your-api-key>"

Circuit Breakers

GET /api/circuit-breakers Circuit breaker status

Returns the current status of all circuit breakers — drawdown limits, drift detection, and volatility regime.

curl -X GET "https://api.averotrading.net/api/circuit-breakers" \
  -H "Authorization: Bearer <your-api-key>"

Cloudflare Services

GET /api/v1/kv/{key} Workers KV

Read a value from Cloudflare Workers KV store.

curl -X GET "https://api.averotrading.net/api/v1/kv/settings:model_weights" \
  -H "Authorization: Bearer <your-api-key>"
POST /api/v1/d1/query D1 Database

Execute a read query against Cloudflare D1 database (trading logs, model history).

curl -X POST "https://api.averotrading.net/api/v1/d1/query" \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"sql": "SELECT * FROM signals WHERE symbol = ? LIMIT 10", "params": ["AAPL"]}'
POST /api/v1/r2/upload R2 Storage

Upload a file to Cloudflare R2 object storage (backtest exports, logs).

curl -X POST "https://api.averotrading.net/api/v1/r2/upload" \
  -H "Authorization: Bearer <your-api-key>" \
  -F "file=@backtest_results.csv" \
  -F "path=exports/backtest_2026_05_30.csv"

Metrics

GET /metrics Prometheus scrape endpoint

Prometheus-formatted metrics for monitoring and alerting. Scraped by the infrastructure monitoring system.

curl -X GET https://api.averotrading.net/metrics

Control (Auth-gated)

These endpoints require operator-level authentication and are typically used through the dashboard.

POST /api/emergency-stop Halt + liquidate all

Emergency stop — immediately halts all trading activity and liquidates open positions. Requires elevated permissions.

curl -X POST "https://api.averotrading.net/api/emergency-stop" \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true, "reason": "manual_intervention"}'
POST /control/start Start trading bot

Starts the autonomous trading bot with current configuration.

curl -X POST "https://api.averotrading.net/control/start" \
  -H "Authorization: Bearer <your-api-key>"
POST /control/stop Stop trading bot

Gracefully stops the trading bot — completes current cycle and exits.

curl -X POST "https://api.averotrading.net/control/stop" \
  -H "Authorization: Bearer <your-api-key>"