Developers

Developer API documentation

Everything you need to call the API and use the returned data in your own website or internal tools.

Public Preview API

Browser-safe, CORS-enabled, intentionally constrained. No auth.

Billing API

Stripe checkout + API key provisioning for subscribers.

Customer API

Risk signals, enterprise feeds, webhooks, and billing — API-key authenticated, tiered by SKU.

Base URLs (how to point your site at the API)

The marketing website is static, so API origins are baked at build time:

Public API (preview + billing)
PUBLIC_API_BASE_URL (defaults to http://localhost:8000)
Customer API (subscriber)
PUBLIC_CUSTOMER_API_BASE_URL (no default; set in production)
Tip: the /live-preview/ page also supports a local override query string: ?api=http://localhost:8000.
Schemas + endpoint shapes (OpenAPI)

The most complete schema source-of-truth is each service’s OpenAPI spec. Below we render request/response shapes and schema descriptions directly from /openapi.json.

Public API spec
Base: https://trust.supercalc.ai
7 paths · 7 schemas
Customer API spec
Base: https://polymarket-gvf-customer-xc6bbvvisq-uc.a.run.app
18 paths · 16 schemas
Public API endpoints
GET /health Health
Request body schema
No JSON body
200/201 response schema

                          {
  "title": "HealthResponse",
  "properties": {
    "status": {
      "type": "string",
      "title": "Status"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "title": "Timestamp"
    }
  },
  "type": "object",
  "required": [
    "status",
    "timestamp"
  ]
}
                        
GET /api/v1/public/live-preview Live Preview
Return a limited, interpretive-friendly payload for the website's Live Preview. - Market set is capped (<=8). - Only a couple of signals/feature-derived values are returned. - Window is short (hours) and points are capped. - Query params are intentionally not supported (to keep it incomplete and cacheable).
Request body schema
No JSON body
200/201 response schema

                          {
  "additionalProperties": true,
  "type": "object",
  "title": "Response Live Preview Api V1 Public Live Preview Get"
}
                        
GET /api/v1/public/stress_index Public Stress Index
Delayed systemic-stress index for the public site. Fixed window/shape; the series is embargoed by ``PUBLIC_STRESS_DELAY_HOURS`` (default 24 h). Real-time access is a customer API subscription.
Request body schema
No JSON body
200/201 response schema

                          {
  "additionalProperties": true,
  "type": "object",
  "title": "Response Public Stress Index Api V1 Public Stress Index Get"
}
                        
GET /api/v1/public/alert_ledger Public Alert Ledger
Delayed, scored hedge-alert ledger: rows + per-arm precision + gate. Every alertable window is recorded append-only and scored post-horizon; this endpoint serves the embargoed view (``PUBLIC_LEDGER_DELAY_DAYS``, default 7 days). Fresh alerts stay on the paid stream.
Request body schema
No JSON body
200/201 response schema

                          {
  "additionalProperties": true,
  "type": "object",
  "title": "Response Public Alert Ledger Api V1 Public Alert Ledger Get"
}
                        
POST /api/v1/billing/create-checkout-session Create Checkout Session
Request body schema

                          {
  "title": "CreateCheckoutSessionRequest",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "title": "Email"
    },
    "interval": {
      "type": "string",
      "enum": [
        "monthly",
        "yearly"
      ],
      "title": "Interval",
      "default": "monthly"
    },
    "sku_code": {
      "type": "string",
      "enum": [
        "starter",
        "pro",
        "desk",
        "enterprise_data"
      ],
      "title": "Sku Code",
      "default": "starter"
    }
  },
  "type": "object",
  "required": [
    "email"
  ]
}
                        
200/201 response schema

                          {
  "title": "CreateCheckoutSessionResponse",
  "properties": {
    "url": {
      "type": "string",
      "title": "Url"
    }
  },
  "type": "object",
  "required": [
    "url"
  ]
}
                        
POST /api/v1/billing/provision-api-key Provision Api Key
Request body schema

                          {
  "title": "ProvisionAPIKeyRequest",
  "properties": {
    "session_id": {
      "type": "string",
      "title": "Session Id"
    }
  },
  "type": "object",
  "required": [
    "session_id"
  ]
}
                        
200/201 response schema

                          {
  "title": "ProvisionAPIKeyResponse",
  "properties": {
    "status": {
      "type": "string",
      "title": "Status"
    },
    "api_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Api Key"
    },
    "customer_email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Customer Email"
    }
  },
  "type": "object",
  "required": [
    "status"
  ]
}
                        
