Overview
Authentication
Every /v1 request is authenticated with an API key sent as a bearer token.
API keys
Keys are created in the dashboard. Each key belongs to your account, has its own name, rate limit and usage history, and looks like this:
geo_4f9KcX2mQ7rT1vZ8bN3pL6wY0sH5dJ2ageo_followed by 32 random letters and digits. There is one kind of key; keys created earlier with ageo_live_orgeo_test_prefix keep working.- When you create a key you choose which endpoints it can call (geocoding, reverse geocoding, routing) and when it expires: after 30, 60 or 90 days, after a year, on a date you pick, or never.
- The full key is shown once, when you create or regenerate it. The platform stores only a keyed hash, so nobody (including us) can show it to you again.
- In the dashboard a key appears masked, for example
geo_4f9K••••••••••••.
Sending your key
Send the key in the Authorization header using the Bearer scheme:
curl "https://developers.ubhub.mn/v1/geocode?q=Ulaanbaatar" \
-H "Authorization: Bearer YOUR_API_KEY"The header is the only accepted place. Keys in query strings are not supported, because URLs end up in logs, browser history and proxies.
Keeping keys safe
- Treat keys like passwords. Store them in environment variables or a secret manager, never in source control.
- Keep privileged keys on your server. Code in a browser or mobile app can be inspected, so an embedded key is not a secret. On the web, the React & Next.js SDK keeps the key on your server behind a route in your app. For direct access with the Flutter SDK, use a separate restricted key, endpoint restrictions, quotas, and rate limits. Apply application restrictions where supported by the backend.
- Use one key per application or environment, so you can revoke one without affecting the others.
- If a key may have leaked, regenerate or revoke it immediately.
How this website does it
/v1. The key never reaches the browser.Managing keys
Key actions
Playground tokens
The playground in the Geocoding and Routing guides lets you send real requests from the browser with one of your keys. Because secrets are never stored, the site cannot use the key itself. Instead it asks for a short-lived token (geo_pt_…, valid 15 minutes) bound to the key you selected. Requests made with it count against that key's rate limit and appear in its usage. Playground tokens stop working as soon as the key is revoked.
Authentication errors
Authentication errors
INVALID_API_KEYINVALID_API_KEYdetails.reason is "expired").API_KEY_REVOKEDENDPOINT_NOT_ALLOWEDdetails.allowed_endpoints lists the ones it can call).{
"error": {
"code": "INVALID_API_KEY",
"message": "Missing API key. Send it in the Authorization header: 'Authorization: Bearer YOUR_API_KEY'."
}
}