Skip to main content

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:
ak_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Keep your API keys secure. Never expose them in client-side code, public repositories, or browser requests. Use environment variables or a secrets manager.

Making Authenticated Requests

Include your API key in the Authorization header as a Bearer token:
curl -X POST "https://platform.aifano.com/parse" \
  -H "Authorization: Bearer ak_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"input": "https://example.com/document.pdf"}'

Managing API Keys

Creating a Key

  1. Go to studio.aifano.com
  2. Navigate to Settings → API Keys
  3. Click Create API Key
  4. 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:
ScopeDescription
parseDocument parsing
extractData extraction
splitDocument splitting
editDocument editing
uploadFile uploads
*All operations (default)

Error Responses

StatusErrorDescription
401Missing or invalid Authorization headerNo Bearer token provided
401Invalid API key formatKey doesn’t start with ak_live_
401Invalid API keyKey not found or doesn’t match
401API key has been revokedKey was revoked in Studio
401API key has expiredKey passed its expiration date

Best Practices

Store your API key in an environment variable rather than hardcoding it:
export AIFANO_API_KEY="ak_live_your_key_here"
Create new keys periodically and revoke old ones. This limits the impact of a compromised key.
If a service only needs to parse documents, create a key with only the parse scope.
Check your API key usage in Studio to detect unusual activity early.