AI-Powered Document Intelligence API - A production-ready SaaS platform for document processing, OCR, and data extraction.
Live Demo | API Docs | Pricing
DocAI is a B2B SaaS product that enables businesses to extract structured data from documents using AI. Upload invoices, receipts, contracts, or forms - get back structured JSON.
- Invoice Processing - Extract vendor, amounts, line items, dates
- Receipt Digitization - Capture expenses automatically
- Contract Analysis - Pull key terms, dates, parties
- Form Processing - Digitize any structured form
- Customer sends document via HTTPS to CloudFront CDN
- API Gateway authenticates request via Cognito JWT
- Upload Handler generates presigned URL, stores metadata in DynamoDB
- Customer uploads document directly to S3
- S3 Event triggers Document Processor Lambda
- Textract performs OCR and data extraction
- Results stored in DynamoDB, event sent to EventBridge
- Webhook delivers results to customer's callback URL
| Feature | Description |
|---|---|
| REST API | Simple JSON API for document upload and retrieval |
| Async Processing | Upload documents, get webhook when ready |
| Multi-format Support | PDF, PNG, JPG, TIFF |
| Confidence Scores | AI confidence for each extracted field |
| Custom Templates | Define extraction schemas for your documents |
| SDKs | Python, Node.js, Go client libraries |
| Capability | Implementation |
|---|---|
| Multi-tenancy | Cognito user pools + DynamoDB tenant isolation |
| Authentication | JWT tokens via AWS Cognito |
| Rate Limiting | API Gateway throttling per pricing tier |
| Usage Tracking | DynamoDB counters + CloudWatch metrics |
| Webhooks | EventBridge → SNS/HTTP for async notifications |
| High Availability | Multi-AZ Lambda, DynamoDB on-demand |
| Tier | Pages/Month | Rate Limit | Price |
|---|---|---|---|
| Free | 100 | 10 req/min | $0 |
| Starter | 1,000 | 60 req/min | $49/mo |
| Business | 10,000 | 300 req/min | $299/mo |
| Enterprise | Unlimited | Custom | Contact us |
curl -X POST https://api.docai.example.com/v1/documents \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "file=@invoice.pdf" \
-F "document_type=invoice"{
"document_id": "doc_abc123",
"status": "processing",
"webhook_url": "https://your-app.com/webhook",
"estimated_completion": "2024-01-15T10:30:00Z"
}{
"document_id": "doc_abc123",
"status": "completed",
"document_type": "invoice",
"extracted_data": {
"vendor": {
"value": "Acme Corp",
"confidence": 0.98
},
"invoice_number": {
"value": "INV-2024-001",
"confidence": 0.99
},
"total_amount": {
"value": 1250.00,
"currency": "USD",
"confidence": 0.97
},
"line_items": [
{
"description": "Widget Pro",
"quantity": 5,
"unit_price": 250.00,
"confidence": 0.95
}
]
},
"processing_time_ms": 2340
}docai-platform/
├── terraform/
│ ├── modules/
│ │ ├── networking/ # VPC configuration
│ │ ├── cognito/ # User authentication
│ │ ├── api-gateway/ # REST API with throttling
│ │ ├── lambda/ # Processing functions
│ │ ├── dynamodb/ # Data storage
│ │ ├── s3/ # Document storage
│ │ └── monitoring/ # CloudWatch dashboards
│ └── environments/
│ ├── dev/
│ └── prod/
├── src/
│ ├── api/ # API handlers
│ ├── document-processor/ # AI extraction logic
│ └── webhooks/ # Notification handlers
├── docs/
│ ├── api-reference.md
│ └── integration-guide.md
└── .github/workflows/ # CI/CD
| Decision | Choice | Why |
|---|---|---|
| Compute | Lambda | Pay-per-use, scales to zero, no ops overhead |
| Database | DynamoDB | Serverless, scales automatically, pay-per-request |
| Auth | Cognito | Managed user pools, JWT, integrates with API Gateway |
| OCR/AI | Textract | Managed, no ML ops, high accuracy |
| IaC | Terraform | Reproducible, multi-environment, team-friendly |
| Storage | S3 | Cheap, durable, lifecycle policies |
# Deploy to dev
cd terraform/environments/dev
terraform init
terraform apply
# Deploy to prod
cd terraform/environments/prod
terraform init
terraform apply- Request latency (p50, p95, p99)
- Error rate by endpoint
- Documents processed per tenant
- Textract API costs
- Monthly active users
- Error rate > 1%
- Latency p99 > 5s
- Cost anomaly detection
- Failed webhook deliveries
- All data encrypted at rest (S3, DynamoDB)
- TLS 1.2+ for all API traffic
- Tenant data isolation at database level
- API keys rotatable per customer
- SOC 2 Type II compliant architecture
MIT
Built by: Venkata Subramanian Stack: AWS Lambda, API Gateway, DynamoDB, S3, Textract, Cognito, Terraform
