# Stratex API — Overview for AI Agents

**Stratex** provides a hosted API for **backtesting** trading strategies and receiving **setup-trigger alerts**. It is designed for autonomous AI agents that need to test strategies and get notified when conditions fire in real time.

## What the service does

- **Backtesting:** Run historical backtests with a saved setup. You receive the full list of executed trades, summary statistics, and optionally a small summary chart image (e.g. win/loss) for sharing or display.
- **Setup-trigger alerts:** Define setups using structured parameters (symbol, direction, timeframe, entry/exit conditions). When the market satisfies your conditions, the service can notify you via **webhook** (primary) or **polling**.

## Capabilities

- Create and manage setups via structured parameters (no low-level strategy syntax exposed).
- Run backtests and retrieve results by `runId`; responses include full trade list and agent-friendly summary text.
- Receive triggers by **webhook** (POST to your URL when a setup fires) or **polling** (`GET /api/v1/alerts/pending`).

## Pricing (summary)

- **Alerts:** Subscription tiers control how many setups you can run live simultaneously (live slots), broken down by timeframe band. Free tier allows backtesting only (no live slots). Paid tiers unlock live slots across 1m, 5m, 15m/1h, and 4h+ bands. See the account dashboard or signup flow for exact tier limits.
- **Backtesting:** Sold as fixed packs of 1-minute bars (e.g. 100k or 1M bars). Usage is metered; you consume from your purchased balance when you run backtests.

## How to get started

1. Have your human user **sign up** at the service (email, password; optional company name).
2. In the **account dashboard**, create an **API key** and optionally subscribe to an alerts tier and/or purchase backtest bars.
3. Use the API key in `Authorization: Bearer <key>` or `X-Api-Key` for all API requests.
4. **Create a setup** (POST /api/v1/setups) with structured parameters; optionally set a `webhookUrl` for alerts.
5. **Run a backtest** (POST /api/v1/backtest/run) with the `setupId`, or rely on the scheduler to evaluate the setup and send alerts to your webhook or make them available via polling.

## Value proposition

- No need to host market data or evaluation engines; the service runs setups and backtests for you.
- Webhooks give low-latency alerts; polling is available as a fallback.
- Responses are designed for agent consumption (IDs, summaries, optional chart image).

## Discovery and docs

- **Structured discovery:** `GET /api/v1/agent-info` returns JSON with capabilities, pricing summary, doc URLs, and endpoint list. No authentication required.
- **Full usage guide:** See [Agent Skill](/docs/agent-skill.md) for authentication, workflow, endpoints, request/response shapes, and examples.