POST /api/v1/billing/stripe/webhook Stripe Webhook
Request body schema
No JSON body
200/201 response schema

                          {
  "type": "object",
  "additionalProperties": true,
  "title": "Response Stripe Webhook Api V1 Billing Stripe Webhook Post"
}
                        
Public API schema glossary (components.schemas)
CreateCheckoutSessionRequest
                    {
  "title": "CreateCheckoutSessionRequest",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "title": "Email"
    },
    "interval": {
      "type": "string",
      "enum": [
        "monthly",
        "yearly"
      ],
      "title": "Interval",
      "default": "monthly"
    },
    "sku_code": {
      "type": "string",
      "enum": [
        "starter",
        "pro",
        "desk",
        "enterprise_data"
      ],
      "title": "Sku Code",
      "default": "starter"
    }
  },
  "type": "object",
  "required": [
    "email"
  ]
}
                  
CreateCheckoutSessionResponse
                    {
  "title": "CreateCheckoutSessionResponse",
  "properties": {
    "url": {
      "type": "string",
      "title": "Url"
    }
  },
  "type": "object",
  "required": [
    "url"
  ]
}
                  
HTTPValidationError
                    {
  "title": "HTTPValidationError",
  "properties": {
    "detail": {
      "items": {
        "title": "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"
        ]
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object"
}
                  
HealthResponse
                    {
  "title": "HealthResponse",
  "properties": {
    "status": {
      "type": "string",
      "title": "Status"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "title": "Timestamp"
    }
  },
  "type": "object",
  "required": [
    "status",
    "timestamp"
  ]
}
                  
ProvisionAPIKeyRequest
                    {
  "title": "ProvisionAPIKeyRequest",
  "properties": {
    "session_id": {
      "type": "string",
      "title": "Session Id"
    }
  },
  "type": "object",
  "required": [
    "session_id"
  ]
}
                  
ProvisionAPIKeyResponse
                    {
  "title": "ProvisionAPIKeyResponse",
  "properties": {
    "status": {
      "type": "string",
      "title": "Status"
    },
    "api_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Api Key"
    },
    "customer_email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Customer Email"
    }
  },
  "type": "object",
  "required": [
    "status"
  ]
}
                  
ValidationError
                    {
  "title": "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"
  ]
}
                  
Customer API endpoints
GET /health Health
Request body schema
No JSON body
200/201 response schema

                          {
  "title": "HealthResponse",
  "properties": {
    "status": {
      "type": "string",
      "title": "Status"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "title": "Timestamp"
    }
  },
  "type": "object",
  "required": [
    "status",
    "timestamp"
  ]
}
                        
