Documentation menu

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):

bash
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:

MethodExampleWhen to use
Authorization: Bearer <key>Authorization: Bearer wl_live_…Always, if you can.
X-API-Key headerX-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_…)
BillingNever billedBilled per unit after free units
LimitsDaily cap and low rate limitYour plan's rate limit
Use forDevelopment, CI, demosProduction

Both key types return real results from the same routing engine.

Limit (default plan)Value
Requests per second50
Burst100
Max matrix elements per request2,500
Max batch points per request500
Max route waypoints25
Test key daily cap1,000 requests
Test key rate2 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

  1. Create a new key with the same restrictions.
  2. Deploy it to your secrets store.
  3. Watch the old key's usage drop to zero in the dashboard.
  4. Revoke the old key.

Related: Key security · Errors