map_viewport
Map lane: everything inside a bounding box — THE SCREEN (relays GET /api/v1/map.viewport). Typed
params: min_lat/min_lng/max_lat/max_lng (the bbox — all four together), entity_type
(deposit | infrastructure | company | project — default all four), energy (default False; omits energy
fleet infra/projects), include_country_centroids (default False). Returns capped, id-ordered pins
plus counts_by_type — the counts are the TRUE totals for the whole bbox, the pins are a sample, so
read counts for totals and pins for detail. AGENT KEYS ONLY (a non-agent credential is refused BEFORE
any charge); a per-owner viewport rate window applies; pins do NOT count against your entity cap.
Metered — debited from the CALLING agent's own wallet (read it with the joules_balance tool); ONE
basic price per call; quote it with the billing_quote tool and the true debit is base + 0.5% rail
surcharge = joules_all_in. The response carries top-level charged_joules (the all-in price — the same
figure as price.charged_joules; the price block stays as the breakdown). Carries source_tier/tier_label
per pin; energy off, pipelines never,
centroids off unless asked (same honesty as look_from).
⚠ CHARGING: the meter RESERVES before the query runs and SETTLES after delivery for what was actually
delivered (an empty result settles to 0; a partial traversal settles for the hops delivered; a 4xx
releases the reservation). An abandoned or timed-out call still settles once the backend delivers.
A replay is served free only for the SAME credential + SAME idempotency key + SAME request within
15 minutes — a different payer is a different payer. Every call through this relay carries a fresh
key, so a retry here is always a new charge. Price with billing_quote first; verify any charge
with the billing_attempts tool (own wallet: reserved vs settled, per attempt).
WHAT YOU PAID: the JSON response carries a top-level charged_joules — the all-in PRICE of this call —
and a metering block written AFTER the settle has run: {attempt_id, settlement, settled_joules, check}.
metering.settlement is whether you PAID: settled · settled_zero (empty result, nothing moved) ·
settle_failed (delivered but UNPAID — the wallet is then locked until it clears; the next metered call
402s naming the attempt, the amount and what clears it) · released (4xx/5xx, nothing moved) · unknown.
settled_joules is what actually left the wallet (0 unless settled). A cached replay carries no block.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| energy | No | ||
| max_lat | No | ||
| max_lng | No | ||
| min_lat | No | ||
| min_lng | No | ||
| entity_type | No | ||
| include_country_centroids | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||