Authentication
Every call needs an API key. You create keys in the app, under API keys, and one key works for every API on Fare.
Send your key
Put the key in the X-API-Key header, or send it as Authorization: Bearer followed by the key. Keys start with fare_live_ followed by 32 letters and digits.
curl https://api.fare.dev/v1/account \
-H "X-API-Key: $FARE_KEY"
# or
curl https://api.fare.dev/v1/account \
-H "Authorization: Bearer $FARE_KEY"
{"key_id": "key_1a2b3c4d5e6f7a8b", "access": "active", "monthly_cap": 1000000,
"per_second": 10, "used_this_month": 42}
GET /v1/account tells you whether the key can make calls, its limits and its calls this month. It's never billed.
Keys and billing
A key makes calls once its org has a card on file. Without one, calls return 402 payment_required. A call that fails is never billed.
When the key is wrong
| Status | Code | Message |
|---|---|---|
| 401 | missing_key | Send your API key in the X-API-Key header. |
| 401 | invalid_key | That API key is not valid. |
| 402 | payment_required | Add a card at https://fare.dev/app/billing to use this key. |
A revoked key also returns invalid_key. None of these calls are billed.
NextErrors