Skip to main content

Endpoints

All under https://api.kaleidr.com/inference-api/b2b/v1/. Authenticate with the platform key (auth & scopes). Streaming endpoints return text/event-stream (wire contract).

SDK session exchange

The one endpoint that accepts a publishable key directly. The SDK calls it for you on mount; you only call it yourself with custom auth plumbing.

MethodPathBodyReturns
POST/sdk/sessions{ product: "chat" | "editor" | "viewer" | "tile", map_id? }{ session_token, expires_in, product, basemap_style_id? }

Gates in order: key must be publishable (publishable_key_required), browser Origin present and allowlisted (origin_required / origin_not_allowed), product allowed for the key (product_not_allowed), required scope present (insufficient_scope), and — for tile — the org's monthly map-loads allowance (map_load_quota_exceeded, 429). All runtime calls below use the returned session token, not the key.

basemap_style_id is present only when the organization has stored a default basemap canvas. The SDK applies it when the embed does not name a style of its own; the precedence is styleUrl > styleId > this > kaleidr-morning. Absent means "the embed decides", which is also what an older API returns.

Chat (ai scope)

MethodPathBodyReturns
POST/chat/control/stream{ messages[], location?, map_zoom?, lang?, session_id? }SSE
POST/chat/summary/stream{ type: "poi" | "building", … }SSE
POST/chat/button/streampopup-chat bodySSE
POST/chat/control/route{ places[], profile, raw_query }JSON route
GET/retrieval/poi/enrich?lat&lon&name&category&…JSON

Design (design scope)

MethodPathBodyReturns
POST/design/analyzedataset sampleJSON recommendation (metered)
POST/design/apply-directparsed dataset + rolesJSON partial MapSpec
GET/design/stylesstyle catalog
GET/design/samplesworked-sample catalog
GET/design/themestheme-pack catalog

Example

curl -N https://api.kaleidr.com/inference-api/b2b/v1/chat/control/stream \
-H "X-Api-Key: kld_sk_live_…" \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{"messages":[{"role":"user","content":"cafes near the Louvre"}]}'

No / bad key → 401. Valid key without the route's scope → 403 (insufficient_scope). Over quota → 429. See Errors.