ƒelixDocs

Felix API

Trade every market with one key.

Felix lets an AI agent (or you) trade stocks, crypto, perps, options, and prediction markets through one key and one set of endpoints. Sizes are in plain dollars, there is no contract math, and your money stays in a wallet you control. Everything runs in paper mode until you turn it live.

Base URL: https://api.felix.trade. Every endpoint lives under /v1. Responses are JSON.

Start here

Three steps to your first paper trade.

1. Configure a manage key

Initial manage keys are issued through controlled onboarding. Public self-service issuance is not open yet. Store that key in an environment variable; it can create an isolated child and one-time paper key:

POST /v1/accounts
curl -X POST https://api.felix.trade/v1/accounts \
  -H "Authorization: Bearer $FELIX_MANAGE_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"accept_terms":true,"label":"research agent"}'

# → { "account_id": "...", "key_id": "...", "paper_key": "fk_...",
#     "wallet_status": "onboarding_required", "deposit_address": null }

accept_terms: true is required. Creating a key records your agreement to the Terms of Service, Privacy Policy, and Risk Disclosure; without it the call is rejected. The child is isolated and zero-funded. The raw key appears only on the first successful response; exact retries are redacted. Complete client-owned wallet onboarding before funding or live-key creation.

2. Quote a market

curl
curl https://api.felix.trade/v1/quotes/BTC \
  -H "Authorization: Bearer $FELIX_KEY"

# → { "instrument": "crypto:BTC", "price": 61825.5, "market": "crypto" }

3. Place a paper trade

The same call works for every market. You buy 50 dollars of something, not a number of shares or contracts.

curl
curl -X POST https://api.felix.trade/v1/orders \
  -H "Authorization: Bearer $FELIX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"instrument":"BTC","side":"buy","size_usd":50,"paper":true}'

# → { "ok": true, "mode": "paper", "status": "filled",
#     "fill_price": 61825.5, "filled_size_usd": 50, "fee": {"fee_usd": 0.04} }

Use it from your AI tool

Felix has an MCP launch candidate, so Claude, Cursor, and Codex can trade through it directly. The publicfelix-mcp npm package will be published after final dogfood certification. Once published, one line of setup and the model gets tools in its loop: search_markets, get_quote, preview_order,place_order, positions, pnl, and panic. Every tool starts in paper mode.

Claude Code (CLI)

terminal
claude mcp add felix -- npx -y felix-mcp
export FELIX_API_KEY=fk_xxxx

Claude Desktop

Add this to claude_desktop_config.json (Settings → Developer → Edit Config):

claude_desktop_config.json
{
  "mcpServers": {
    "felix": {
      "command": "npx",
      "args": ["-y", "felix-mcp"],
      "env": { "FELIX_API_KEY": "fk_xxxx" }
    }
  }
}

Cursor

Settings → MCP → Add new server, or drop this in ~/.cursor/mcp.json:

~/.cursor/mcp.json
{
  "mcpServers": {
    "felix": {
      "command": "npx",
      "args": ["-y", "felix-mcp"],
      "env": { "FELIX_API_KEY": "fk_xxxx" }
    }
  }
}

Codex

~/.codex/config.toml
[mcp_servers.felix]
command = "npx"
args = ["-y", "felix-mcp"]
env = { FELIX_API_KEY = "fk_xxxx" }

ChatGPT, or any agent without MCP

No MCP? Point the model at the API plus the one-file docs, and it can drive Felix on its own. Thellms.txt file below is written specifically for a model to read and use without guessing.

give your agent these two things
# 1. The full API as one file (feed this to the model):
https://felix.trade/llms.txt

# 2. The base URL + a key:
https://api.felix.trade   with header  Authorization: Bearer fk_xxxx

# Or just use the SDK inside your agent:
pip install felixtrade     # or:  npm install felix-sdk

Keys & auth

Send your key as a Bearer token on every request:

Authorization: Bearer fk_xxxxxxxx
  • Create keys programmatically: an existing manage key uses POST /v1/accounts for an isolated child or POST /v1/keys/paper for another paper key.
  • • Every key starts with fk_. Paper/live authority is server-side metadata, never a token prefix.
  • Scopes: read (data + account), trade (orders), manage (create accounts + keys, funding), transfer (withdrawals, off by default).
  • • No key or a bad key → 401. Valid key without the right scope → 403.
  • • Treat every key as a secret. Raw keys are shown once; never paste them into prompts or logs. Revoke exposed keys immediately.

Instruments

One naming scheme for every market. Inputs are forgiving: BTC, btc, and BTC-USD all work.

MarketWrite it asExample
Crypto / perpSYM or crypto:SYMBTC, ETH, SOL
StockSYM or stock:SYMNVDA, TSLA
Optionoption:UND-YYYYMMDD-STRIKE-C/Poption:BTC-20260711-70000-C
Prediction marketpm:<slug>pm:fed-cut-in-september

Sizes are always in USD via size_usd. Every response tells you the market it resolved to.

Place a trade

Optional but recommended: preview first to see the fill price and fee before you commit.

