Initiate Analysis
initiate_analysisInitiate a full StockLens AI analysis for a specific stock. Starting a new run may consume one Analysis credit (LENS_AI) or one Plus Analysis credit (LENS_AI_PLUS, which may add AI narratives). Returns an analysis_id immediately — completion is asynchronous. Retrieve status or results with a separate fetch_analysis_result call when the user asks for them. A recent matching analysis may be reused; the receipt explicitly reports new_run_started and reused_existing without claiming an asynchronous credit charge has completed. Concurrent identical initiations receive retry guidance. Free supports the standard Analysis only; Pro and Max unlock Plus Analysis.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Analysis depth: standard or plus. Standard consumes an Analysis credit (LENS_AI). Plus consumes a Plus Analysis credit (LENS_AI_PLUS) and may add AI narratives. Default standard. | |
| ticker | Yes | Stock ticker symbol (e.g. AAPL) | |
| exchange | No | Exchange code (e.g. NASDAQ). Optional. | |
| time_range | No | Time horizon — shapes which signals the analysis weighs most (shorter horizons favor price action, momentum and news; longer favor fundamentals and quality). Not a price forecast. One window per calibrated band: short_2_wk (Short-term), medium_1_mo (Medium-term), long_1_yr (Long-term). Default medium_1_mo. The legacy medium_2_mo and long_2_yr aliases are still accepted and resolve to medium_1_mo and long_1_yr respectively. | |
| risk_tolerance | No | Analysis focus — reweights how much the analysis weighs downside/quality risk vs. growth/fundamentals. NOT a personal risk or suitability assessment, and it never changes the company's underlying facts. low=Defensive, medium=Balanced, high=Growth. Default medium. | |
| analysis_emphasis | No | Optional. RISK_EMPHASIS | BALANCED | FUNDAMENTAL_GROWTH_EMPHASIS. Must agree with the emphasis implied by risk_tolerance (low->RISK_EMPHASIS, medium->BALANCED, high->FUNDAMENTAL_GROWTH_EMPHASIS); a mismatch is rejected as a validation error before any credit is consumed. | |
| evidence_history_family | No | Optional. SHORT_HISTORY | MEDIUM_HISTORY | LONG_HISTORY. Must agree with the family implied by time_range (short_2_wk->SHORT_HISTORY, medium_1_mo/medium_2_mo->MEDIUM_HISTORY, long_1_yr/long_2_yr->LONG_HISTORY); a mismatch is rejected as a validation error before any credit is consumed. Does not select a representative range on its own. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | Yes | ||
| status | Yes | ||
| analysis_id | Yes | ||
| credit_type | Yes | ||
| new_run_started | Yes | ||
| reused_existing | Yes | ||
| estimated_seconds | Yes |