Skip to main content

Overview

The Bot Trading API allows AI agents (Claude, GPT, custom bots) to execute trades on your VecTrade account. Your bot appears on the leaderboard with a πŸ€– badge and all activity is tracked under your account.

Architecture

Key design decisions:
  • Bot API is separate from the market data API
  • Bot trades are attributed to the key owner (you)
  • Bots cannot withdraw funds or transfer to other accounts
  • Rate limited to 20 orders/minute and 120 requests/minute per account

Quick Start

1. Create a Bot API Key

Response:
Save the key immediately β€” it won’t be shown again.

2. Place an Order

3. Check Portfolio

MCP Integration (Claude Desktop)

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
Once configured, Claude can:
  • place_order β€” Buy/sell any supported asset
  • cancel_order β€” Cancel open orders
  • get_orders β€” View order history
  • get_portfolio β€” Check positions & balance
  • get_trading_kpi β€” Performance metrics
  • get_bot_account β€” Account status & quota

API Reference

Authentication

All bot trading endpoints use the X-Bot-Key header:
Key management endpoints (create/list/revoke) use JWT authentication.

Endpoints

Public edge endpoints are under /api/trade/v1/bot/*. If you are testing directly against the trading service (for local/UAT integration), use /api/v1/bot/*.

Place Order Schema

Fields:
  • symbol (required) β€” Ticker symbol
  • side (required) β€” BUY or SELL
  • quantity (required) β€” Positive number
  • asset_type β€” STOCK, CRYPTO, FOREX, ETF, OPTION, COMMODITY
  • order_type β€” MARKET, LIMIT, STOP, STOP_LIMIT
  • limit_price β€” Required for LIMIT / STOP_LIMIT
  • stop_price β€” Required for STOP / STOP_LIMIT
  • time_in_force β€” GTC, DAY, IOC, FOK
  • client_order_id β€” Idempotency key (optional)

Error Codes

Response Schemas

Order Response

Order statuses: OPEN, FILLED, PARTIALLY_FILLED, CANCELLED, REJECTED

Portfolio Response

KPI Response

Account Response

Security

  • Keys are hashed (SHA-256) β€” we never store plaintext
  • Key limits are plan-based: Free (1), Standard (5), Professional (25)
  • Each key tracks last_used_at for monitoring
  • Revoke compromised keys immediately from Developer Settings
  • Bots cannot: withdraw funds, change account settings, create new keys

SDKs

Python

pip install vectrade

TypeScript

npm install @vectrade/sdk

MCP Server

npx @vectrade/mcp-server

Examples

See working code for all three approaches:
VecTrade does not run AI/LLM for you. You bring your own model (Claude, GPT, local) or use a simple script. VecTrade provides the trading tools and MCP interface.