Skip to main content

Authentication

All API requests require authentication using an API key. This guide explains how to obtain and use API keys securely.

Obtaining an API Key

  1. Sign in to your Structurify Dashboard
  2. Navigate to SettingsAPI Keys
  3. Click Create API Key
  4. Copy and store the key securely - it will only be shown once
Store Keys Securely

API keys grant access to your account. Never commit them to version control or expose them in client-side code.

Using API Keys

Include your API key in every request using one of these methods:

Authorization: Bearer sk_live_your_api_key

X-API-Key Header

X-API-Key: sk_live_your_api_key

SDK Configuration

import os
from structurify import Structurify

# Recommended: Use environment variable
client = Structurify(api_key=os.environ['STRUCTURIFY_API_KEY'])

# Or pass directly (not recommended for production)
client = Structurify(api_key="sk_live_your_api_key")

API Key Format

API keys follow this format:

sk_live_<32_random_characters>

Example: sk_live_abc123def456ghi789jkl012mno345

Security Best Practices

  1. Use environment variables - Never hardcode API keys
  2. Rotate keys periodically - Generate new keys and deprecate old ones
  3. Use separate keys - Different keys for development and production
  4. Monitor usage - Check your dashboard for unexpected activity
  5. Revoke compromised keys - Immediately revoke any exposed keys

Rate Limits

Each API key has associated rate limits:

LimitDefault
Requests per minute60
Requests per day10,000

Rate limit headers are included in every response:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed
X-RateLimit-RemainingRequests remaining
X-RateLimit-ResetUnix timestamp when limit resets

When rate limited, you'll receive a 429 Too Many Requests response with a Retry-After header.

Credits

API usage consumes credits from your organization's balance:

  • 1 credit = 1 document extracted

Check your credit balance in the Structurify Dashboard.

Revoking API Keys

To revoke a compromised API key:

  1. Go to Structurify Dashboard
  2. Navigate to SettingsAPI Keys
  3. Click Revoke next to the key

Revoked keys immediately stop working. Generate a new key and update your applications.