POST /v1/orders/preview
{ "instrument": "BTC", "side": "buy", "size_usd": 50 }

# → { "est_fill_price": 61825.5, "fee": {"fee_usd": 0.04, "bps": 8},
#     "min_live_size_usd": 10 }

Place the order

POST /v1/orders
{
  "instrument": "NVDA",
  "side": "buy",          // buy | sell | long | short | yes | no
  "size_usd": 250,
  "type": "market",       // market | limit  (limit_price optional)
  "paper": true           // true = simulate (default), false = live
}
  • Paper vs live: omitted or paper: true simulates, even on a live-enabled key. paper: false uses real money and needs an owner-authorized live key plus an Idempotency-Key header.
  • Client signing: live prediction-market orders use prepare, owner-sign, checkpoint, and commit; the generic live route refuses to hold the owner key.
  • Idempotency: put a unique Idempotency-Key: <uuid> header on any live order so a retry never double-trades.
  • Live minimum: paper can be tiny; live crypto/perp is at least ~$10. Preview returns min_live_size_usd.
  • Close a position: POST /v1/positions/{id}/close.
  • Batch: POST /v1/orders/batch with {"orders":[...]} (up to 50).

Positions & PnL

Use these endpoints to reconcile Felix state with current venue balances, fills, and positions.

GET /v1/positions — open positions with live unrealized PnL
GET /v1/fills — every fill: entry, exit, price, size, fee, realized PnL
GET /v1/pnl — realized + unrealized + fees + net, with counts
GET /v1/balances — spendable cash + per-market balances
GET /v1/pnl
{ "realized_pnl_usd": -0.14, "unrealized_pnl_usd": 2.31,
  "total_fees_usd": 0.42, "net_pnl_usd": 1.75,
  "open_positions": 2, "closed_positions": 27 }

Money in & out

Your funds live in a client-owned wallet. Felix prepares policy, funding, and withdrawal actions; the owner signs them locally.

  • Wallet: complete /v1/wallet/onboarding/init, locally sign the prepared deployment, then call /deploy and /complete.
  • Deposit: GET /v1/deposit-address reports the owner-controlled address after onboarding. Check /v1/wallet/funding/balances before routing funds.
  • Fund a venue: call /v1/wallet/funding/prepare, execute the returned owner-signed transaction plan client-side, then call /confirm. Use the matching return flow to bring venue funds home.
  • Withdraw: add and confirm an address with idempotency keys, wait for the safety delay, then use /v1/withdraw/prepare, owner-sign locally, and /v1/withdraw/submit. Only allowlisted addresses.

Agents & strategies

Describe a strategy in words, backtest it, then deploy it as an agent that runs on its own inside your limits.

// 1. Generate from a prompt
POST /v1/strategies/generate
{ "prompt": "buy BTC on a 3% intraday dip, take profit at 5%" }

// 2. Backtest it on history
POST /v1/backtests  { "strategy": { ... } }

// 3. Deploy it (paper first)
POST /v1/agents
{ "strategy": {...}, "name": "dip buyer", "budget_usd": 100, "mode": "paper" }

// status / stop
GET  /v1/agents/{id}
POST /v1/agents/{id}/stop

Market data

GET /v1/instruments?q=nvidia — search across every market
GET /v1/quotes/{instrument} — live price + spread
GET /v1/orderbook/{instrument} — top of book
GET /v1/options/{underlying} — full option chain (strikes, expiries, greeks, IV)
GET /v1/funding/{instrument} — perp funding rate

Webhooks

Get pinged when things happen instead of polling.

POST /v1/webhooks
{ "url": "https://you.dev/hook",
  "events": ["order.filled", "position.closed"] }

# → { "id": "...", "signing_secret": "whsec_..." }

Each event is signed with HMAC-SHA256 over the raw body in the X-Felix-Signature header. Verify it before trusting the payload.

Errors & safety

Every error is JSON with a hint telling you how to fix it.

{ "error": { "code": "insufficient_scope",
             "message": "this key can't place orders",
             "hint": "create a key with the 'trade' scope" } }
  • Rate limits: X-RateLimit-* headers on every response; 429 + Retry-After when you hit the ceiling.
  • Kill switch: POST /v1/panic cancels everything and revokes the calling key instantly.
  • Status: GET /v1/status (no auth needed).

SDKs

The Python and TypeScript 1.2.0 artifacts are built and certified. These install commands become public when the packages are published at launch.

Python
pip install felixtrade

from felix import Felix
felix = Felix("fk_...")
felix.buy("NVDA", usd=250)          # stock
felix.buy("BTC", usd=50)            # crypto
felix.buy("pm:fed-cut", side="yes", usd=20)  # prediction market
TypeScript
npm install felix-sdk

import { Felix } from "felix-sdk";
const felix = new Felix("fk_...");
await felix.buy("BTC", 10); // paper by default

Interactive reference (OpenAPI): https://api.felix.trade/v1/docs

For AI agents, the full docs as one file: felix.trade/llms.txt

Non-custodial rails for AI agents. Not a brokerage. Not financial advice.