API Keys
All Aifano Platform API requests require authentication via a Bearer token. API keys are scoped to your organization and can be managed in the Aifano Studio.Key Format
Aifano API keys follow this format:Making Authenticated Requests
Include your API key in theAuthorization header as a Bearer token:
Managing API Keys
Creating a Key
- Go to studio.aifano.com
- Navigate to Settings → API Keys
- Click Create API Key
- Copy the key immediately — it won’t be shown again
Revoking a Key
Revoked keys immediately stop working. Go to Settings → API Keys and click Revoke next to the key you want to disable.Key Scopes
API keys can be scoped to specific operations:| Scope | Description |
|---|---|
parse | Document parsing |
extract | Data extraction |
split | Document splitting |
edit | Document editing |
upload | File uploads |
* | All operations (default) |
Error Responses
| Status | Error | Description |
|---|---|---|
401 | Missing or invalid Authorization header | No Bearer token provided |
401 | Invalid API key format | Key doesn’t start with ak_live_ |
401 | Invalid API key | Key not found or doesn’t match |
401 | API key has been revoked | Key was revoked in Studio |
401 | API key has expired | Key passed its expiration date |
Best Practices
Use environment variables
Use environment variables
Store your API key in an environment variable rather than hardcoding it:
Rotate keys regularly
Rotate keys regularly
Create new keys periodically and revoke old ones. This limits the impact of a compromised key.
Use scoped keys
Use scoped keys
If a service only needs to parse documents, create a key with only the
parse scope.Monitor usage
Monitor usage
Check your API key usage in Studio to detect unusual activity early.