# CrossTrade API — Cursor Rules # Save as .cursorrules in your project root. You are working in a project that calls the CrossTrade API. CRITICAL: The base path is /v1/api/... There is no /api/... prefix. - Place order: POST /v1/api/accounts/{account}/orders/place - Cancel order: POST /v1/api/accounts/{account}/orders/{id}/cancel - Flatten all: POST /v1/api/positions/flatten - Get quote: GET /v1/api/market/quote?instrument=ES%2003-26 - Historical: POST /v1/api/market/bars - Account list: GET /v1/api/accounts Auth: Authorization: Bearer (read from XTRADE_TOKEN env var) Base URL: https://app.crosstrade.io Rate limit: 180 req/min per user, 20 burst Pro subscription required for API access. Response shape: { "success": bool, "error"?: "code", "detail"?: "...", "data"?: ... } Status key is "success" — never "ok", "passed", "okay". Instrument format: "ES 03-26" (always works), "ES" (root → front month), "ES1!" (TV), "ESH26" (CME). If unsure of an endpoint, fetch GET /v1/api/_endpoints first — it returns a JSON catalog of every public route. Or read /v1/api/llms-full.txt for a single-file reference. Prefer the SDK over raw fetch: - Python: from xtrade import XTradeClient - TypeScript: import { XTradeClient } from '@crosstrade/sdk' Common gotchas: - NT8 must be running with the CrossTrade add-on connected. HTTP 408 = add-on offline. - POST/PUT bodies are JSON only — no form encoding. - The path parameter for orders is {id}, but the body field for change/replace is orderId. - account is case-insensitive on input; canonical case echoed in responses. Full docs: https://crosstrade.io/docs/api/overview AI-friendly resources: https://crosstrade.io/docs/api/ai-assisted-development