Price Models
Extract a contract price clause into a stored model, read and edit it, confirm or exclude it, set its contract key, link amendments, and list every version.
A price model is a contract's price clause as one standard, evaluable structure. components are the prices, each with a formula over variable names, a unit such as ct/kWh or EUR/kW/a, a basis (energy, capacity or fixed) and an adjustment cycle (monthly, quarterly, semiannual, annual or fixed). variables are the numbers the formulas read: stated values with their evidence, and index variables bound to a series. A model also carries the printed contract number, customer, customer number and site, each with the passage that prints it.
Evidence is the backbone. Each stated value carries an evidence object with the quote, the document_id it was read from, and verified, which is true only when the quote occurs in the document text and prints the value. A paraphrased quote is replaced by the document line that prints the value (anchored: true), so the stored quote is always verbatim. A value that is not verified is treated as missing when prices are computed.
One model exists per contract document, and models that share a contract_key are versions of one contract. GET /v1/price-baseline/models/{id}/versions returns the whole chain, oldest first. The versions of a contract are the documents the Contracts app files under it, else the models sharing the contract key, else the chain linked by superseded_by. Later versions inherit what they do not redefine, so an amendment that changes one price needs only that price.
/v1/price-baseline/modelsResponse fields
/v1/price-baseline/modelsBody fields
cURL: Extract a price model
curl -X POST "https://api.talonic.com/v1/price-baseline/models" \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"document_id": "3f6c1d2e-8a41-4c57-9b0e-2d7a5c1e9f10", "use_opus": false}'Response: 201 Draft model (excerpt)
{
"id": "7b1f0a52-3c9d-4e08-a6d4-51c2e8f7b3a9",
"document_id": "3f6c1d2e-8a41-4c57-9b0e-2d7a5c1e9f10",
"contract_label": "Waermeliefervertrag Nr. 4711",
"status": "draft",
"contract_key": "4711",
"valid_from": "2024-01-01",
"superseded_by": null,
"model": {
"contract_label": "Waermeliefervertrag Nr. 4711",
"currency": "EUR",
"valid_from": "2024-01-01",
"components": [
{
"key": "AP",
"label": "Arbeitspreis",
"unit": "ct/kWh",
"basis": "energy",
"formula": "AP0 * (0.4 + 0.6 * G / G0)",
"adjustment": "quarterly"
}
],
"variables": [
{
"name": "AP0",
"symbol": "AP0",
"label": "Basis-Arbeitspreis",
"kind": "base",
"value": 6.42,
"unit": "ct/kWh",
"evidence": { "document_id": "3f6c1d2e-8a41-4c57-9b0e-2d7a5c1e9f10", "quote": "AP0 = 6,42 ct/kWh", "verified": true }
}
],
"referenced_documents": [],
"notes": []
},
"created_at": "2025-03-12T10:02:41.000Z",
"updated_at": "2025-03-12T10:02:41.000Z"
}Extraction is conservative in three ways. A hand-set contract key survives re-extraction. An answer without price components never replaces a model that has them: the call answers 502 and the stored model stays. And every stated value is kept only when its quote occurs in the document and prints the value. A 502 means the extraction model is unavailable or returned no price components for a document that already has a model; the error is retryable.
/v1/price-baseline/models/{id}Path parameters
Key response fields
/v1/price-baseline/models/{id}Body fields (all optional)
cURL: Confirm a model and set its contract key
curl -X PUT "https://api.talonic.com/v1/price-baseline/models/7b1f0a52-3c9d-4e08-a6d4-51c2e8f7b3a9" \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "confirmed", "contract_key": "4711"}'/v1/price-baseline/models/{id}/versionsPath parameters
cURL: Read the version chain
curl "https://api.talonic.com/v1/price-baseline/models/7b1f0a52-3c9d-4e08-a6d4-51c2e8f7b3a9/versions" \
-H "Authorization: Bearer $TALONIC_API_KEY"missing_value until a verifying quote exists. To set a contract value together with its quote in one step, use POST /v1/price-baseline/models/{id}/values.