Built for AI: How CrossTrade Talks to Agents
We've shipped a stack of small, standards-based changes that let AI coding agents and research agents understand the CrossTrade API on the first try, without us hand-holding them.
If you're building anything with Claude, Cursor, Copilot, or any of the new "agent" tools, you've probably hit the same wall I keep hitting: the agent guesses the API surface, gets it wrong, and you spend ten minutes pasting links into the chat.
The fix is to make the site itself answerable to a machine. Over the last week we've added a stack of small things that, together, let an AI agent walk up to crosstrade.io cold and figure out the whole API in a single round trip. Here's what changed and why.
What we shipped
A real robots.txt, with AI rules and content signals
The old robots.txt was a one-line stub. The new one explicitly allows the major AI crawlers (GPTBot, ChatGPT-User, ClaudeBot, anthropic-ai, PerplexityBot, Google-Extended) and declares our content-usage preferences using the new Content Signals draft:
Content-Signal: search=yes, ai-input=yes, ai-train=yes
Translation: yes, AI assistants can use our docs as input, and yes, they can train on the public content. We want an LLM that's been pre-trained on how CrossTrade works, because that's a user who can hit the ground running.
llms.txt and llms-full.txt
These are the AI-equivalent of a sitemap. Instead of a human-readable index, they're a flat, paste-friendly text rendering of the API. llms.txt is the short index. llms-full.txt is every endpoint, every parameter, every body shape, every example, in one file you can drop into a model's context window.
Both live at:
- https://crosstrade.io/llms.txt
- https://crosstrade.io/llms-full.txt
- https://app.crosstrade.io/v1/api/llms.txt (server-rendered, always fresh)
- https://app.crosstrade.io/v1/api/llms-full.txt
OpenAPI 3.1 spec, YAML and JSON
The full machine-readable API surface, regenerated automatically from the actual code (the route decorators in nt.py and the C# methods in the NinjaTrader add-on). One source of truth, no drift.
A /.well-known/api-catalog (RFC 9727)
This is the new standard for "I have an API, here's where to find everything about it." A single JSON document at https://crosstrade.io/.well-known/api-catalog points to the OpenAPI spec, the human docs, the LLM-targeted docs, the live endpoint catalog, and the status endpoint. An agent reads one URL, gets all five.
Markdown negotiation
If you curl https://crosstrade.io/ with Accept: text/markdown, you get markdown back instead of HTML. Cloudflare's "agent ready" scanner picked it up; Claude and friends use it natively when they don't want to chew through HTML.
Link headers on the homepage (RFC 8288)
If an agent hits the homepage and only reads the response headers (no HTML parse), it still finds everything:
Link: </llms.txt>; rel="llms-txt"
Link: </llms-full.txt>; rel="alternate"; type="text/plain"
Link: </.well-known/api-catalog>; rel="api-catalog"
Link: </docs/api/overview>; rel="service-doc"
Link: <https://app.crosstrade.io/v1/api/openapi.yaml>; rel="service-desc"
A smart 404 that suggests the right path
Agents love to guess /api/orders/place or /api/v1/orders. We don't have those routes; the actual path is /v1/api/accounts/{account}/orders/place. Now when an agent guesses wrong under /v1/api/, the 404 response is a structured JSON with a did_you_mean array of close matches and a list of every discovery URL it should have hit instead. One round trip and the agent recovers on its own.
$ curl https://app.crosstrade.io/v1/api/wrong_path
{
"success": false,
"error": "unknown_endpoint",
"detail": "No route matches GET /v1/api/wrong_path.",
"did_you_mean": ["GET /v1/api/accounts", ...],
"discovery": {
"endpoints_catalog": "...",
"openapi_yaml": "...",
"llms_full_txt": "..."
}
}
AI-assisted development guide
There's now a dedicated section in the docs at crosstrade.io/docs/api/ai-assisted-development that explains how to point Claude / Cursor / Copilot at this stack. Paste two URLs into your AI of choice, you're trading.
Coming soon
A few more pieces are in the oven and shouldn't be far off:
MCP server. Model Context Protocol is Anthropic's emerging standard for letting an AI agent call your tools directly. We're building one for CrossTrade so you'll be able to type "Claude, flatten my E-mini position and show me today's P&L" and it'll just work, with the agent calling the API on your behalf inside the chat. This will land at https://app.crosstrade.io/.well-known/mcp/server-card.json once it's ready.
WebMCP. Same idea, but in-browser: when you have the dashboard open, AI agents will see a navigator.modelContext surface with your live trading tools registered. No copy-paste, no extra setup.
OAuth for agent auth. Right now the API is bearer-token authed and you copy the token out of your account page. With OAuth metadata at /.well-known/oauth-authorization-server, an agent will be able to do the auth handshake on its own (with your consent), so you'll never paste a token into a chat window again.
Agent Skills index. A discoverable list of "things AI agents can do on CrossTrade" at /.well-known/agent-skills/index.json, so any agent that supports the spec can find our skills without us submitting them anywhere.
Why bother
Honestly, because the way you trade is going to change in the next year, and we'd rather build for that user now than retrofit later. Most of this is also just good API hygiene that helps human developers too. The OpenAPI spec, the markdown docs, the smart 404 with route hints, none of that is AI-specific. It just happens that AI is what finally made the standards mature enough to be worth implementing.
If you're using CrossTrade with an AI assistant and something doesn't quite click, tell us. We'd rather hear it from you than from a Cloudflare scan report.
