Authentication
Manage API keys, scopes, and security best practices.
API keys
All requests to the CHRT API require a valid API key. Keys are scoped to your team and can be created, rotated, or revoked from the dashboard. For a step-by-step creation walkthrough, see Getting Started § Creating an API Key.
Key format
CHRT API keys follow a structured format for easy identification:
chrt_{type}_{environment}_{team}_{random}
type: pk (public / client-side) or sk (secret / server-side)
environment: live (production) or test (sandbox)
team: short team identifier
random: unique random suffix
Examples:
chrt_pk_live_acme_x7k9m2p3q8... — public key, production
chrt_sk_test_acme_n1r4t6w2y5... — secret key, sandboxUsing your key
Pass your key via the x-api-key header (recommended) or as a query parameter:
curl -H "x-api-key: chrt_pk_live_acme_x7k9m2..." \
https://api.chrt.co/v1/features?bbox=-71,42,-70,43curl "https://api.chrt.co/v1/features?bbox=-71,42,-70,43&key=chrt_pk_live_acme_x7k9m2..."Scopes
API keys can be restricted to specific scopes to follow the principle of least privilege. Pick a key's scopes when you create it, and change them at any time from the key's details:
| Scope | Access |
|---|---|
tiles:read | Mint tile tokens and fetch vector tiles |
features:read | Query features and spatial data |
cells:read | Access cell metadata and coverage |
search:read | Search places, waters and aids to navigation by name |
poi:read | Charted marine facilities (marinas today) |
weather:read | Marine forecasts, alerts and current conditions |
usage:read | View usage statistics |
offline:download | Download MBTiles bundles for offline use (Pro plan and above) |
Keys made before search:read and poi:read existed keep working: features:read also opens search and points of interest. Weather is never implied by another scope; a key needs weather:read itself.
A key with tiles:read only cannot access the Feature API, and vice versa.
Note / Description field
Each API key supports an optional Note (description) field for internal documentation. Use it to record what the key is used for, which application or environment it belongs to, or any other context your team needs. This field can be edited after key creation.
Security restrictions
Domain allowlist
Restrict a key to origins you control. Set Allowed domains to one or more hostnames and a browser request from any other origin is refused with 403 Domain not allowed. This is what stops a publishable key lifted from your bundle from working on someone else's site.
example.com # also covers app.example.com, www.example.com, …
app.example.com # just this host and its subdomains
localhost # any port — handy in development
# All of these are accepted and stored as the bare hostname:
# https://app.example.com -> app.example.com
# *.example.com -> example.com
# example.com:8443 -> example.comIt is a deterrent, not a security boundary. Only browsers are unable to forge an Origin header, so the allowlist reliably stops browser-based reuse of your key — but any non-browser client can send whatever origin it likes. Requests that carry no origin at all — server-side code, curl, and native mobile apps, which never send one — are not restricted by it. Setting an allowlist therefore makes a key browser-restricted, not browser-only.
If you need a hard boundary, use a secret (sk) key from your own backend and never ship it to a client.
IP allowlist
Restrict a key to the addresses your servers call from. Set IP allowlist to one or more IPv4 or IPv6 addresses or CIDR ranges, up to 50 entries. A request from any other address is refused with 403 ip_not_allowed.
203.0.113.7 # one address
198.51.100.0/24 # a range
2001:db8::/48 # IPv6 works the same wayA key with an IP allowlist works only through https://api.chrt.co. CHRT's edge is the one place that sees the address your request really came from, and it passes that address on signed, so it can't be forged. A request that reaches CHRT any other way, including straight to our backend functions URL, can't prove its address and is refused with 403 ip_allowlist_requires_gateway. Keys without an allowlist are unaffected.
The allowlist is checked whenever the key is used: every API call and every token mint. What a key mints from an allowed address is a short-lived bearer credential that works from anywhere until it expires: a tile token lasts 5 minutes by default (15 at most), and so does an offline token. An offline pack already downloaded to a device keeps rendering until its offline expiry, which is 60 days after its last successful refresh. An IP allowlist does not bound a pack once downloaded.
Behind a NAT, a proxy or a cloud egress gateway, list the address your traffic leaves from, not the machine's own. Entries are stored in a normal form (a range keeps only its network part), and an entry that isn't an address, a range of /0, or an address with leading zeros is refused when you save it.
Creating a key
Keys are created via the dashboard at /app/keys. A secret (sk) key is shown exactly once — copy and store it securely, because it cannot be recovered afterwards. A publishable (pk) key can be revealed again at any time from the keys list, since it is designed to ship in client-side bundles and is not a secret. See the Getting Started guide for a detailed walkthrough.
Editing a key
After creation, you can edit a key's name, note, scopes, and IP allowlist from the API Keys dashboard. An sk value cannot be viewed again — only regenerated. A pk value can be revealed again at any time.
Key rotation
To rotate a key, use the Regenerate action in the dashboard. This creates a new secret while keeping the same key configuration (scopes, domains, limits). The old key is invalidated immediately. You'll need to confirm regeneration by typing the key name.
Best practice: For zero-downtime rotation, create a second key before revoking the old one. Update your application to use the new key, verify it works, then disable the old key.
Rate limits
Rate limits are enforced per key. See the Rate Limits page for sliding window details, headers, and monthly caps.
Coverage gating
API keys inherit coverage access from your team's purchased coverage regions. A key on a US-only plan will receive data for NOAA charts but get empty or 403 responses for other chart sources. See Coverage Regions for details on available regions and purchasing.
curl -I "https://api.chrt.co/v1/features?bbox=-71,42,-70,43&limit=1" \
-H "x-api-key: YOUR_API_KEY"HTTP/2 200
Content-Type: application/json
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 299
X-RateLimit-Reset: 1710000060For situational awareness only — not for primary navigation. CHRT is not an ECDIS and is not SOLAS-compliant.