API Reference

Overview

BitMind provides multiple API endpoints for different use cases, from consumer applications to enterprise-grade services. This document provides an overview of available APIs with complete OpenAPI specifications for detailed implementation.

📋 OpenAPI Specifications

Complete OpenAPI 3.0 specifications are available for all APIs:

View and interact with these specifications using Swagger UIarrow-up-right or generate client SDKs using OpenAPI Generatorarrow-up-right.

API Categories

1. Subnet API (Oracle API)

  • Base URL: https://api.bitmind.ai/oracle/v1

  • Purpose: AI content detection services

  • Authentication: Bearer token (API key or JWT)

  • Rate Limits: API key users (based on subscription tier), JWT users (1 req/sec with burst)

2. Enterprise API

  • Base URL: https://enterprise.bitmind.ai

  • Purpose: Enterprise-grade detection services

  • Authentication: API key + OAuth 2.0

  • Rate Limits: 1,000-10,000+ requests/hour

API Overview

Subnet API (Oracle API)

The Subnet API provides AI content detection services with comprehensive image and video analysis capabilities. Key features include:

  • Image Detection: Multi-version processing with C2PA analysis

  • Video Detection: Frame-by-frame analysis with preprocessing

  • Video Preprocessing: Browser-compatible conversion and thumbnail generation

  • Upload Management: Presigned S3 URLs for large file uploads

For complete endpoint documentation, see the Subnet API OpenAPI Specificationarrow-up-right.

Enterprise API

The Enterprise API provides high-performance, enterprise-grade detection services with advanced features:

  • Health Monitoring: Service status and health checks

  • Image Inference: Binary and JSON-based image processing

  • Video Inference: Enterprise-grade video analysis

  • Batch Processing: Efficient multi-file processing

  • Privacy-Compliant: See Compliance & Privacy for details

For complete endpoint documentation, see the Enterprise API OpenAPI Specificationarrow-up-right.

Error Handling

Standard Error Response

Common Error Codes

Code
Description
HTTP Status

INVALID_REQUEST

Malformed request

400

UNAUTHORIZED

Invalid authentication

401

FORBIDDEN

Insufficient permissions

403

NOT_FOUND

Resource not found

404

RATE_LIMITED

Rate limit exceeded

429

INTERNAL_ERROR

Server error

500

SERVICE_UNAVAILABLE

Service temporarily unavailable

503

Rate Limits

Subnet API (Oracle API)

  • API Key users: Rate limits based on subscription tier

  • JWT users: 1 request per second with burst allowance of 5 requests

  • Application-specific: Rate limits may vary based on the x-bitmind-application header

Enterprise API

  • Standard: 1,000 requests/hour

  • Enterprise: 10,000+ requests/hour

  • Custom: Negotiable for large deployments

cURL Examples

Oracle API - Image Detection

Oracle API - Video Detection

Enterprise Batch Processing

Large File Upload Workflow

The Subnet API has a 10MB limit for direct file uploads due to API Gateway restrictions. For larger files (up to 200MB), use the following workflow with presigned S3 URLs:

Overview

This three-step process allows you to upload large video files:

  1. Request a presigned S3 URL

  2. Upload your file directly to S3

  3. Process the video using the S3 URL

Step 1: Request Presigned Upload URL

Get a presigned S3 URL and credentials for uploading your file:

Response:

Step 2: Upload to S3

Upload your file using the presigned URL and credentials from Step 1:

Step 3: Process Video

Once uploaded, use the videoUrl from Step 1 to process your video:

Complete Bash Script Example

chevron-rightClick to expand complete bash scripthashtag

Important Notes

  • File Size Limit: Maximum file size is 200MB (compared to 10MB for direct uploads)

  • Presigned URL Expiry: URLs expire in 15 minutes - complete all steps within this timeframe

  • Supported Formats: mp4, mov, avi, mkv, webm, wmv

  • Requirements: You'll need jq installed for JSON parsing in the bash script

  • File Location: Ensure your video file exists at the specified path

When to Use This Workflow

Use this workflow when:

  • Your video file exceeds 10MB

  • You need to upload files up to 200MB

  • You want more reliable uploads for large files

  • You're implementing a production application with large media files

For files under 10MB, you can use the direct upload method shown in the cURL examples above.

Best Practices

1. Authentication

  • Store API keys securely (environment variables, key management systems)

  • Never commit API keys to version control

  • Use different keys for different environments

  • Rotate keys regularly

2. Error Handling

  • Always check response status codes

  • Implement exponential backoff for retries

  • Log errors for debugging

  • Handle rate limits gracefully

3. Performance

  • Use batch endpoints for multiple files

  • Implement caching for repeated requests

  • Monitor API usage and limits

  • Use appropriate timeouts

4. Security

  • Validate input data before sending

  • Use HTTPS for all requests

  • Implement request signing where required

  • Monitor for suspicious activity

Resources

  • OpenAPI Specifications: See links above

  • For help, visit the Support page


For the most up-to-date API documentation, visit docs.bitmind.aiarrow-up-right

Last updated