Build your first AI trader

You don't need to be a quant or a programmer. If you can describe a trading idea in plain English, an AI assistant can write the code, and ApesTogether gives it a public, timestamped record against the S&P 500, with no money of your own at risk.

Keys are free and self-serve: in the app, Settings → AI Traders → Get an API Key, or get one on the web. Already technical? Skip to the API docs.

1. What you're building

A small program that runs once a day, decides whether to buy or sell, and sends that order to your ApesTogether portfolio. ApesTogether fills it at a live market price (or at the next open if the market is closed) and adds it to your public record. If your record holds up, people can subscribe for $9/month to follow it, and you keep 85% after app-store fees, paid per subscriber. No account size or assets under management required. Subscribers tend to go where the records are strongest, so plenty of traders earn little or nothing.

2. Pick one simple idea

Start with something you can say in one sentence. A few to try:

Simple beats clever. Fewer trades, clear rules, and something you'd actually stick with.

3. Let an AI write the code

Paste this into ChatGPT, Claude or Gemini and replace the bracketed part with your idea:

I want to build a simple stock-trading bot in Python that paper-trades on
ApesTogether. My rule: [describe your idea in plain words].

- Use the yfinance library for price history.
- Use the ApesTogether Trader API (docs: https://apestogether.ai/developers).
  Read my key from the environment variable APESTOGETHER_KEY and send it as
  "Authorization: Bearer <key>".
- Get my holdings with GET /api/v1/positions.
- Place market orders with POST /api/v1/orders using symbol, side and qty.
  Never send a price. ApesTogether sets it.
- Always set client_order_id to something unique per day so a retry can't
  trade twice, and start with "dry_run": true.
- Explain each step simply, and tell me how to run it once a day on
  Windows or Mac.

4. A starter bot you can run today

This one follows the trend idea above. It's a textbook rule picked to show the mechanics, not a recommendation. Install Python, then pip install requests yfinance, save this as bot.py, set your key (APESTOGETHER_KEY) and run python bot.py.

"""Hold SPY when it's above its 200-day average, otherwise hold cash.
Paper trading on ApesTogether. Runs once a day."""
import os, requests, yfinance as yf

API = "https://apestogether.ai/api/v1"
H = {"Authorization": f"Bearer {os.environ['APESTOGETHER_KEY']}"}
DRY_RUN = True                # flip to False once you like what it would do
SYMBOL, BUDGET = "SPY", 1000  # dollars to put to work

closes = yf.Ticker(SYMBOL).history(period="1y")["Close"]
price, avg200 = closes.iloc[-1], closes.tail(200).mean()
want_in = price > avg200
print(f"{SYMBOL} {price:.2f} vs 200-day {avg200:.2f} -> {'IN' if want_in else 'OUT'}")

held = {p["symbol"]: p["qty"] for p in requests.get(f"{API}/positions", headers=H).json()}
qty_held = held.get(SYMBOL, 0)

order = None
if want_in and qty_held == 0:
    order = {"symbol": SYMBOL, "side": "buy", "qty": round(BUDGET / price, 4)}
elif not want_in and qty_held > 0:
    order = {"symbol": SYMBOL, "side": "sell", "qty": qty_held}

if order:
    order["client_order_id"] = f"trend-{SYMBOL}-{closes.index[-1]:%Y-%m-%d}"
    order["dry_run"] = DRY_RUN
    print(requests.post(f"{API}/orders", json=order, headers=H).json())
else:
    print("No trade today.")

With DRY_RUN = True nothing is placed. You'll see the price it would get and whether it would fill now or at the next open. When it looks right, set it to False.

5. Run it once a day

6. Make it yours

The starter bot is a launch pad, not a strategy. The interesting part is what you add. Pick one direction, then work it through with your AI. Ask it to explain the trade-offs, write the code, and tell you how you'd know whether the change actually helped.

Or go broad: "Here's my bot and its results so far. What's the single change most likely to make it better, and how would I prove it worked?" Then ask it to argue the other side. The best builders treat their AI like a sparring partner, not an oracle.

7. Guardrails (read this one)

8. How you'll know if it's working

Your portfolio is ranked against the S&P 500 for 1D, 1W, 1M, 3M, YTD and 1Y. Give it weeks, not days. If it beats the index consistently, people will notice, and they can subscribe.

Coming soon

Connect ApesTogether to Claude or ChatGPT and just tell your AI what to do: "Check my portfolio and sell anything down more than 10% since I bought it." Every order asks you to confirm before it's placed.

Paper trading for information and education only, not investment advice. ApesTogether is not a broker or investment adviser. You must be 18 or older; payouts require a completed tax form. See the Terms of Service.