GET /api/v1/risk/hedge_opportunities Fresh hedge (tail-exit) opportunities
Fresh signal onsets priced as exit-at-onset hedge windows: the current one-leg exit cost vs the backtest hedge book's adverse-excursion prior for that signal arm, with capacity fill at the requested notional. Each opportunity carries the arm's trailing live-alert precision and an `actionable` flag (positive expected edge, a fresh quote, and an arm whose precision clears the gate). The `arms` block gives per-arm backtest provenance (n_trades, t-stat, edge, evidence age) so the claim is auditable. Decision support only — nothing executes.
Request body schema
No JSON body
200/201 response schema

                          {
  "title": "HedgeOpportunitiesResponse",
  "properties": {
    "schema_version": {
      "type": "string",
      "title": "Schema Version"
    },
    "as_of": {
      "type": "string",
      "title": "As Of"
    },
    "methodology": {
      "type": "string",
      "title": "Methodology"
    },
    "units": {
      "additionalProperties": true,
      "type": "object",
      "title": "Units"
    },
    "lookback_minutes": {
      "type": "integer",
      "title": "Lookback Minutes"
    },
    "horizon_minutes": {
      "type": "integer",
      "title": "Horizon Minutes"
    },
    "notional": {
      "type": "number",
      "title": "Notional"
    },
    "onset_thresholds": {
      "additionalProperties": true,
      "type": "object",
      "title": "Onset Thresholds"
    },
    "base_types": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Base Types"
    },
    "precision_gate": {
      "title": "PrecisionGate",
      "properties": {
        "min_precision": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Min Precision"
        },
        "precision_days": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Precision Days"
        },
        "precision_min_scored": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Precision Min Scored"
        }
      },
      "additionalProperties": true,
      "type": "object"
    },
    "backtest_stats_run": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Backtest Stats Run"
    },
    "evidence_age_days": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Evidence Age Days",
      "description": "Trailing window (days) the live precision is measured over"
    },
    "arms": {
      "additionalProperties": {
        "$ref": "#/components/schemas/HedgeArm"
      },
      "type": "object",
      "title": "Arms"
    },
    "count": {
      "type": "integer",
      "title": "Count"
    },
    "n_actionable": {
      "type": "integer",
      "title": "N Actionable",
      "default": 0
    },
    "opportunities": {
      "items": {
        "title": "HedgeOpportunity",
        "properties": {
          "market_id": {
            "type": "string",
            "title": "Market Id"
          },
          "question": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "signal_type": {
            "type": "string",
            "title": "Signal Type",
            "description": "Signal arm, e.g. transition_risk_fast"
          },
          "signal_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signal Value"
          },
          "onset_ts": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Onset Ts"
          },
          "age_minutes": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Age Minutes"
          },
          "probability": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Probability"
          },
          "one_leg_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "One Leg Cost",
            "description": "Half-spread + slippage to exit one leg, price units"
          },
          "expected_avoided": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Avoided",
            "description": "0.5 * backtest mean adverse excursion, price units"
          },
          "expected_edge": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Edge",
            "description": "expected_avoided - one_leg_cost, per $1 hedged"
          },
          "premium_vs_payout": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Premium Vs Payout"
          },
          "backtest_premium_vs_payout": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Backtest Premium Vs Payout"
          },
          "backtest_n_trades": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Backtest N Trades"
          },
          "liquidity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Liquidity"
          },
          "fill_at_notional": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fill At Notional"
          },
          "stale_quote": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stale Quote"
          },
          "alert_precision": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Alert Precision",
            "description": "Trailing live-alert precision for this arm (0-1)"
          },
          "precision_n_scored": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Precision N Scored"
          },
          "precision_gate_pass": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Precision Gate Pass"
          },
          "actionable": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actionable",
            "description": "Positive edge, fresh quote, and an arm clearing the precision gate"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "market_id",
          "signal_type"
        ],
        "description": "One market priced as an exit-at-onset hedge window."
      },
      "type": "array",
      "title": "Opportunities"
    }
  },
  "additionalProperties": true,
  "type": "object",
  "required": [
    "schema_version",
    "as_of",
    "methodology",
    "lookback_minutes",
    "horizon_minutes",
    "notional",
    "count"
  ],
  "description": "Contract for ``/api/v1/risk/hedge_opportunities``."
}
                        
GET /api/v1/risk/stress_index Systemic-stress index (breadth of elevated markets)
Share of the covered universe that is elevated per time bucket — a breadth ratio (elevated / covered markets), 0-100 index, trailing z-score, and category attribution, reconstructed from append-only signal tables. The no-discrimination change-point family is excluded.
Request body schema
No JSON body
200/201 response schema

                          {
  "title": "Response Stress Index Api V1 Risk Stress Index Get"
}
                        
GET /api/v1/risk/signal_clusters Concurrent-signal episodes (possible systemic stress)
Hours where an unusually broad set of markets fired at once, relative to the trailing baseline (z-score gate; `min_markets` is only a floor). The change-point family is excluded from clustering.
Request body schema
No JSON body
200/201 response schema

                          {
  "type": "object",
  "additionalProperties": true,
  "title": "Response Signal Clusters Api V1 Risk Signal Clusters Get"
}
                        
GET /api/v1/risk/status Trust / SLA status
Operational trust snapshot: per-table freshness vs SLA, active-pin snapshot coverage of the tracked universe, trailing live hedge-alert precision (overall + per arm), and per-model calibration status including the out-of-fit regression-guard verdict.
Request body schema
No JSON body
200/201 response schema

                          {
  "type": "object",
  "additionalProperties": true,
  "title": "Response Trust Status Api V1 Risk Status Get"
}
                        
GET /api/v1/webhooks/events List Event Types
Request body schema
No JSON body
200/201 response schema

                          {
  "items": {
    "type": "string"
  },
  "type": "array",
  "title": "Response List Event Types Api V1 Webhooks Events Get"
}
                        
POST /api/v1/webhooks Create Webhook
Request body schema

                          {
  "title": "WebhookCreate",
  "properties": {
    "url": {
      "type": "string",
      "maxLength": 2083,
      "minLength": 1,
      "format": "uri",
      "title": "Url"
    },
    "events": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Events"
    },
    "secret": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Secret"
    }
  },
  "type": "object",
  "required": [
    "url",
    "events"
  ]
}
                        
