The Trading API gives Miteos agents programmatic access to connected brokers, strategy management, order execution, and historical backtesting. Agents can monitor positions, react to market events, and place orders — all from within a single authenticated session.
Live trading carries real financial risk. Read this before proceeding.
- Explicit opt-in required. Live trading is disabled by default. You must enable it in Account Settings → Trading → Live Trading and acknowledge the risk disclosure before any live orders are accepted.
- Always validate with paper trading first. All new strategies default to
paper mode. Run your strategy in paper mode and review backtest results before switching to live.
- Position and loss limits are enforced automatically. Each account has a maximum position size and a daily loss limit. Orders that would breach these limits are rejected at the API level before reaching the broker.
- Automatic kill switch. If your account’s daily loss limit is breached, the platform automatically cancels all open orders and prevents new order submission until the next trading session. You will receive an email and in-app notification when this occurs.
Authentication
All requests require a Bearer token in the Authorization header.
Authorization: Bearer mt_live_xxx
Brokers
GET /trading/brokers
List all broker connections attached to your account.
Examples
curl --request GET \
--url https://api.miteos.com/v1/trading/brokers \
--header 'Authorization: Bearer mt_live_xxx'
{
"data": [
{
"id": "brk_2c8mq4lz",
"broker_name": "alpaca",
"status": "connected",
"mode": "paper",
"connected_at": "2024-10-01T09:15:00Z"
}
]
}
POST /trading/brokers
Connect a new broker to your account. Credentials are encrypted at rest and never returned after the initial connection call.
Request
The broker to connect. Accepted values: ibkr (Interactive Brokers), alpaca, binance.
Broker-specific authentication credentials. Refer to the broker’s developer documentation for the exact fields required (e.g., API key and secret for Alpaca; OAuth token for IBKR).
Examples
curl --request POST \
--url https://api.miteos.com/v1/trading/brokers \
--header 'Authorization: Bearer mt_live_xxx' \
--header 'Content-Type: application/json' \
--data '{
"broker_name": "alpaca",
"credentials": {
"api_key": "PKxxxxxxxxxxxxxxxx",
"api_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}'
{
"id": "brk_2c8mq4lz",
"broker_name": "alpaca",
"status": "connected",
"mode": "paper",
"connected_at": "2024-11-14T11:00:00Z"
}
Strategies
GET /trading/strategies
List all trading strategies in your account.
Examples
curl --request GET \
--url https://api.miteos.com/v1/trading/strategies \
--header 'Authorization: Bearer mt_live_xxx'
{
"data": [
{
"id": "stg_8rk3lp2x",
"name": "Momentum Breakout",
"type": "momentum",
"symbols": ["AAPL", "MSFT", "NVDA"],
"mode": "paper",
"created_at": "2024-10-15T14:30:00Z"
}
]
}
POST /trading/strategies
Create a new trading strategy. New strategies always start in paper mode.
Request
A human-readable name for the strategy.
The strategy type. Examples include momentum, mean_reversion, arbitrage, or custom.
An array of ticker symbols the strategy should trade (e.g., ["AAPL", "BTC-USD"]).
A strategy-specific configuration object. The fields depend on the chosen type. See the strategy configuration guide for full schemas.
Examples
curl --request POST \
--url https://api.miteos.com/v1/trading/strategies \
--header 'Authorization: Bearer mt_live_xxx' \
--header 'Content-Type: application/json' \
--data '{
"name": "Momentum Breakout",
"type": "momentum",
"symbols": ["AAPL", "MSFT", "NVDA"],
"config": {
"lookback_days": 20,
"entry_threshold": 0.02,
"stop_loss_pct": 0.05
}
}'
{
"id": "stg_8rk3lp2x",
"name": "Momentum Breakout",
"type": "momentum",
"symbols": ["AAPL", "MSFT", "NVDA"],
"mode": "paper",
"config": {
"lookback_days": 20,
"entry_threshold": 0.02,
"stop_loss_pct": 0.05
},
"created_at": "2024-11-14T11:30:00Z"
}
Positions
GET /trading/positions
Return all currently open positions across connected brokers.
Examples
curl --request GET \
--url https://api.miteos.com/v1/trading/positions \
--header 'Authorization: Bearer mt_live_xxx'
{
"data": [
{
"id": "pos_5t1wr8vn",
"symbol": "AAPL",
"quantity": 50,
"avg_entry_price": 182.40,
"current_price": 185.10,
"unrealized_pnl": 135.00,
"side": "long",
"broker_name": "alpaca",
"mode": "paper"
}
]
}
Orders
POST /trading/orders
Place a new order through a connected broker. Orders in paper mode are simulated and never sent to a real exchange.
Request
The ticker symbol to trade (e.g., AAPL, ETH-USD).
Order direction. Accepted values: buy, sell.
Number of shares or units to trade. Must be a positive number.
Execution instruction. Accepted values: market, limit, stop, stop_limit.
Required when order_type is limit or stop_limit. The maximum price to pay (buy) or minimum price to accept (sell).
Required when order_type is stop or stop_limit. The trigger price that activates the order.
Examples
curl --request POST \
--url https://api.miteos.com/v1/trading/orders \
--header 'Authorization: Bearer mt_live_xxx' \
--header 'Content-Type: application/json' \
--data '{
"symbol": "AAPL",
"side": "buy",
"quantity": 10,
"order_type": "market"
}'
{
"id": "ord_3qm9bx7w",
"symbol": "AAPL",
"side": "buy",
"quantity": 10,
"order_type": "market",
"status": "submitted",
"filled_avg_price": null,
"mode": "paper",
"created_at": "2024-11-14T13:45:00Z"
}
Backtests
GET /trading/backtests
List all backtest runs for your account.
Examples
curl --request GET \
--url https://api.miteos.com/v1/trading/backtests \
--header 'Authorization: Bearer mt_live_xxx'
{
"data": [
{
"id": "bkt_6yn4dl1p",
"strategy_id": "stg_8rk3lp2x",
"start_date": "2023-01-01",
"end_date": "2023-12-31",
"initial_capital": 100000,
"final_value": 118450,
"total_return_pct": 18.45,
"status": "complete",
"created_at": "2024-11-14T12:00:00Z"
}
]
}
POST /trading/backtests
Run a historical backtest for a strategy. Backtests are asynchronous — check the returned status field and poll or wait for a webhook to confirm completion.
Request
The ID of the strategy to backtest.
The start of the historical period in YYYY-MM-DD format.
The end of the historical period in YYYY-MM-DD format.
The simulated starting capital in USD.
Examples
curl --request POST \
--url https://api.miteos.com/v1/trading/backtests \
--header 'Authorization: Bearer mt_live_xxx' \
--header 'Content-Type: application/json' \
--data '{
"strategy_id": "stg_8rk3lp2x",
"start_date": "2023-01-01",
"end_date": "2023-12-31",
"initial_capital": 100000
}'
{
"id": "bkt_6yn4dl1p",
"strategy_id": "stg_8rk3lp2x",
"start_date": "2023-01-01",
"end_date": "2023-12-31",
"initial_capital": 100000,
"final_value": null,
"total_return_pct": null,
"status": "running",
"created_at": "2024-11-14T12:00:00Z"
}
Backtest duration scales with the date range and the number of symbols in your strategy. A one-year backtest across 10 symbols typically completes in under 60 seconds.