{"openapi":"3.1.0","info":{"title":"PolyTape Agent API","description":"Read-only data plane for agents: tapes, traders, live feed. Authenticate with `Authorization: Bearer td_live_...`.","version":"1.0.0"},"paths":{"/me":{"get":{"summary":"Me","description":"Self-orientation (mirrors the `whoami` tool): plan, rate numbers,\nusage this window/month, and which key is calling.","operationId":"me_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Me Me Get"}}}}}}},"/popular":{"get":{"summary":"Popular","description":"The popular-trader shelf: curated wallets with display names and\nlive watching counts. These stream without holding your live slots.","operationId":"popular_popular_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Popular Popular Get"}}}}}}},"/tapes":{"get":{"summary":"Tapes List","description":"Cassette list with metadata; `?wallet=` narrows to one trader folder,\n`?limit=` caps the newest N (additive; default unchanged).","operationId":"tapes_list_tapes_get","parameters":[{"name":"wallet","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Tapes List Tapes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tapes/{tape_id}":{"get":{"summary":"Tape Meta","description":"One cassette: metadata + summary counts.","operationId":"tape_meta_tapes__tape_id__get","parameters":[{"name":"tape_id","in":"path","required":true,"schema":{"type":"string","title":"Tape Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Tape Meta Tapes  Tape Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tapes/{tape_id}/events":{"get":{"summary":"Tape Events","description":"Parsed StreamEvent pages (≤agent_tape_page_max lines/page), filterable\nby `types` (comma list, e.g. `types=fill`). A HEAVY read on the cold\npath: fetch+gunzip runs off the loop inside the admission lanes;\noversized tapes are pointed at /download.","operationId":"tape_events_tapes__tape_id__events_get","parameters":[{"name":"tape_id","in":"path","required":true,"schema":{"type":"string","title":"Tape Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"types","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Types"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Tape Events Tapes  Tape Id  Events Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tapes/{tape_id}/download":{"get":{"summary":"Tape Download","description":"Presigned .jsonl.gz URL (1h) — the bulk-export path.","operationId":"tape_download_tapes__tape_id__download_get","parameters":[{"name":"tape_id","in":"path","required":true,"schema":{"type":"string","title":"Tape Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Tape Download Tapes  Tape Id  Download Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/traders/{trader}":{"get":{"summary":"Trader Card","description":"Trader career card. The ONE PnL is `polymarket.pnl` — Polymarket's\nown model (incl. unrealized, full account history). The `card` block is\nthe V2-era archive record: markets/winrate/volume/first-last-seen,\nposition facts, and career averages. `avg_entry_price` = average cost\nper TOKEN across all buys (dollars/tokens, both outcome sides) — the\ntrader's break-even winrate; compare with `winrate` to price the edge.\nToken-weighted, so cheap-token volume pulls it below typical displayed\nentry prices. On upstream failure the `polymarket` block degrades to\n`{\"status\":\"pm_offline\"}` and only then does the card carry the\narchive's realized `career_pnl_usd`/`pnl_marked_usd` as the fallback\nPnL. The card never fails on the upstream. Start every trader analysis\nhere.","operationId":"trader_card_traders__trader__get","parameters":[{"name":"trader","in":"path","required":true,"schema":{"type":"string","title":"Trader"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trader Card Traders  Trader  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/traders/{trader}/markets":{"get":{"summary":"Trader Markets","description":"Recency-ordered market rows with per-market pnl/outcome; page with\nnext_cursor. Depth is plan-gated — Basic Intelligence sees the 5\nmost-recent markets, Pro/Max the full history. Open rows also carry\nmarket_value_usd + pnl_marked_usd (holdings at last trade).","operationId":"trader_markets_traders__trader__markets_get","parameters":[{"name":"trader","in":"path","required":true,"schema":{"type":"string","title":"Trader"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trader Markets Traders  Trader  Markets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/traders/{trader}/top-markets":{"get":{"summary":"Trader Top Markets","description":"The trader's four ranked highlight slices in ONE call: top_wins +\ntop_losses (realized pnl, RESOLVED markets only), most_traded (fills),\ntop_volume — ranked over your visible history window (Basic\nIntelligence: the 5 most-recent markets; Pro/Max: full history).\n`n` per slice (default 5, clamp 1-20). Open rows carry the marked\nblock. Prefer this over paging the whole list to find extremes.","operationId":"trader_top_markets_traders__trader__top_markets_get","parameters":[{"name":"trader","in":"path","required":true,"schema":{"type":"string","title":"Trader"}},{"name":"n","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"N"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trader Top Markets Traders  Trader  Top Markets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/traders/{trader}/pnl-series":{"get":{"summary":"Trader Pnl Series","description":"The trader's Polymarket PnL curve — the EXACT series polymarket.com\ncharts (their model, includes unrealized, pre-V2 history). `window` =\n24h|7d|30d|ytd|1y|all. Feeds the equity/drawdown template; `max_drawdown`\nis precomputed (positive magnitude). 503 pm_offline if the upstream is\ndown.","operationId":"trader_pnl_series_traders__trader__pnl_series_get","parameters":[{"name":"trader","in":"path","required":true,"schema":{"type":"string","title":"Trader"}},{"name":"window","in":"query","required":false,"schema":{"type":"string","default":"all","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trader Pnl Series Traders  Trader  Pnl Series Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/traders/{trader}/markets/{condition_id}/summary":{"get":{"summary":"Trader Market Summary","description":"The computed stat block (no arrays): entries, sizing, timing pattern,\noutcome/pnl/roi. Prefer this over raw events.","operationId":"trader_market_summary_traders__trader__markets__condition_id__summary_get","parameters":[{"name":"trader","in":"path","required":true,"schema":{"type":"string","title":"Trader"}},{"name":"condition_id","in":"path","required":true,"schema":{"type":"string","title":"Condition Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/traders/{trader}/markets/{condition_id}":{"get":{"summary":"Trader Market Events","description":"SAMPLED DEFAULT (v2) — one call = the whole chart: `series.points`\n(`[ts, last, lo, hi]`, draw (lo+hi)/2) over the title-anchored window +\nthe trader's COMPLETE token-tagged fills + the market header. `points`\n(default 300, 20-600) sizes the chart; `from_ts`/`to_ts` zoom;\n`resolution` forces a bucket size. `?raw=1` restores the verbatim keyset\ntick paging (ticks + next_cursor; `window`=start, `cursor`, `limit`).","operationId":"trader_market_events_traders__trader__markets__condition_id__get","parameters":[{"name":"trader","in":"path","required":true,"schema":{"type":"string","title":"Trader"}},{"name":"condition_id","in":"path","required":true,"schema":{"type":"string","title":"Condition Id"}},{"name":"raw","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Raw"}},{"name":"from_ts","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"From Ts"}},{"name":"to_ts","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"To Ts"}},{"name":"resolution","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Resolution"}},{"name":"points","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Points"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"window","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Window"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/traders/{trader}/markets/{condition_id}/tape":{"get":{"summary":"Trader Market Tape","description":"The FULL market as per-second change-compressed `[ts, last, lo, hi]`\nrows in ONE gzipped response (§7b) — the client does all bucketing + the\nmid line. One call assembles what `?raw=1` needed dozens of pages for.\nResolved tapes are immutable (private + ETag); open markets short-TTL.","operationId":"trader_market_tape_traders__trader__markets__condition_id__tape_get","parameters":[{"name":"trader","in":"path","required":true,"schema":{"type":"string","title":"Trader"}},{"name":"condition_id","in":"path","required":true,"schema":{"type":"string","title":"Condition Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/traders/{trader}/fills":{"get":{"summary":"Trader Fills Since","description":"Cross-market fills since X — the monitoring primitive (~pipeline-fresh,\nany wallet, zero tracker cost). Clamped to your visible market set (Basic\nIntelligence = the 5 most-recent markets; Pro/Max = full history); poll\nwith next_cursor.","operationId":"trader_fills_since_traders__trader__fills_get","parameters":[{"name":"trader","in":"path","required":true,"schema":{"type":"string","title":"Trader"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Since"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trader Fills Since Traders  Trader  Fills Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"servers":[{"url":"/api/agent/v1"}]}