Authentication
Authenticate every request with an API key sent as a bearer token.
Create keys in Console → API keys. Keys start with nf_. Send the key in the Authorization header of every request:
Authorization: Bearer nf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcurl https://api.nanoapi.ai/v1/balance \
-H "Authorization: Bearer $NANOAPI_API_KEY"A key that doesn't exist, was deleted or has been reset returns 401 invalid_api_key.
A key can spend your balance. Keep it on your server: never in front-end code, mobile apps or public repositories.
Managing keys
- The full key is shown once, when you create or reset it. Store it in a secrets manager or an environment variable.
- Resetting a key invalidates the old one immediately: anything still using it gets
401right away. To switch keys without downtime, create a new key, deploy it, then delete the old one. - You can have several keys, each with its own name. Every task records the key that created it in its
api_keyfield (id,name,prefix), and the task list can be filtered byapi_key_id. - Rate limits are per user, not per key: all your keys share the same limits.
These are console-only, with no API:
| Task | Where |
|---|---|
| Create, reset and delete API keys | Console → API keys |
| View and reset the webhook signing secret | Console → Webhooks |
| Add funds | Console → Recharge |
| Billing history | Console → Billing |
| Usage statistics | Console → Usage |
| Browse your tasks | Console → Tasks |