Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.smlcrm.com/llms.txt

Use this file to discover all available pages before exploring further.

Quickstart

This quickstart walks you through installing the SDK, configuring credentials, and issuing your first request against the Simulacrum forecasting API.

Prerequisites

  • Python 3.11.13 or newer.
  • A Simulacrum account at app.smlcrm.com with an API key that has forecasting permissions.
  • Network access to https://api.smlcrm.com/.
1

Create an API key

2

Install the SDK

3

Instantiate the client

4

Generate a forecast

1. Create your Simulacrum account

  1. Visit app.smlcrm.com and create or join your workspace.
  2. Select API Keys on the left navigation bar and generate a key with forecasting access.
  3. Store the key securely (for example in a secrets manager) and copy it for the next steps.

2. Install

pip install simulacrum-sdk
To pin to a specific version:
pip install "simulacrum-sdk==0.2.0"

3. Configure credentials

from simulacrum import Simulacrum

client = Simulacrum(api_key="sim-key_id-secret")
Replace "sim-key_id-secret" with the key you generated in step 1. For local development you can export it as an environment variable:
export SIMULACRUM_API_KEY="sim-key_id-secret"
Then load it safely in code:
import os
from simulacrum import Simulacrum

client = Simulacrum(api_key=os.environ["SIMULACRUM_API_KEY"])

4. Send your first forecast

from simulacrum import Simulacrum
import numpy as np

client = Simulacrum(api_key="sim-key_id-secret")
series = np.array([101.2, 103.6, 106.5, 109.3])
forecast = client.forecast(series=series, horizon=3, model="tempo")
print("Forecast:", forecast.tolist())
You will receive a numpy array containing one value per horizon step. The SDK validates your inputs before the request is issued, so dimension mismatches throw early exceptions.

5. Validate the API key

validation = client.validate()
if not validation.valid:
    raise RuntimeError("API key is not active")

print("Client ID:", validation.client)
print("Expires at:", validation.expires_at)
Use validation in CI to ensure service accounts stay active. The response includes expiration metadata when it is exposed by the platform.

Next steps