---
title: "Fit and persist a portfolio model version at a past-only 07:00 origin"
method: POST
path: "/api/forecast-sandbox/consumption/portfolio/train"
tags: ["Forecast Sandbox"]
---

# Fit and persist a portfolio model version at a past-only 07:00 origin

`POST /api/forecast-sandbox/consumption/portfolio/train`

## Request

- Base URL: `https://api.cernion.de`
- URL: `https://api.cernion.de/api/forecast-sandbox/consumption/portfolio/train`
- Auth: none declared

Live training/history/model access requires a credential bound to the tenant; a tenant header alone is insufficient. Shared-baseline contributors remain internal; only tenant-owned meter predictions are returned.

## Query parameters

- `token` string

## Request body

- object
  - `series_ids` string[], required
  - `forecast_for` string, date, required
  - `portfolio_method` object
    - `latest_measurement_lag` 2 | 3
    - `feature_profile` 'legacy_v1' | 'e2_v1'
    - `selection_objective` 'rmse' | 'mae'
    - `candidate_set` 'existing' | 'hgb' | 'extended' | 'regime'
    - `training_mode` 'rolling' | 'frozen'
  - `strategy` 'portfolio' | 'shared_baseline': One series defaults to shared_baseline; multiple series default to portfolio. Use shared_baseline for initial common corpus training and ongoing contributions. Do not combine with portfolio_method.
  - `token` string: Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.

## Response `200`

Result, immutable version, or durable result manifest

- object

## Other responses

- `202`: Forecast job accepted. Poll statusUrl/progressUrl; fetch resultUrl once completed. CPU work runs in a separate worker.
- `400`: Invalid input, unknown tenant-owned artifact, or incompatible resume
- `401`: Credential with a bound tenant is required for live model operations

---

[API](https://skmtc.dev/cernion/apis/cernion-energy-tools-api.md) · [All operations](https://skmtc.dev/cernion/apis/cernion-energy-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cernion/apis/cernion-energy-tools-api/revisions/cdb94473b538?raw)
