Skip to content

MODEL API

Models

Calculations based on the model’s declared sources and any caller-supplied inputs, for an address or a point. Every answer names the release that produced it, its method tier and its warnings; a screening calculation is not a measurement, a legal zone or an insurance price. One lookup per model and address per day, and an abstention is not counted.
API version
1.2.0
Endpoints
4
Models
0
Contents

Endpoints

https://api.approach.no/api/v1/predictions · OpenAPI contract

GET

/catalog

no key required

Models with an active Datakilde release: card, method, tier, sources, limitations, public descriptors, input and output schema.

Parameters

NameTypeBounds and defaultDescription
Datakilde-Version
header
stringdatePin a calendar date (YYYY-MM-DD), independently of the release channel. Absent means latest. A date between releases resolves to the newest contract on or before it; a date before the first resolves to the first, and a date after the latest resolves to the latest. Read Datakilde-Version on the response for the actual resolution. This does not select a historical source snapshot; only documented compatibility shims preserve older response behavior.
Datakilde-Channel
header
stringstable | preview
default stable
Independent of Datakilde-Version. Omit for stable. Preview on customer data requires an explicit preview subscription grant; packages, test keys and date pins do not grant it. Ungranted preview is refused with preview_channel_not_granted (403), never silently downgraded. Public metadata remains stable.

Responses and error codes

HTTPMeaningCodes in the body
200Model catalogue—
503prediction_service_unavailable
POST

/demo

no key required

Bounded anonymous demo for an explicitly public-reviewed currently served release.

Parameters

NameTypeBounds and defaultDescription
Datakilde-Version
header
stringdatePin a calendar date (YYYY-MM-DD), independently of the release channel. Absent means latest. A date between releases resolves to the newest contract on or before it; a date before the first resolves to the first, and a date after the latest resolves to the latest. Read Datakilde-Version on the response for the actual resolution. This does not select a historical source snapshot; only documented compatibility shims preserve older response behavior.
Datakilde-Channel
header
stringstable | preview
default stable
Independent of Datakilde-Version. Omit for stable. Preview on customer data requires an explicit preview subscription grant; packages, test keys and date pins do not grant it. Ungranted preview is refused with preview_channel_not_granted (403), never silently downgraded. Public metadata remains stable.
model
body · required
string——
subject
body · required
object——

Responses and error codes

HTTPMeaningCodes in the body
200Public projection, not billed—
400invalid_model_demo_request
403model_demo_not_available
404prediction_subject_not_found
413prediction_request_too_large
429model_demo_rate_limited
503prediction_service_unavailable or prediction_capacity_exhausted
504—
GET

/models/{model}

no key required

One model's release card and schemas.

Parameters

NameTypeBounds and defaultDescription
model
path · required
string——
Datakilde-Version
header
stringdatePin a calendar date (YYYY-MM-DD), independently of the release channel. Absent means latest. A date between releases resolves to the newest contract on or before it; a date before the first resolves to the first, and a date after the latest resolves to the latest. Read Datakilde-Version on the response for the actual resolution. This does not select a historical source snapshot; only documented compatibility shims preserve older response behavior.
Datakilde-Channel
header
stringstable | preview
default stable
Independent of Datakilde-Version. Omit for stable. Preview on customer data requires an explicit preview subscription grant; packages, test keys and date pins do not grant it. Ungranted preview is refused with preview_channel_not_granted (403), never silently downgraded. Public metadata remains stable.

Responses and error codes

HTTPMeaningCodes in the body
200Model—
404model_not_found
503prediction_service_unavailable
POST

/run

Run a served model for one subject. One oppslag per model and subject per day on the lookup allowance; repeats the same day are free, and an abstention or a failure is never counted. The grant must name the model (models capability). The answer names the release that produced it.

Parameters

NameTypeBounds and defaultDescription
Idempotency-Key
header
string≤ 255 charactersOptional. A retry with the same key and body within 24 hours replays the durable answer (Idempotent-Replayed: true) only while that exact model release is still actively served and the key still has model access. A different body is refused with idempotency_key_reused. Uncertain upstream outcomes are not re-executed automatically.
Datakilde-Version
header
stringdatePin a calendar date (YYYY-MM-DD), independently of the release channel. Absent means latest. A date between releases resolves to the newest contract on or before it; a date before the first resolves to the first, and a date after the latest resolves to the latest. Read Datakilde-Version on the response for the actual resolution. This does not select a historical source snapshot; only documented compatibility shims preserve older response behavior.
Datakilde-Channel
header
stringstable | preview
default stable
Independent of Datakilde-Version. Omit for stable. Preview on customer data requires an explicit preview subscription grant; packages, test keys and date pins do not grant it. Ungranted preview is refused with preview_channel_not_granted (403), never silently downgraded. Public metadata remains stable.
model
body · required
string^[a-z][a-z0-9_]{2,62}$A model id from /catalog
options
body
object—Model-specific; see the model's input_schema
subject
body · required
object—An address id, or a point in EPSG:25833 inside Norway.
version
body
string—Optional: the release version you expect. Refused if it is not the active one, so a pinned client notices a new release.

Responses and error codes

HTTPMeaningCodes in the body
200Prediction—
400invalid_prediction_request, invalid_idempotency_key, or request_body_unreadable
401Authentication required
402Allowance exhausted
403address_endpoint_not_allowed (no models capability) or model_not_granted
404model_not_found or prediction_subject_not_found
409idempotency_request_in_progress, idempotency_replay_unavailable, or prediction_result_release_inactive
413prediction_request_too_large
422idempotency_key_reused
429Rate limit exceeded
500—
503prediction_capacity_exhausted or prediction_service_unavailable; nothing counted. Retry with backoff after Retry-After seconds.
504prediction_timeout

Models

Which models are available depends on which releases are active; /catalog lists them with method, sources, limitations and schemas.

IdTitle and sourceDetails