Authentication
How the API checks your key and your IP address.
Every request to /v1/... is checked twice:
- API key: the request must carry a valid, active API key.
- IP address: the request must come from an IP address approved for your account.
Both checks must pass. A leaked key alone cannot be used from another network.
Sending your API key
Send the key in the Authorization header with the Bearer scheme:
Authorization: Bearer fk_live_your_key_hereKeys sent in the URL (for example ?token=...) are not accepted. URLs are often written
to logs, which would expose your key.
Approved IP addresses
Finkhoz approves the public IP addresses of the servers that call the API. To add or change an IP address, contact Finkhoz.
Not sure which IP your server uses? Call /v1/whoami. If the IP is not approved yet, the
error message shows the exact address the API saw:
{ "status": "Forbidden", "errors": ["IP address not allowed: 203.0.113.25"] }About "Try it" in these docs
The Try in Playground button lets you test any endpoint with your own API key, from any network. You do not need to approve your current IP address for it.
- Requests go through the documentation site, which passes them on to the API. The docs site does not store your key. Your browser keeps it only until you close the tab.
- The playground has its own, much lower rate limit, separate from your account's limit. If you hit it, wait a minute.
- It is for testing only. Your application must call the API from your server, from an approved IP address.
/v1/whoamiin the playground shows the docs site's address, not yours.
Keeping your key safe
- Call the API only from your servers. Never put the key in a website, browser code or a mobile app, where anyone can read it.
- Store the key in an environment variable or a secrets manager, not in your code repository.
- Do not share keys between environments. Ask for separate keys if you need them.
If a key is exposed, contact Finkhoz right away. The key will be revoked and a new one issued. The full key is shown only once when it is created and cannot be recovered later.
Authentication errors
| Status | Message | Meaning |
|---|---|---|
401 | missing bearer token | No Authorization: Bearer ... header was sent |
401 | invalid bearer token | The key is wrong, revoked or not active |
403 | IP address not allowed: <ip> | The request came from an IP address that is not approved |
403 | account disabled | Your account is disabled. Contact Finkhoz |