Authentication Guide

Complete authentication guide for BitMind Enterprise API.

Authentication Methods

Method
Security
Use Case
Setup

OAuth 2.0

⭐⭐⭐

M2M, enterprise integrations

10 min

OAuth + mTLS

⭐⭐⭐⭐⭐

Government, healthcare, financial

30 min

API Key

⭐⭐

Legacy clients

2 min

Quick Start

  1. Contact the BitMind team to get your enterprise account set up

  2. Visit https://app.bitmind.ai/api/enterprise to create your OAuth client. Use standard (non-mTLS) authentication to follow the rest of the steps on this page with your newly-generated client ID and client secret.

OAuth Flow

Python Client

Token lifetime: 1 hour

Method 2: OAuth + mTLS (High Security)

  1. Contact the BitMind team to get your enterprise account set up

  2. Visit https://app.bitmind.ai/api/enterprise to create your OAuth client with mTLS encryption. This still will generate client ID and mTLS certificates you will need to download for the first time.

mTLS selection

Quick Start

Python

Note: Certificates are client-managed. Certificate replaces client_secret for authentication. Contact [email protected] for setup.

Method 3: API Key (Legacy)

  1. Contact the BitMind team to get your enterprise account set up

  2. Visit https://app.bitmind.ai/api/enterprise to create your API key.

API keys

Note: OAuth is recommended for new integrations.

Available Endpoints

Endpoint
Method
Auth
Purpose

/v1/oauth/token

POST

client_id/secret

Get token

/health

GET

No

Health check

/status

GET

Yes

Service status

/image

POST

Yes

Single image

/video

POST

Yes

Single video

/batch_image

POST

Yes

Multiple images

/batch_video

POST

Yes

Multiple videos

Response Format

Success

  • isAI: Boolean (true if confidence >= 0.5)

  • confidence: Float (0.0 to 1.0)

  • processingTime: Seconds

Error

Best Practices

Security:

  • Use environment variables for credentials

  • Never commit secrets to git

  • Rotate OAuth secrets annually

  • Use mTLS for sensitive data

Token Management:

  • Cache tokens (1 hour lifetime)

  • Auto-refresh before expiry

  • Handle 401 errors gracefully

Performance:

  • Use batch endpoints for multiple items

  • Implement retry logic with exponential backoff

  • Monitor response times

Troubleshooting

Error
Cause
Solution

401 Unauthorized

Invalid credentials

Check client_id/secret or API key

401 Token expired

OAuth token > 1 hour

Request new token

403 Forbidden

Permission denied or missing mTLS

Add X-Client-Cert header

429 Too Many Requests

Rate limited

Wait 60s or upgrade tier

Support

Last updated