Concepts
Authentication & API keys
How to authenticate Wayline API requests with live and test keys, where to send the key, and how key environments, scopes and expiry work.
Updated Dec 1, 2026 View Markdown
Every request to the Wayline API is authenticated with an API key that belongs to your organization.
Sending the key
Send the key as a Bearer token (preferred):
curl "https://api.wayline.cloud/v1/distance?origin=37.788,-122.4075&destination=37.8044,-122.2712" \
-H "Authorization: Bearer $WAYLINE_API_KEY"Also accepted, in this order of preference:
| Method | Example | When to use |
|---|---|---|
Authorization: Bearer <key> | Authorization: Bearer wl_live_… | Always, if you can. |
X-API-Key header | X-API-Key: wl_live_… | Clients that reserve Authorization. |
key query parameter | ?key=wl_live_… | Only for the Google-compatible endpoint, for drop-in compatibility. Query strings can end up in logs; prefer headers. |
Live and test keys
Test keys (wl_test_…) | Live keys (wl_live_…) | |
|---|---|---|
| Billing | Never billed | Billed per unit after free units |
| Limits | Daily cap and low rate limit | Your plan's rate limit |
| Use for | Development, CI, demos | Production |
Both key types return real results from the same routing engine.
| Limit (default plan) | Value |
|---|---|
| Requests per second | 50 |
| Burst | 100 |
| Max matrix elements per request | 2,500 |
| Max batch points per request | 500 |
| Max route waypoints | 25 |
| Test key daily cap | 1,000 requests |
| Test key rate | 2 requests/second |
Key lifecycle
- Shown once. We store only an HMAC-SHA256 hash of each key. If you lose a key, create a new one.
- Restrictions. Limit a key to allowed origins (browser use), IP ranges (server use) and endpoint scopes.
- Expiry. Keys can have an optional expiry date; expired keys return
KEY_EXPIRED. - Revocation. Revoked keys stop working within seconds.
Rotating a key
- Create a new key with the same restrictions.
- Deploy it to your secrets store.
- Watch the old key's usage drop to zero in the dashboard.
- Revoke the old key.
Related: Key security · Errors