200/201 response schema

                          {
  "title": "WebhookResponse",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "url": {
      "type": "string",
      "title": "Url"
    },
    "events": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Events"
    },
    "active": {
      "type": "boolean",
      "title": "Active"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    }
  },
  "type": "object",
  "required": [
    "id",
    "url",
    "events",
    "active",
    "created_at",
    "updated_at"
  ]
}
                        
GET /api/v1/webhooks List Webhooks
Request body schema
No JSON body
200/201 response schema

                          {
  "type": "array",
  "items": {
    "title": "WebhookResponse",
    "properties": {
      "id": {
        "type": "integer",
        "title": "Id"
      },
      "url": {
        "type": "string",
        "title": "Url"
      },
      "events": {
        "items": {
          "type": "string"
        },
        "type": "array",
        "title": "Events"
      },
      "active": {
        "type": "boolean",
        "title": "Active"
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "title": "Created At"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time",
        "title": "Updated At"
      }
    },
    "type": "object",
    "required": [
      "id",
      "url",
      "events",
      "active",
      "created_at",
      "updated_at"
    ]
  },
  "title": "Response List Webhooks Api V1 Webhooks Get"
}
                        
DELETE /api/v1/webhooks/{webhook_id} Delete Webhook
Request body schema
No JSON body
200/201 response schema
No JSON body
GET /api/v1/enterprise/hedge_ledger Hedge Ledger
Request body schema
No JSON body
200/201 response schema

                          {
  "type": "object",
  "additionalProperties": true,
  "title": "Response Hedge Ledger Api V1 Enterprise Hedge Ledger Get"
}
                        
GET /api/v1/enterprise/status Enterprise Status
Request body schema
No JSON body
200/201 response schema

                          {
  "additionalProperties": true,
  "type": "object",
  "title": "Response Enterprise Status Api V1 Enterprise Status Get"
}
                        
GET /api/v1/enterprise/stress_history Stress History
Request body schema
No JSON body
200/201 response schema

                          {
  "title": "Response Stress History Api V1 Enterprise Stress History Get"
}
                        
GET /api/v1/enterprise/calibration Calibration Export
Request body schema
No JSON body
200/201 response schema

                          {
  "type": "object",
  "additionalProperties": true,
  "title": "Response Calibration Export Api V1 Enterprise Calibration Get"
}
                        
GET /api/v1/enterprise/briefing Briefing Export
Request body schema
No JSON body
200/201 response schema

                          {
  "title": "Response Briefing Export Api V1 Enterprise Briefing Get"
}
                        
POST /api/v1/enterprise/exports Create Export
Request body schema

                          {
  "title": "ExportCreateRequest",
  "properties": {
    "feed": {
      "type": "string",
      "title": "Feed",
      "description": "hedge_ledger|stress_history|calibration|briefing"
    },
    "days": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 365,
          "minimum": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Days"
    },
    "hours": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 2160,
          "minimum": 24
        },
        {
          "type": "null"
        }
      ],
      "title": "Hours"
    },
    "limit": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 100000,
          "minimum": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Limit"
    },
    "horizon_minutes": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 1440,
          "minimum": 15
        },
        {
          "type": "null"
        }
      ],
      "title": "Horizon Minutes"
    },
    "format": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^(json|csv)$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Format"
    },
    "bucket_minutes": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 1440,
          "minimum": 15
        },
        {
          "type": "null"
        }
      ],
      "title": "Bucket Minutes"
    }
  },
  "type": "object",
  "required": [
    "feed"
  ]
}
                        
200/201 response schema
No JSON body
GET /api/v1/enterprise/exports List Exports
Request body schema
No JSON body
200/201 response schema

                          {
  "type": "array",
  "items": {
    "title": "ExportResponse",
    "properties": {
      "id": {
        "type": "integer",
        "title": "Id"
      },
      "feed": {
        "type": "string",
        "title": "Feed"
      },
      "status": {
        "type": "string",
        "title": "Status"
      },
      "params": {
        "anyOf": [
          {
            "additionalProperties": true,
            "type": "object"
          },
          {
            "type": "null"
          }
        ],
        "title": "Params"
      },
      "artifact_uri": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "title": "Artifact Uri"
      },
      "download_url": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "title": "Download Url"
      },
      "row_count": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ],
        "title": "Row Count"
      },
      "error": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "title": "Error"
      },
      "created_at": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "title": "Created At"
      },
      "completed_at": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "title": "Completed At"
      }
    },
    "type": "object",
    "required": [
      "id",
      "feed",
      "status",
      "params",
      "artifact_uri",
      "download_url",
      "row_count",
      "error",
      "created_at",
      "completed_at"
    ]
  },
  "title": "Response List Exports Api V1 Enterprise Exports Get"
}
                        
