Skip to main content

Data models

The SDK relies on Pydantic models to validate payloads. Import them from simulacrum.models when you need structured access.

ForecastRequest

from simulacrum.models import ForecastRequest

ForecastRequest(
    series: list[float],
    horizon: int,
    model: str | None = "default"
)
FieldTypeNotes
serieslist[float]Automatically normalised from numpy arrays or sequences.
horizonintMust be positive.
modelstr | NoneOptional identifier sent to the API.
Serialise with model_dump() before sending requests manually.

ForecastResponse

from simulacrum.models import ForecastResponse

ForecastResponse(forecast: list[float], model_used: str)
FieldTypeNotes
forecastlist[float]Horizon-length values returned by the API.
model_usedstrBackend model chosen by the service.
Call get_forecast() to convert the list into a numpy array for downstream analysis.

ValidateAPIKeyResponse

from simulacrum.models import ValidateAPIKeyResponse

ValidateAPIKeyResponse(valid: bool, client: str, expires_at: datetime | None)
Use this model to inspect key metadata. expires_at is optional and absent when the platform does not expose expiry information.