{"auth":"Header: X-API-Key: qm_xxx (anonymous key from POST /api/v1/key/trial, or personal key from POST /api/v1/key/generate when signed in)","base_url":"/api/v1","endpoints":[{"billing":"1 token per row returned","description":"Get OHLC candle data","example":"curl -H 'X-API-Key: qm_xxx' '/api/v1/ohlc?timeframe=15min&limit=10'","method":"GET","params":{"end":"2026-04-01","limit":"1000 (max 5000)","start":"2026-01-01","symbol":"EURUSD","timeframe":"1min|5min|15min|1h"},"path":"/api/v1/ohlc"},{"billing":"1 credit per generation","body":{"claude_model":"sonnet|haiku|sonnet-haiku","end_date":"2026-04-01","features":"RSI 14, Bollinger Bands","indicators":{"macd_enabled":true,"macd_fast":12,"macd_signal":9,"macd_slow":26,"rsi_enabled":true,"rsi_period":14},"model":"Random Forest","optimization":"maximize sharpe","pos_rules":{"cooldown":0,"direction":"both|long|short","max_pos":1,"on_opposite":"reverse|close_only|ignore"},"risk":"0.5% stop loss","risk_function":"custom filter logic","signals":"Buy when RSI < 30","start_date":"2025-01-01","symbol":"EURUSD|GBPUSD|USDJPY|USDCHF|AUDUSD|NZDUSD|USDCAD","timeframe":"1min|5min|15min|1h","train_split":0.7},"description":"Generate Python strategy code from natural language. Each section accepts free-text NL. Optionally pass structured indicators for exact params.","example":"curl -X POST -H 'X-API-Key: qm_xxx' -H 'Content-Type: application/json' -d '{\"features\":\"RSI\",\"signals\":\"crossover\",\"model\":\"RF\",\"indicators\":{\"rsi_enabled\":true}}' '/api/v1/generate'","method":"POST","notes":"Returns Framework-v2 code: feature_engineering(df) + strategy_config() (the latter holds the model class, signal threshold, stop_loss/take_profit, pos_rules). Pass the same symbol+timeframe to /api/v1/train. indicators is optional (gives Claude exact params instead of parsing NL); pos_rules are validated (bad values \u2192 400). See /api/v1/indicator-schema for available indicators.","path":"/api/v1/generate"},{"billing":"1 credit per generation","body":{"claude_model":"sonnet","end_date":"2026-04-01","indicators":"(optional merge)","model":"(optional override)","pos_rules":"(optional merge)","start_date":"2025-01-01","symbol":"EURUSD (default; any of the 7 majors)","template":"macd_momentum|mean_reversion|trend_following|scalper|conservative_long","timeframe":"15min (default; 1min|5min|15min|1h)","train_split":0.7},"description":"Generate strategy code from a named template. Optionally override any field.","example":"curl -X POST -H 'X-API-Key: qm_xxx' -H 'Content-Type: application/json' -d '{\"template\":\"scalper\",\"start_date\":\"2025-01-01\",\"end_date\":\"2026-04-01\",\"pos_rules\":{\"direction\":\"long\"}}' '/api/v1/generate/from-template'","method":"POST","notes":"Text fields (features, model, etc.) replace the template value. Dict fields (indicators, pos_rules) are merged \u2014 template base + your overrides.","path":"/api/v1/generate/from-template"},{"billing":"Free","description":"List all available indicators with parameter names, types, defaults, and generated feature columns. No auth required.","example":"curl '/api/v1/indicator-schema'","method":"GET","path":"/api/v1/indicator-schema"},{"billing":"Free","description":"List all chip presets (per section), position rules schema, and curated strategy templates. No auth required.","example":"curl '/api/v1/presets'","method":"GET","notes":"Templates can be sent directly to /api/v1/generate/from-template. Chips are the same options shown in the website UI.","path":"/api/v1/presets"},{"billing":"Free (rate-limited)","body":{"end":"2026-04-01","format":"columns|rows","indicators":{"macd_enabled":true,"rsi_enabled":true,"rsi_period":14},"limit":500,"start":"2025-01-01","symbol":"EURUSD","timeframe":"15min"},"description":"Compute built-in indicators on OHLC data without training a model. Returns indicator values as JSON.","example":"curl -X POST -H 'X-API-Key: qm_xxx' -H 'Content-Type: application/json' -d '{\"indicators\":{\"rsi_enabled\":true,\"rsi_period\":14},\"limit\":100}' '/api/v1/indicators'","method":"POST","notes":"At least one indicator must be enabled. format='columns' returns {indicator: [values]}, format='rows' returns [{timestamp, ind1, ind2}]. Max 5000 rows.","path":"/api/v1/indicators"},{"billing":"1 credit per call","body":{"end":"2026-04-01","fe_mode":"full|basic|none","limit":2000,"provider":"anthropic|groq|ollama","source":"Pine Script code or NL description (required)","start":"2025-01-01","symbol":"EURUSD","timeframe":"15min"},"description":"Convert Pine Script or natural language to a computed indicator via Claude. Returns overlays, panels, signals, and ML features.","example":"curl -X POST -H 'X-API-Key: qm_xxx' -H 'Content-Type: application/json' -d '{\"source\":\"Supertrend with ATR 10, multiplier 3\"}' '/api/v1/indicators/custom'","method":"POST","notes":"fe_mode controls ML feature richness: 'full' = lags+derivatives+rolling, 'basic' = raw values only, 'none' = empty. Auto-retries on exec failure (up to 2x).","path":"/api/v1/indicators/custom"},{"billing":"Credits based on compute time","body":{"capital":10000,"code":"Framework-v2 code from /api/v1/generate (feature_engineering + strategy_config). Raw 'def train_and_backtest(df): ...' also accepted \u2014 the framework wraps it.","commission":6.0,"confidence_threshold":55,"end_date":"2026-03-01","indicators":{"rsi_enabled":true,"rsi_period":14},"leverage":30,"lot_size":1.0,"model_name":"My Model (optional; auto-named Model_N+1)","start_date":"2026-01-01","swap_long":-1.0,"swap_short":0.3,"symbol":"EURUSD|GBPUSD|USDJPY|USDCHF|AUDUSD|NZDUSD|USDCAD","timeframe":"1min|5min|15min|1h","train_split":0.7},"description":"Start model training (non-blocking, returns job_id + model_stem for polling). Trains on the parquet for the given symbol+timeframe.","example":"curl -X POST -H 'X-API-Key: qm_xxx' -H 'Content-Type: application/json' -d '{\"code\":\"...\",\"symbol\":\"GBPUSD\",\"timeframe\":\"1min\"}' '/api/v1/train'","method":"POST","notes":"confidence_threshold is classification-only (#432) - a regression strategy (task='regression') refuses it with 400; use signal_rules in strategy_config() instead (return/spread units).","path":"/api/v1/train"},{"billing":"Free","description":"Poll training job status. Returns metrics when done.","example":"curl -H 'X-API-Key: qm_xxx' '/api/v1/train/42'","method":"GET","path":"/api/v1/train/<job_id>","response_statuses":{"done":"complete (includes metrics)","failed":"error (includes error message)","queued":"waiting in queue","running":"training in progress"}},{"billing":"Free","description":"List all trained models","example":"curl -H 'X-API-Key: qm_xxx' '/api/v1/models'","method":"GET","path":"/api/v1/models"},{"billing":"Free","description":"Delete a trained model","example":"curl -X DELETE -H 'X-API-Key: qm_xxx' '/api/v1/models/13_Model_1'","method":"DELETE","path":"/api/v1/models/<name>"},{"billing":"1 credit per prediction","body":{"model_name":"Model_1"},"description":"Run prediction on a trained model. Returns buy/sell signals with confidence.","example":"curl -X POST -H 'X-API-Key: qm_xxx' -H 'Content-Type: application/json' -d '{\"model_name\":\"Model_1\"}' '/api/v1/predict'","method":"POST","path":"/api/v1/predict"},{"billing":"Per deployment","body":{"channels":["webhook"],"model_name":"Model_1","webhook_url":"https://your-server.com/signals"},"description":"Deploy model for live signal delivery (webhook, telegram)","example":"curl -X POST -H 'X-API-Key: qm_xxx' -H 'Content-Type: application/json' -d '{\"model_name\":\"Model_1\",\"channels\":[\"webhook\"]}' '/api/v1/deploy'","method":"POST","path":"/api/v1/deploy"},{"billing":"Free","description":"Stop live signal delivery for a model","example":"curl -X DELETE -H 'X-API-Key: qm_xxx' '/api/v1/deploy/13_Model_1'","method":"DELETE","path":"/api/v1/deploy/<model>"},{"billing":"Free (rate-limited)","body":{"model":"optional stem","url":"https://your-server.com/signals (webhook or Discord)"},"description":"Send one test message on telegram, email, webhook or discord. Answers {channel, ok, reason, ms}; reason says why a failed test did not arrive; the email test always goes to the account email, and a trial key's answers 403","example":"curl -X POST -H 'X-API-Key: qm_xxx' -H 'Content-Type: application/json' -d '{\"url\":\"https://webhook.site/x\"}' '/api/v1/channels/webhook/test'","method":"POST","path":"/api/v1/channels/<channel>/test"},{"billing":"Free","body":{"channels":["telegram","webhook"],"webhook_url":"https://your-server.com/signals"},"description":"Change the delivery channels of a live model without stopping it. Answers per channel: ok, live_on, channels_total, channel_results [{channel, ok, reason}], added, removed","example":"curl -X POST -H 'X-API-Key: qm_xxx' -H 'Content-Type: application/json' -d '{\"channels\":[\"telegram\"]}' '/api/v1/deploy/13_Model_1/channels'","method":"POST","path":"/api/v1/deploy/<model>/channels"},{"billing":"Free","description":"Get full backtest results: metrics, equity curve, signal count","example":"curl -H 'X-API-Key: qm_xxx' '/api/v1/results/Model_1'","method":"GET","path":"/api/v1/results/<model>"},{"billing":"Free","description":"Get signal delivery log for a deployed model (prediction history)","example":"curl -H 'X-API-Key: qm_xxx' '/api/v1/signals/Model_1'","method":"GET","path":"/api/v1/signals/<model>"}],"name":"QuantifyMe API","version":"1.0"}