GET /api/v1/enterprise/exports/{export_id} Get Export
Request body schema
No JSON body
200/201 response schema

                          {
  "title": "ExportResponse",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "feed": {
      "type": "string",
      "title": "Feed"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "params": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Params"
    },
    "artifact_uri": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Artifact Uri"
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Download Url"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Row Count"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created At"
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Completed At"
    }
  },
  "type": "object",
  "required": [
    "id",
    "feed",
    "status",
    "params",
    "artifact_uri",
    "download_url",
    "row_count",
    "error",
    "created_at",
    "completed_at"
  ]
}
                        
GET /api/v1/billing/usage Billing Usage
Request body schema
No JSON body
200/201 response schema

                          {
  "title": "UsageResponse",
  "properties": {
    "org_id": {
      "type": "integer",
      "title": "Org Id"
    },
    "sku": {
      "type": "string",
      "title": "Sku"
    },
    "capabilities": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Capabilities"
    },
    "day": {
      "type": "string",
      "title": "Day"
    },
    "requests_today": {
      "type": "integer",
      "title": "Requests Today"
    },
    "daily_limit": {
      "type": "integer",
      "title": "Daily Limit"
    },
    "routes_today": {
      "additionalProperties": {
        "type": "integer"
      },
      "type": "object",
      "title": "Routes Today"
    }
  },
  "type": "object",
  "required": [
    "org_id",
    "sku",
    "capabilities",
    "day",
    "requests_today",
    "daily_limit",
    "routes_today"
  ]
}
                        
POST /api/v1/billing/rotate-key Rotate Api Key
Request body schema
No JSON body
200/201 response schema

                          {
  "title": "RotateKeyResponse",
  "properties": {
    "api_key": {
      "type": "string",
      "title": "Api Key"
    },
    "key_prefix": {
      "type": "string",
      "title": "Key Prefix"
    }
  },
  "type": "object",
  "required": [
    "api_key",
    "key_prefix"
  ]
}
                        
POST /api/v1/billing/portal Stripe Customer Portal
Return a Stripe Customer Portal URL for subscription self-service.
Request body schema

                          {
  "title": "PortalRequest",
  "properties": {
    "return_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Return Url"
    }
  },
  "type": "object"
}
                        
200/201 response schema

                          {
  "title": "PortalResponse",
  "properties": {
    "url": {
      "type": "string",
      "title": "Url"
    }
  },
  "type": "object",
  "required": [
    "url"
  ]
}
                        
Customer API schema glossary (components.schemas)
ExportCreateRequest
                    {
  "title": "ExportCreateRequest",
  "properties": {
    "feed": {
      "type": "string",
      "title": "Feed",
      "description": "hedge_ledger|stress_history|calibration|briefing"
    },
    "days": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 365,
          "minimum": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Days"
    },
    "hours": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 2160,
          "minimum": 24
        },
        {
          "type": "null"
        }
      ],
      "title": "Hours"
    },
    "limit": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 100000,
          "minimum": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Limit"
    },
    "horizon_minutes": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 1440,
          "minimum": 15
        },
        {
          "type": "null"
        }
      ],
      "title": "Horizon Minutes"
    },
    "format": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^(json|csv)$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Format"
    },
    "bucket_minutes": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 1440,
          "minimum": 15
        },
        {
          "type": "null"
        }
      ],
      "title": "Bucket Minutes"
    }
  },
  "type": "object",
  "required": [
    "feed"
  ]
}
                  
ExportResponse
                    {
  "title": "ExportResponse",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "feed": {
      "type": "string",
      "title": "Feed"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "params": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Params"
    },
    "artifact_uri": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Artifact Uri"
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Download Url"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Row Count"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created At"
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Completed At"
    }
  },
  "type": "object",
  "required": [
    "id",
    "feed",
    "status",
    "params",
    "artifact_uri",
    "download_url",
    "row_count",
    "error",
    "created_at",
    "completed_at"
  ]
}
                  
