How to run a trading agent from Claude through a single API
Learn how to connect Claude to one trading API, set non-custodial safety limits, and trade across five market types without giving up custody of your funds.
- 01You can connect Claude to Felix through MCP tools and trade across five market types using a single API.
- 02Your funds stay in your wallet; the agent receives scoped spending authority, not custody.
- 03Hard limits, budget caps, and a panic switch enforce boundaries that the agent cannot override.
- 04Paper trading lets you test prompts and safety controls before authorizing live spending.
- 05Trading can lose money, including your entire capital, so human oversight and clear exit plans remain essential.
Running a trading agent from Claude through a single API requires connecting Claude to Felix via MCP tools, defining safety limits on your non-custodial wallet, and authorizing the agent to trade against paper or live markets. You do not give up custody of your funds; the agent receives scoped spending authority and operates within hard caps you set in advance. Once connected, Claude can read market data and place orders across stocks, crypto, perps, options, and prediction markets through one normalized interface. You remain able to revoke access or flatten positions instantly with a panic switch.
What do you need before you connect Claude?
Before you connect Claude, you need a Felix account, a wallet you control, and a scoped API key generated from the dashboard. The wallet is where your funds actually sit; Felix never takes custody of them. Install the Felix MCP server in your Claude Desktop or other MCP client, then paste the key into the configuration file. The MCP server acts as a local bridge, so your credentials do not travel through third party infrastructure. You should begin in paper trading mode so you can observe how Claude interprets your prompts and how the API translates intent into orders without risking real capital. Paper trading mirrors the live execution path, including validation and limit checks, but it routes orders to a simulated environment. Live trading requires an explicit owner authorization step where you confirm that the key may spend real money. During this stage, review the run-claude-trading-agent-checklist to verify that your wallet, key permissions, and budget logic are aligned. It is also wise to test your panic switch and confirm you can reach the revocation page quickly from the device you normally use. If you cannot find the kill switch within seconds, you are not yet ready to trade live.
How does the MCP layer turn language into orders?
Claude does not send raw text to a trading venue. Instead, it communicates through MCP tools that expose structured functions such as fetching a price quote, reading a position, or submitting an order. When you type a request, Claude parses your intent and emits a tool call with parameters the API can validate against your permissions. Felix then normalizes those parameters, converting your plain US dollar sizing into the contract math required by the underlying stock broker, crypto exchange, perps venue, options venue, or prediction market. This means you do not need to manage lot sizes, decimal precision, tick sizes, or venue-specific order types in your prompts. The model sees a unified interface, and the API handles the translation. You can read more about the protocol design in build-mcp-trading-tools-first-principles. The result is that one API key and one set of tools covers all five market types, reducing integration complexity and the surface area for misconfiguration. Because the model only interacts with the MCP layer, it has no direct network access to venues and cannot bypass the API to place hidden orders. Developers who prefer not to use MCP can also call the REST API directly, though the MCP path is the simplest way to let Claude act.
What safety controls must you set first?
Safety controls are the reason you can let an LLM touch real money without handing over custody. Start with a scoped key that restricts which markets and actions the agent may access, so a prompt about unrelated instruments cannot generate an accidental order. Set a budget cap that limits total spend over a defined window such as a day or a week, and add position limits so the agent cannot concentrate too much capital in a single instrument or direction. Define an exit plan that includes take-profit and stop-loss rules, and confirm that your panic switch is reachable from the dashboard without navigating through multiple menus. The panic switch flattens open positions and revokes the key immediately, which cuts off all agent access. Withdrawal addresses are owner-approved only, which means the agent can trade but can never move funds out of your wallet to an external address it controls. This architecture is described in detail in live-ai-trading-without-losing-custody. Remember that trading can lose money, including everything, and these controls exist to bound exposure, not to guarantee protection against all market conditions. You should treat the cap as a hard ceiling, not a target, and set it at a level where repeated losses would not affect your overall financial stability. Review and adjust these controls as your strategy evolves, because a limit that made sense last month may be inappropriate after a market regime change.
How do you place the first trade?
Start with a simple, explicit prompt while in paper trading. Suppose you tell Claude to buy one hundred dollars of a specific equity. Claude will issue the corresponding MCP tool call, the API will validate the order against your scoped permissions and budget, and if the request passes, it will forward the normalized order to the relevant venue. The exact request schema is in the docs; the shape looks like this.
{
"key": "YOUR_KEY",
"market_type": "stocks",
"action": "buy",
"symbol": "SYMBOL",
"usd_amount": 100
}After the API accepts the request, it returns an execution report that Claude can read back to you. Review the report carefully. Check that the symbol, side, and dollar amount match your intent, and look at the timestamp to ensure the data was fresh. If anything looks incorrect, adjust your prompt or tighten the scope of the key before repeating the exercise in live mode. It is common to iterate several times in paper trading to refine how you phrase instructions and to confirm that the agent respects your limits under different scenarios. You should also test a rejected order intentionally, for example by requesting an amount above your cap, to verify that the API blocks it and that Claude handles the rejection gracefully rather than retrying aggressively. Watching the full cycle from prompt to execution report helps you understand latency and how Claude reasons about trade sizing. Pay attention to how the model reasons when a request is denied; you want it to report the block clearly rather than attempt a workaround.
How do you move from paper to live trading?
Moving to live trading is a manual toggle, not an automatic graduation. When you are satisfied that paper trades execute exactly as you intend, open the dashboard and authorize the specific key for live access. This authorization is tied to the key, not the account, so you can keep separate keys for paper and live if you prefer. Before you toggle live, double-check your budget cap, position limits, and exit plan one more time. Start with a small live cap, perhaps a fraction of your intended deployment, and observe the agent for several sessions. Do not increase the cap until you have seen it behave predictably in varying market conditions. Live markets have real slippage, partial fills, and downtime that paper environments simulate imperfectly. If the first live orders feel uncomfortable, pause and return to paper. There is no requirement to trade live continuously, and many operators keep a paper key for ongoing strategy testing. You should also verify that your wallet has sufficient settled funds for the intended trades, because the API will reject orders that exceed available buying power even if they are within the agent's budget cap. Document your live toggle date and the initial cap so you can review whether the agent's activity justifies continued authorization.
How do you monitor and stop the agent?
Once the agent is running, you need visibility into every decision it makes. Audit logs record the prompt context, the tool call, the API response, and any error or rejection. This history is essential for debugging and for understanding why the agent entered or exited a position. You should review logs regularly, not just when something goes wrong. If market conditions shift or the agent behaves unexpectedly, use the panic switch. The switch closes open positions and revokes the API key, which means Claude loses the ability to trade immediately. You can learn more about structuring observability in architect-audit-logs-observability-agents. Keep in mind that markets move quickly, and even a brief delay between observation and action can result in losses. You should therefore have a secondary way to reach the dashboard, such as a mobile device, so you are not dependent on a single workstation to shut the agent down. Consider setting calendar reminders to audit the agent's activity, because an automated system that drifts silently can accumulate risk over days. Review logs after each session at first, then move to a schedule that matches your trading frequency. Good observability is not just a log file; it is the feedback loop that keeps the agent aligned with your intent.
What can go wrong and how do you prepare?
An LLM trading agent can misinterpret a prompt, misread a market data feed, or issue a tool call that is technically valid but strategically wrong. Market data can lag, liquidity can shift, and slippage can move the realized price away from the quoted price. Because the agent operates within hard limits, the damage is bounded by your budget cap and position limits, but it is not reduced to zero. Trading can lose money, including your entire capital, and no safety control can change that fundamental risk. You should start small, keep a human in the loop, and never authorize an amount you cannot afford to lose. Exit plans and the kill switch are there to protect against tail events, but they rely on you to set them correctly and to act when needed. If you are uncertain about any step, remain in paper trading until your prompts and controls are fully predictable. Even experienced operators encounter unexpected model behavior, so humility and continuous monitoring are not optional accessories. They are core components of the system. Assume that any instruction you give the agent will be interpreted literally, and write your prompts accordingly. The goal is not to remove yourself from the loop, but to automate execution while keeping judgment and veto power firmly in your hands.
Frequently asked questions
No. Felix is non-custodial by construction. Your funds remain in a wallet you control. The agent can only spend within the limits you set and cannot withdraw to an unapproved address.
Yes. The single API normalizes access to stocks, crypto, perps, options, and prediction markets. You do not need separate integrations for each market type.
The hard limit blocks the order before it reaches the market. The API enforces the cap independently of the LLM, so even if Claude requests a larger trade, the system refuses it.
You can trigger the panic switch. This flattens open positions and revokes the API key, cutting off all agent access within seconds.
Yes. Paper trading lets you verify that Claude interprets your instructions correctly and that your safety controls behave as expected without risking real money.
No. Withdrawal addresses are owner-approved only. The agent can place trades but can never move funds out of your control.
Give your agent a key.
One key to trade stocks, crypto, perps, options, and prediction markets. Live after owner authorization.
Scoped API keys are the primary defense for trading agents, yet misconfiguration and poor hygiene routinely undermine them. This article reviews the recurring mistakes and the controls that actually prevent them.
AI agents trading prediction markets fail not from bad forecasts alone, but from misunderstanding binary payoffs, liquidity, and non-custodial risk limits. Here is how to think about the problem from first principles.