Authentication Methods

The Enterprise API supports three authentication methods. Choose the one that fits your security requirements:

Best for: Machine-to-machine authentication, enterprise integrations

Steps:

  1. Get OAuth token from /v1/oauth/token endpoint (1 hour lifetime)

  2. Use token in Authorization: Bearer header for API calls

Example:

# Step 1: Get token
curl -X POST https://enterprise.bitmind.ai/v1/oauth/token \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_ID" \
  -d "client_secret=YOUR_SECRET"

# Step 2: Use token
curl https://enterprise.bitmind.ai/image \
  -H "Authorization: Bearer YOUR_TOKEN" \
  --data-binary @image.jpg

Method 2: OAuth + mTLS (High Security - RFC 8705)

Best for: Government, healthcare, financial institutions

Steps:

  1. Get OAuth token using certificate (certificate replaces client_secret)

  2. Use token + certificate for all API calls

Example:

# Step 1: Get token with certificate (NO client_secret)
curl -X POST https://enterprise.bitmind.ai/v1/oauth/token \
  -H "X-Client-Cert: $(base64 -w 0 client.crt)" \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_ID"

# Step 2: Use token + certificate
curl https://enterprise.bitmind.ai/image \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-Client-Cert: $(base64 -w 0 client.crt)" \
  --data-binary @image.jpg

Method 3: Organization API Key (Legacy)

Best for: Existing enterprise clients

Steps:

  1. Use API key directly in Authorization: Bearer header

Example:

curl https://enterprise.bitmind.ai/image \
  -H "Authorization: Bearer enterprise-YOUR_API_KEY" \
  --data-binary @image.jpg

Setup: Configure your authentication at https://app.bitmind.ai/api/enterprise

Documentation: Complete Authentication Guide

Last updated