HTTPValidationError
                    {
  "title": "HTTPValidationError",
  "properties": {
    "detail": {
      "items": {
        "title": "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"
        ]
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object"
}
                  
HealthResponse
                    {
  "title": "HealthResponse",
  "properties": {
    "status": {
      "type": "string",
      "title": "Status"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "title": "Timestamp"
    }
  },
  "type": "object",
  "required": [
    "status",
    "timestamp"
  ]
}
                  
HedgeArm
                    {
  "title": "HedgeArm",
  "properties": {
    "backtest": {
      "title": "HedgeArmBacktest",
      "properties": {
        "n_trades": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "N Trades"
        },
        "t_stat": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "T Stat"
        },
        "edge_vs_naive": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Edge Vs Naive"
        },
        "avg_net_return": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Avg Net Return"
        },
        "premium_vs_payout": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Premium Vs Payout"
        },
        "active_days": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Active Days"
        },
        "as_of": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "As Of"
        }
      },
      "additionalProperties": true,
      "type": "object"
    },
    "alert_precision": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Alert Precision"
    },
    "precision_n_scored": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Precision N Scored"
    },
    "demoted": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Demoted"
    }
  },
  "additionalProperties": true,
  "type": "object",
  "description": "Per-arm provenance so a customer can audit the headline claim."
}
                  
HedgeArmBacktest
                    {
  "title": "HedgeArmBacktest",
  "properties": {
    "n_trades": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "N Trades"
    },
    "t_stat": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "T Stat"
    },
    "edge_vs_naive": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Edge Vs Naive"
    },
    "avg_net_return": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Avg Net Return"
    },
    "premium_vs_payout": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Premium Vs Payout"
    },
    "active_days": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Active Days"
    },
    "as_of": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "As Of"
    }
  },
  "additionalProperties": true,
  "type": "object"
}
                  
HedgeOpportunitiesResponse
                    {
  "title": "HedgeOpportunitiesResponse",
  "properties": {
    "schema_version": {
      "type": "string",
      "title": "Schema Version"
    },
    "as_of": {
      "type": "string",
      "title": "As Of"
    },
    "methodology": {
      "type": "string",
      "title": "Methodology"
    },
    "units": {
      "additionalProperties": true,
      "type": "object",
      "title": "Units"
    },
    "lookback_minutes": {
      "type": "integer",
      "title": "Lookback Minutes"
    },
    "horizon_minutes": {
      "type": "integer",
      "title": "Horizon Minutes"
    },
    "notional": {
      "type": "number",
      "title": "Notional"
    },
    "onset_thresholds": {
      "additionalProperties": true,
      "type": "object",
      "title": "Onset Thresholds"
    },
    "base_types": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Base Types"
    },
    "precision_gate": {
      "title": "PrecisionGate",
      "properties": {
        "min_precision": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Min Precision"
        },
        "precision_days": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Precision Days"
        },
        "precision_min_scored": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Precision Min Scored"
        }
      },
      "additionalProperties": true,
      "type": "object"
    },
    "backtest_stats_run": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Backtest Stats Run"
    },
    "evidence_age_days": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Evidence Age Days",
      "description": "Trailing window (days) the live precision is measured over"
    },
    "arms": {
      "additionalProperties": {
        "$ref": "#/components/schemas/HedgeArm"
      },
      "type": "object",
      "title": "Arms"
    },
    "count": {
      "type": "integer",
      "title": "Count"
    },
    "n_actionable": {
      "type": "integer",
      "title": "N Actionable",
      "default": 0
    },
    "opportunities": {
      "items": {
        "title": "HedgeOpportunity",
        "properties": {
          "market_id": {
            "type": "string",
            "title": "Market Id"
          },
          "question": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "signal_type": {
            "type": "string",
            "title": "Signal Type",
            "description": "Signal arm, e.g. transition_risk_fast"
          },
          "signal_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signal Value"
          },
          "onset_ts": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Onset Ts"
          },
          "age_minutes": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Age Minutes"
          },
          "probability": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Probability"
          },
          "one_leg_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "One Leg Cost",
            "description": "Half-spread + slippage to exit one leg, price units"
          },
          "expected_avoided": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Avoided",
            "description": "0.5 * backtest mean adverse excursion, price units"
          },
          "expected_edge": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Edge",
            "description": "expected_avoided - one_leg_cost, per $1 hedged"
          },
          "premium_vs_payout": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Premium Vs Payout"
          },
          "backtest_premium_vs_payout": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Backtest Premium Vs Payout"
          },
          "backtest_n_trades": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Backtest N Trades"
          },
          "liquidity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Liquidity"
          },
          "fill_at_notional": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fill At Notional"
          },
          "stale_quote": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stale Quote"
          },
          "alert_precision": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Alert Precision",
            "description": "Trailing live-alert precision for this arm (0-1)"
          },
          "precision_n_scored": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Precision N Scored"
          },
          "precision_gate_pass": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Precision Gate Pass"
          },
          "actionable": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actionable",
            "description": "Positive edge, fresh quote, and an arm clearing the precision gate"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "market_id",
          "signal_type"
        ],
        "description": "One market priced as an exit-at-onset hedge window."
      },
      "type": "array",
      "title": "Opportunities"
    }
  },
  "additionalProperties": true,
  "type": "object",
  "required": [
    "schema_version",
    "as_of",
    "methodology",
    "lookback_minutes",
    "horizon_minutes",
    "notional",
    "count"
  ],
  "description": "Contract for ``/api/v1/risk/hedge_opportunities``."
}
                  
