Skip to content
StatAlphaDocumentation

API schemas

{
"properties": {
"description": {
"type": "string",
"maxLength": 5000,
"minLength": 1,
"title": "Description"
},
"expected_behavior": {
"anyOf": [
{
"type": "string",
"maxLength": 3000
},
{
"type": "null"
}
],
"title": "Expected Behavior"
},
"context": {
"additionalProperties": true,
"type": "object",
"title": "Context"
},
"notify": {
"type": "boolean",
"title": "Notify",
"default": true
}
},
"type": "object",
"required": [
"description"
],
"title": "BugReportRequest"
}
{
"properties": {
"expected_sessions": {
"type": "integer",
"title": "Expected Sessions"
},
"materialized_sessions": {
"type": "integer",
"title": "Materialized Sessions"
},
"complete_sessions": {
"type": "integer",
"title": "Complete Sessions"
},
"evaluated_sessions": {
"type": "integer",
"title": "Evaluated Sessions",
"default": 0
},
"missing_sessions": {
"type": "integer",
"title": "Missing Sessions",
"default": 0
},
"excluded_sessions": {
"type": "integer",
"title": "Excluded Sessions",
"default": 0
},
"complete_session_pct": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Complete Session Pct"
},
"exclusions": {
"items": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"type": "array",
"title": "Exclusions"
}
},
"type": "object",
"required": [
"expected_sessions",
"materialized_sessions",
"complete_sessions"
],
"title": "Coverage"
}
{
"properties": {
"sample_count": {
"type": "integer",
"title": "Sample Count"
},
"mean": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Mean"
},
"median": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Median"
},
"stddev": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Stddev",
"description": "Population standard deviation"
},
"p25": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "P25"
},
"p75": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "P75"
},
"p90": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "P90"
},
"p95": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "P95"
}
},
"type": "object",
"required": [
"sample_count",
"mean",
"median",
"stddev",
"p25",
"p75",
"p90",
"p95"
],
"title": "Distribution"
}
{
"properties": {
"definition_version": {
"type": "string",
"title": "Definition Version"
},
"event_id": {
"type": "string",
"title": "Event Id"
},
"direction": {
"type": "string",
"enum": [
"long",
"short"
],
"title": "Direction"
},
"reference_price": {
"type": "number",
"title": "Reference Price"
},
"anchor": {
"type": "string",
"title": "Anchor"
},
"evaluation_start": {
"type": "string",
"title": "Evaluation Start"
},
"evaluation_end": {
"type": "string",
"title": "Evaluation End"
},
"entry_model": {
"type": "string",
"title": "Entry Model"
},
"horizon": {
"type": "string",
"title": "Horizon"
},
"status": {
"type": "string",
"enum": [
"complete",
"censored"
],
"title": "Status"
},
"mfe": {
"anyOf": [
{
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"type": "object"
},
{
"type": "null"
}
],
"title": "Mfe"
},
"mae": {
"anyOf": [
{
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"type": "object"
},
{
"type": "null"
}
],
"title": "Mae"
}
},
"additionalProperties": true,
"type": "object",
"required": [
"definition_version",
"event_id",
"direction",
"reference_price",
"anchor",
"evaluation_start",
"evaluation_end",
"entry_model",
"horizon",
"status",
"mfe",
"mae"
],
"title": "ExcursionEvent"
}
{
"properties": {
"direction": {
"type": "string",
"enum": [
"long",
"short"
],
"title": "Direction"
},
"entry_model": {
"type": "string",
"title": "Entry Model"
},
"horizon": {
"type": "string",
"title": "Horizon"
},
"sample_count": {
"type": "integer",
"title": "Sample Count"
},
"eligible_event_count": {
"type": "integer",
"title": "Eligible Event Count"
},
"censored_count": {
"type": "integer",
"title": "Censored Count"
},
"mfe_pct": {
"$ref": "#/components/schemas/Distribution"
},
"mae_pct": {
"$ref": "#/components/schemas/Distribution"
},
"mfe_mae_ratio": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Mfe Mae Ratio"
},
"ratio_semantics": {
"type": "string",
"title": "Ratio Semantics"
},
"target_stop": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Target Stop"
},
"segmentation": {
"anyOf": [
{
"$ref": "#/components/schemas/OrbSegmentation"
},
{
"type": "null"
}
]
}
},
"additionalProperties": true,
"type": "object",
"required": [
"direction",
"entry_model",
"horizon",
"sample_count",
"eligible_event_count",
"censored_count",
"mfe_pct",
"mae_pct",
"mfe_mae_ratio",
"ratio_semantics"
],
"title": "ExcursionGroup"
}
{
"properties": {
"status": {
"type": "string",
"enum": [
"complete",
"partial",
"pending",
"unavailable"
],
"title": "Status"
},
"definition_version": {
"type": "string",
"title": "Definition Version",
"default": "excursion-v1"
},
"profile": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Profile"
},
"symbol": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Symbol"
},
"family": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Family"
},
"coverage": {
"anyOf": [
{
"$ref": "#/components/schemas/Coverage"
},
{
"type": "null"
}
]
},
"materialization": {
"anyOf": [
{
"additionalProperties": {
"anyOf": [
{
"type": "integer"
},
{
"type": "boolean"
}
]
},
"type": "object"
},
{
"type": "null"
}
],
"title": "Materialization"
},
"computed_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Computed At"
},
"data_through": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Data Through"
},
"groups": {
"items": {
"$ref": "#/components/schemas/ExcursionGroup"
},
"type": "array",
"title": "Groups"
},
"events": {
"anyOf": [
{
"items": {
"$ref": "#/components/schemas/ExcursionEvent"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Events"
}
},
"additionalProperties": true,
"type": "object",
"required": [
"status"
],
"title": "ExcursionResponse"
}
{
"properties": {
"algorithm_version": {
"type": "string",
"title": "Algorithm Version",
"examples": [
"gap-rth-2.0.0"
]
},
"event_definition_version": {
"type": "string",
"title": "Event Definition Version"
},
"symbol": {
"type": "string",
"title": "Symbol"
},
"data": {
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array",
"title": "Data",
"description": "One range-gap event per eligible exchange session, including first touches, censoring, structure, segmentation and every requested horizon."
},
"summary": {
"additionalProperties": true,
"type": "object",
"title": "Summary",
"description": "Separate up/down distributions, Kaplan-Meier fill/survival curves and outcome probabilities with denominators."
},
"segments": {
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array",
"title": "Segments"
},
"observation_window": {
"additionalProperties": true,
"type": "object",
"title": "Observation Window"
},
"data_freshness": {
"additionalProperties": true,
"type": "object",
"title": "Data Freshness"
},
"data_quality": {
"additionalProperties": true,
"type": "object",
"title": "Data Quality"
},
"configuration": {
"additionalProperties": true,
"type": "object",
"title": "Configuration"
},
"calendar": {
"additionalProperties": true,
"type": "object",
"title": "Calendar"
},
"start_date": {
"type": "string",
"title": "Start Date"
},
"end_date": {
"type": "string",
"title": "End Date"
}
},
"type": "object",
"required": [
"algorithm_version",
"event_definition_version",
"symbol",
"data",
"summary",
"segments",
"observation_window",
"data_freshness",
"data_quality",
"configuration",
"calendar",
"start_date",
"end_date"
],
"title": "GapOutcomeResponse",
"description": "Version 2; raw events are included in summaries for reproducibility.",
"examples": [
{
"algorithm_version": "gap-rth-2.0.0",
"calendar": {
"name": "NYSE"
},
"configuration": {
"horizons": [
0,
1,
3,
5,
10,
20
]
},
"data": [
{
"close_gap_pct": 10,
"close_gap_size": 10,
"date": "2026-03-06",
"direction": "up",
"events": {
"close_gap_fill": {
"censored": true,
"observed": false
},
"range_reentry": {
"censored": false,
"observed": true,
"session": 1
}
},
"is_filled": false,
"range_gap_pct": 8,
"range_gap_size": 8
}
],
"data_freshness": {
"source_last_bar": "2026-03-09T19:59:00Z"
},
"data_quality": {
"price_adjustment": "corporate-action verification unavailable"
},
"end_date": "2026-03-09",
"event_definition_version": "gap-rth-2.0.0",
"observation_window": {
"end": "2026-03-09T20:00:00Z"
},
"segments": [],
"start_date": "2026-03-06",
"summary": {
"down": {
"insufficient_data": true,
"sample_count": 0
},
"up": {
"insufficient_data": true,
"sample_count": 1
}
},
"symbol": "AAPL"
}
]
}
{
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}
{
"properties": {},
"additionalProperties": true,
"type": "object",
"title": "LegacyGapResponse",
"description": "Unchanged v1 response; consult /stats/gap/doc for legacy fields."
}
{
"properties": {
"sample_count": {
"type": "integer",
"title": "Sample Count"
},
"total_observations": {
"type": "integer",
"title": "Total Observations"
},
"complete_observations": {
"type": "integer",
"title": "Complete Observations"
},
"horizon_censored_count": {
"type": "integer",
"title": "Horizon Censored Count"
},
"censored_count": {
"type": "integer",
"title": "Censored Count"
},
"target_first_count": {
"type": "integer",
"title": "Target First Count"
},
"stop_first_count": {
"type": "integer",
"title": "Stop First Count"
},
"ambiguous_count": {
"type": "integer",
"title": "Ambiguous Count"
},
"no_touch_count": {
"type": "integer",
"title": "No Touch Count"
},
"unresolved_touch_censored_count": {
"type": "integer",
"title": "Unresolved Touch Censored Count"
},
"probability_denominator": {
"type": "integer",
"title": "Probability Denominator"
},
"sample_reliability": {
"type": "string",
"enum": [
"insufficient",
"low",
"moderate",
"strong"
],
"title": "Sample Reliability"
},
"sample_reliability_basis": {
"type": "string",
"title": "Sample Reliability Basis"
},
"target_before_stop_pct": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Target Before Stop Pct"
},
"target_before_stop_ci95": {
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"type": "object",
"title": "Target Before Stop Ci95"
},
"mfe_pct": {
"$ref": "#/components/schemas/Distribution"
},
"mae_pct": {
"$ref": "#/components/schemas/Distribution"
},
"filters": {
"additionalProperties": true,
"type": "object",
"title": "Filters"
},
"segment": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Segment"
},
"baseline_target_before_stop_pct": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Baseline Target Before Stop Pct"
},
"segment_target_before_stop_pct": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Segment Target Before Stop Pct"
},
"lift_percentage_points": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Lift Percentage Points"
},
"relative_lift_pct": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Relative Lift Pct"
}
},
"additionalProperties": true,
"type": "object",
"required": [
"sample_count",
"total_observations",
"complete_observations",
"horizon_censored_count",
"censored_count",
"target_first_count",
"stop_first_count",
"ambiguous_count",
"no_touch_count",
"unresolved_touch_censored_count",
"probability_denominator",
"sample_reliability",
"sample_reliability_basis",
"target_before_stop_pct",
"target_before_stop_ci95",
"mfe_pct",
"mae_pct",
"filters",
"baseline_target_before_stop_pct",
"segment_target_before_stop_pct",
"lift_percentage_points",
"relative_lift_pct"
],
"title": "OrbConditionalMetrics"
}
{
"properties": {
"sample_count": {
"type": "integer",
"title": "Sample Count"
},
"total_observations": {
"type": "integer",
"title": "Total Observations"
},
"complete_observations": {
"type": "integer",
"title": "Complete Observations"
},
"horizon_censored_count": {
"type": "integer",
"title": "Horizon Censored Count"
},
"censored_count": {
"type": "integer",
"title": "Censored Count"
},
"target_first_count": {
"type": "integer",
"title": "Target First Count"
},
"stop_first_count": {
"type": "integer",
"title": "Stop First Count"
},
"ambiguous_count": {
"type": "integer",
"title": "Ambiguous Count"
},
"no_touch_count": {
"type": "integer",
"title": "No Touch Count"
},
"unresolved_touch_censored_count": {
"type": "integer",
"title": "Unresolved Touch Censored Count"
},
"probability_denominator": {
"type": "integer",
"title": "Probability Denominator"
},
"sample_reliability": {
"type": "string",
"enum": [
"insufficient",
"low",
"moderate",
"strong"
],
"title": "Sample Reliability"
},
"sample_reliability_basis": {
"type": "string",
"title": "Sample Reliability Basis"
},
"target_before_stop_pct": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Target Before Stop Pct"
},
"target_before_stop_ci95": {
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"type": "object",
"title": "Target Before Stop Ci95"
},
"mfe_pct": {
"$ref": "#/components/schemas/Distribution"
},
"mae_pct": {
"$ref": "#/components/schemas/Distribution"
}
},
"additionalProperties": true,
"type": "object",
"required": [
"sample_count",
"total_observations",
"complete_observations",
"horizon_censored_count",
"censored_count",
"target_first_count",
"stop_first_count",
"ambiguous_count",
"no_touch_count",
"unresolved_touch_censored_count",
"probability_denominator",
"sample_reliability",
"sample_reliability_basis",
"target_before_stop_pct",
"target_before_stop_ci95",
"mfe_pct",
"mae_pct"
],
"title": "OrbSegmentMetrics"
}
{
"properties": {
"statistics_version": {
"type": "string",
"title": "Statistics Version"
},
"context_version": {
"type": "string",
"title": "Context Version"
},
"dimension": {
"type": "string",
"title": "Dimension"
},
"baseline": {
"$ref": "#/components/schemas/OrbSegmentMetrics"
},
"selected": {
"$ref": "#/components/schemas/OrbConditionalMetrics"
},
"segments": {
"items": {
"$ref": "#/components/schemas/OrbConditionalMetrics"
},
"type": "array",
"title": "Segments"
},
"missing_context_counts": {
"additionalProperties": {
"type": "integer"
},
"type": "object",
"title": "Missing Context Counts"
}
},
"additionalProperties": true,
"type": "object",
"required": [
"statistics_version",
"context_version",
"dimension",
"baseline",
"selected",
"segments",
"missing_context_counts"
],
"title": "OrbSegmentation"
}
{
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
}