Deploy the Forecasting API locally and make your first forecast request using the Python client.
Get started with Synthefy’s Forecasting API in minutes. This guide will walk you through deploying the API locally and making your first forecast request using our Python client.
If you’d like to try our forecasting API, please do the following:
Copy
Ask AI
# Pull the image using a role with permissions to our repository.docker pull 637245294713.dkr.ecr.us-east-2.amazonaws.com/on-premises-forecasting-api:latest# Run the containerdocker run -p 8014:8000 --gpus all -e USE_CELERY="false" -e SYNTHEFY_ROUTER="foundation_models" 637245294713.dkr.ecr.us-east-2.amazonaws.com/on-premises-forecasting-api:latest
The Synthefy client handles authentication differently depending on the target domain:
Synthefy Cloud (synthefy.com): Requires a valid API key for authentication
On-Premise/Local Deployments: No API key required - set api_key=None or omit the parameter entirely
Domain-Based Authentication: The client automatically detects the target domain and adjusts authentication accordingly. For non-Synthefy domains (localhost, on-premise deployments, etc.), authentication is handled automatically without requiring an API key.
with SynthefyAPIClient(api_key=api_key, base_url="http://localhost:8014") as client: response = client.forecast(request)
The client handles connection management and provides a clean interface for making requests.
API Key for Non-Synthefy Domains: When connecting to domains other than synthefy.com (like localhost or on-premise deployments), the api_key should be omitted or explicitly set to None. The client automatically handles authentication for non-Synthefy domains without requiring an API key.
When you run this example, you should see output similar to:
Copy
Ask AI
Making forecast request to localhost:8014...Model: Migas-1.0Number of samples: 1Sample details: 1 time series in first scenarioSending request...✅ Forecast successful!Number of forecast scenarios: 1Scenario 1: Sample ID: sales Model: Migas-1.0 Timestamps: ['2023-01-06', '2023-01-07', '2023-01-08'] Values: [150.2, 160.1, 170.3]