HedgeOpportunity
                    {
  "title": "HedgeOpportunity",
  "properties": {
    "market_id": {
      "type": "string",
      "title": "Market Id"
    },
    "question": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Question"
    },
    "category": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Category"
    },
    "signal_type": {
      "type": "string",
      "title": "Signal Type",
      "description": "Signal arm, e.g. transition_risk_fast"
    },
    "signal_value": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Signal Value"
    },
    "onset_ts": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Onset Ts"
    },
    "age_minutes": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Age Minutes"
    },
    "probability": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Probability"
    },
    "one_leg_cost": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "One Leg Cost",
      "description": "Half-spread + slippage to exit one leg, price units"
    },
    "expected_avoided": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expected Avoided",
      "description": "0.5 * backtest mean adverse excursion, price units"
    },
    "expected_edge": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expected Edge",
      "description": "expected_avoided - one_leg_cost, per $1 hedged"
    },
    "premium_vs_payout": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Premium Vs Payout"
    },
    "backtest_premium_vs_payout": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Backtest Premium Vs Payout"
    },
    "backtest_n_trades": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Backtest N Trades"
    },
    "liquidity": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Liquidity"
    },
    "fill_at_notional": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fill At Notional"
    },
    "stale_quote": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stale Quote"
    },
    "alert_precision": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Alert Precision",
      "description": "Trailing live-alert precision for this arm (0-1)"
    },
    "precision_n_scored": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Precision N Scored"
    },
    "precision_gate_pass": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Precision Gate Pass"
    },
    "actionable": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Actionable",
      "description": "Positive edge, fresh quote, and an arm clearing the precision gate"
    }
  },
  "additionalProperties": true,
  "type": "object",
  "required": [
    "market_id",
    "signal_type"
  ],
  "description": "One market priced as an exit-at-onset hedge window."
}
                  
PortalRequest
                    {
  "title": "PortalRequest",
  "properties": {
    "return_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Return Url"
    }
  },
  "type": "object"
}
                  
PortalResponse
                    {
  "title": "PortalResponse",
  "properties": {
    "url": {
      "type": "string",
      "title": "Url"
    }
  },
  "type": "object",
  "required": [
    "url"
  ]
}
                  
PrecisionGate
                    {
  "title": "PrecisionGate",
  "properties": {
    "min_precision": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Min Precision"
    },
    "precision_days": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Precision Days"
    },
    "precision_min_scored": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Precision Min Scored"
    }
  },
  "additionalProperties": true,
  "type": "object"
}
                  
RotateKeyResponse
                    {
  "title": "RotateKeyResponse",
  "properties": {
    "api_key": {
      "type": "string",
      "title": "Api Key"
    },
    "key_prefix": {
      "type": "string",
      "title": "Key Prefix"
    }
  },
  "type": "object",
  "required": [
    "api_key",
    "key_prefix"
  ]
}
                  
UsageResponse
                    {
  "title": "UsageResponse",
  "properties": {
    "org_id": {
      "type": "integer",
      "title": "Org Id"
    },
    "sku": {
      "type": "string",
      "title": "Sku"
    },
    "capabilities": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Capabilities"
    },
    "day": {
      "type": "string",
      "title": "Day"
    },
    "requests_today": {
      "type": "integer",
      "title": "Requests Today"
    },
    "daily_limit": {
      "type": "integer",
      "title": "Daily Limit"
    },
    "routes_today": {
      "additionalProperties": {
        "type": "integer"
      },
      "type": "object",
      "title": "Routes Today"
    }
  },
  "type": "object",
  "required": [
    "org_id",
    "sku",
    "capabilities",
    "day",
    "requests_today",
    "daily_limit",
    "routes_today"
  ]
}
                  
ValidationError
                    {
  "title": "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"
  ]
}
                  
WebhookCreate
                    {
  "title": "WebhookCreate",
  "properties": {
    "url": {
      "type": "string",
      "maxLength": 2083,
      "minLength": 1,
      "format": "uri",
      "title": "Url"
    },
    "events": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Events"
    },
    "secret": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Secret"
    }
  },
  "type": "object",
  "required": [
    "url",
    "events"
  ]
}
                  
WebhookResponse
                    {
  "title": "WebhookResponse",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "url": {
      "type": "string",
      "title": "Url"
    },
    "events": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Events"
    },
    "active": {
      "type": "boolean",
      "title": "Active"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    }
  },
  "type": "object",
  "required": [
    "id",
    "url",
    "events",
    "active",
    "created_at",
    "updated_at"
  ]
}
                  
Authentication

Only the Customer API requires auth.

Header (recommended)
Authorization: Bearer <YOUR_API_KEY>
Alternative header
X-API-Key: <YOUR_API_KEY>
Keep API keys out of client-side code unless you are okay with end-users having that access. For public websites, proxy requests through your server.
Public Preview API (no auth)
A small, cacheable payload designed for website embeds and demos (not a full dashboard).
Endpoint
GET /api/v1/public/live-preview
Rate limit: 30 requests/min per IP. Uses ETag and cache headers to encourage reuse.
Shape (high level)
{
  "kind": "live_signal_preview_v1",
  "generated_at": "2025-01-01T00:00:00+00:00",
  "window": { "since": "...", "hours": 72, "points": 96 },
  "markets": [
    {
      "market_id": "...",
      "question": "...",
      "category": "...",
      "status": "ok | cold_start | no_data",
      "asof": { "compression_z": 0.4, "surprise_risk": 0.12, "surprise_confidence": 0.8 },
      "series": { "compression": [{ "ts": "...", "compression_z": 0.1 }], "surprise": [{ "ts": "...", "surprise_risk": 0.2, "surprise_confidence": 0.7 }] }
    }
  ]
}
Browser example (fetch + render)
const API_BASE = "https://YOUR_PUBLIC_API";

const resp = await fetch(`${API_BASE}/api/v1/public/live-preview`);
if (!resp.ok) throw new Error(await resp.text());
const data = await resp.json();

// Example: build a simple list of titles + latest values
const rows = (data.markets || []).map((m) => ({
  id: m.market_id,
  question: m.question,
  compressionZ: m.asof?.compression_z,
  surpriseRisk: m.asof?.surprise_risk,
}));

console.log(rows);
Note: query params are intentionally ignored by this endpoint to keep it cacheable and prevent “free dashboard” usage.
Billing API (checkout + API key provisioning)

Used by the website’s subscription flow. These endpoints live on the Public API service.

Create checkout session
POST /api/v1/billing/create-checkout-session
{
  "email": "you@company.com"
}
Returns {"url":"https://checkout.stripe.com/..."} for the browser to redirect to.
Provision API key (shown once)
POST /api/v1/billing/provision-api-key
{
  "session_id": "cs_test_..."
}
Returns status="ok" with api_key, or status="already_provisioned".
Stripe webhooks are handled at POST /api/v1/billing/stripe/webhook (server-to-server).
Customer API (subscriber)

Curated, API-key-authenticated risk analytics. The customer service exposes only /api/v1/risk/*, /api/v1/enterprise/*, /api/v1/webhooks, and /api/v1/billing/* — not internal GVF, mutation, or dashboard routes.

Auth
Authorization: Bearer <YOUR_API_KEY>
X-API-Key: <YOUR_API_KEY>
Rate limits (by SKU)
starter: 1,000/day · 72h lookback
pro: 25,000/day · 168h · CSV + webhooks
desk: 100,000/day · 336h
enterprise_data: 250,000/day · unlimited · enterprise feeds
Missing capabilities → HTTP 402. Over limit → HTTP 429 with Retry-After.
Risk reads
GET /api/v1/risk/hedge_opportunities
GET /api/v1/risk/stress_index
GET /api/v1/risk/signal_clusters
GET /api/v1/risk/status
Enterprise feeds
GET /api/v1/enterprise/hedge_ledger
GET /api/v1/enterprise/status
POST /api/v1/enterprise/exports
Webhooks (Pro+)
GET /api/v1/webhooks
POST /api/v1/webhooks
DELETE /api/v1/webhooks/{id}
Writes require webhook_admin role on the API key.
Account
GET /api/v1/billing/usage
POST /api/v1/billing/rotate-key
POST /api/v1/billing/portal
Using the data on your website
Common pattern: overlay
Join the signal series to your existing market cards/charts: show the latest asof values and a small sparkline from series.
Common pattern: alerts
Poll at 30–60s, only when the tab is visible. Trigger UI highlights when values cross your thresholds.
For interactive docs, each service also exposes FastAPI’s OpenAPI UI at /docs and a spec at /openapi.json.