Download OpenAPI specification:
The AI Gateway API provides document processing capabilities for partner lending applications. It accepts document uploads, processes them through AI-powered analysis, and returns structured data extracted from documents.
The API processes multiple document categories with customizable extraction schemas. Extracted fields can be extended beyond the standard set through fine-tuning to meet specific partner requirements.
| Document Type | Classification | Extracted Data |
|---|---|---|
| BANK_STATEMENT | PRIMARY | Account details, transactions, balances, inferred income |
| PAYSLIP | PRIMARY | Employment details, salary breakdown, deductions |
| BIR_FORM_2303 | PRIMARY | Tax information and compliance data |
| CERTIFICATE_OF_EMPLOYMENT | PRIMARY | Employment status and company information |
| ELECTRICITY_BILL | SUPPORTING | Address, payment history |
| TELCO_BILL | SUPPORTING | Contact information, billing details |
| WATER_BILL | SUPPORTING | Address verification data |
Endpoint URLs are shared with partners individually.
Contact Boost Capital to receive environment-specific endpoint URLs and IP addresses for network configuration.
The API operates from dedicated IP ranges:
Specific IP addresses are provided during integration setup for firewall whitelisting.
The security measures described below represent the baseline configuration. These are not limited and can be extended, modified, or customized individually with partners based on specific security requirements and compliance obligations.
Partners have complete flexibility to choose which authentication and encryption methods to implement.
Mutual TLS (mTLS) provides bidirectional authentication for API domains. This setup ensures both the server and client verify each other's identity before any data is exchanged.
For successful connection and client authentication:
These cryptographic materials are securely shared by Boost Capital. The mTLS policy is configured to reject connections from clients that do not present a valid, trusted certificate.
End-to-end encryption of all API request and response payloads provides an additional layer of data security.
Request Encryption:
Response Decryption:
Important: The request and response examples in this documentation display decrypted JSON for readability. In actual implementation with encryption enabled, payloads must be encrypted and base64-encoded as described above.
The API supports OAuth 2.0 authentication via Google Cloud Identity-Aware Proxy (IAP). This standard ensures only trusted service accounts can obtain access tokens required for API requests.
Boost Capital will securely share:
Authorization: Bearer {idToken}
Sliding-window rate limiting is applied per tenant. The following limits are enforced:
| Endpoint | Limit |
|---|---|
| POST /ai-gateway/batch-upload | 200 requests/min |
| POST /ai-gateway/status | 300 requests/min |
| GET /ai-gateway/s3/listObjects | 100 requests/min |
File Processing Limits
| Constraint | Value |
|---|---|
| Max file size | 50 MB |
| Max pages per document | 50 |
| Max resolution per page | 40 megapixels |
| Max total resolution per batch | 400 megapixels |
| Allowed content types | PDF, PNG, JPEG, TIFF, HEIC, HEIF |
| Max concurrent documents per batch | 6 (default), configurable 1–20 |
When a rate limit is exceeded, the API responds with HTTP 429 and the following headers:
Retry-After: seconds until the next request window opensX-RateLimit-Limit: configured request ceiling per windowX-RateLimit-Remaining: requests remaining in the current windowX-RateLimit-Reset: seconds until the current window resetsRecommended retry guidance: respect the Retry-After header; use exponential backoff (1s → 2s → 4s); maximum 3 retries.
Validation errors follow the Pydantic error format:
{
"detail": [
{
"type": "error_type",
"loc": ["body", "field_path"],
"msg": "Human-readable error message",
"ctx": {}
}
]
}
Retry-After header on 429 responsesUse a unique submissionId for each application submission. Duplicate submissions with the same submissionId may be rejected or return the existing result.
For production integrations, implement a Dead Letter Queue (DLQ) or equivalent mechanism to hold unfulfilled requests temporarily when persistent 500 errors occur. This allows processing to resume once the API recovers, preventing data loss without re-ingesting original documents.
API endpoints for document processing and verification. The request body structures and examples shown in this documentation are displayed in decrypted JSON format for readability and ease of implementation. However, when payload encryption is enabled (see Payload Encryption section above), the actual HTTP POST body for all endpoints must be the base64-encoded, AES-256-CBC encrypted plain text string with the Content-Type:text/plain header. The same applies to response bodies - they will be returned as base64-encoded encrypted strings that must be decoded and decrypted using the same key and IV. Partners who choose not to implement payload encryption can send and receive standard JSON payloads with Content-Type:application/json.
Submit a batch of documents for AI-powered processing. This endpoint accepts multiple documents associated with a single application submission and processes them asynchronously.
applicationId, submissionId, and initial statuscallbacks.documentResult.url as each individual document completes processingcallbacks.applicationResult.url once all documents in the submission are processeddocumentId: Logical document unit identifier — multiple image files representing the same document (e.g., a multi-page bank statement scanned as separate images) share the same documentIdfileId: Physical file identifier — each individual file or image in the batch has a unique fileIdFor example, a two-page bank statement scanned as two separate JPEG images would have two entries sharing the same documentId but with different fileId values.
The API uses a two-tier callback system:
callbacks.documentResult): Delivers per-document OCR extraction, fraud checks, and quality assessment as soon as each document finishes processing. If five documents are submitted, five separate document result callbacks will be sent.callbacks.applicationResult): Delivered once after all documents in the submission are processed. Contains aggregated computed fields and cross-document consistency checks for the entire application.required | object |
required | object Callback endpoints for asynchronous processing results |
{- "payload": {
- "submissionId": "submission_12345",
- "documents": [
- {
- "documentId": "doc_001",
- "fileId": "file_001",
- "documentClassification": "PRIMARY",
- "documentType": "BANK_STATEMENT",
- "filename": "bank_statement.pdf",
- "s3Url": "s3://bucket-name/documents/bank_statement.pdf"
}
]
}, - "callbacks": {
- "documentResult": {
- "method": "POST",
- "headers": {
- "Authorization": "Bearer partner_token_xyz",
- "X-Account-Id": "account_123"
}
}, - "applicationResult": {
- "method": "POST",
- "headers": {
- "Authorization": "Bearer partner_token_xyz",
- "X-Account-Id": "account_123"
}
}
}
}{- "applicationId": "550e8400-e29b-41d4-a716-446655440000",
- "submissionId": "650e8400-e29b-41d4-a716-446655440001",
- "status": "ACCEPTED",
- "timestamp": "2025-11-07T14:30:00.123Z"
}{- "applicationId": "string",
- "submissionId": "string",
- "documentId": "string",
- "fileId": "string",
- "documentCategory": "string",
- "documentType": "BANK_STATEMENT",
- "status": "COMPLETED",
- "ocrResult": {
- "documentData": {
- "bankName": "string",
- "accountHolderName": "string",
- "accountNumber": "string",
- "currency": "string",
- "statementPeriodStart": "string",
- "statementPeriodEnd": "string",
- "openingBalance": 0,
- "closingBalance": 0,
- "totalDebits": 0,
- "totalCredits": 0
}, - "transactions": [
- {
- "postingDate": "string",
- "inferredPostingDate": "string",
- "transactionDescription": "string",
- "debitAmount": 0,
- "creditAmount": 0,
- "balance": 0
}
], - "computedFields": {
- "180days_valid_bankstatement": 0,
- "90days_consec_bankstatement": 0,
- "sources_bankstatement": "string",
- "bankname_bankstatement": "string",
- "totaldebit_bankstatement": 0,
- "totalcredit_bankstatement": 0,
- "inferredincome_bankstatement": 0
}, - "fraudChecks": {
- "overallFraudScore_bankstatement": 0,
- "isFraudulent_bankstatement": 0,
- "fraudCheckFindings": [
- {
- "type": "visualFraud",
- "description": "string"
}
]
}, - "qualityCheck": {
- "overallQualityScore_bankStatement": 0,
- "qualityCheckFindings": [
- {
- "type": "blur",
- "status": "above_threshold",
- "description": "string"
}
]
}, - "completenessCheck": {
- "overallCompletenessScore_bankStatement": 0
}
}
}Check the processing status of a previously submitted application.
This endpoint provides the current state of document processing for a given application. For detailed processing results including OCR data, fraud scores, and quality metrics, rely on the callback notifications sent to your webhook endpoints.
| applicationId required | string <uuid> Application identifier from batch upload response |
{- "applicationId": "550e8400-e29b-41d4-a716-446655440000"
}{- "applicationId": "550e8400-e29b-41d4-a716-446655440000",
- "submissionId": "650e8400-e29b-41d4-a716-446655440001",
- "status": "PROCESSING",
- "processingTimeMs": 15420,
- "timestamp": "2025-11-07T14:35:00.123Z"
}Check the API service health status. Optionally accepts a test payload that will be echoed back for integration testing.
| testPayload | object Optional test data to echo back |
{- "testPayload": {
- "testKey": "test_value",
- "timestamp": "2025-11-07T14:30:00.000Z"
}
}{- "status": "healthy",
- "service": "ai-gateway-api",
- "version": "1.0.0",
- "echo": {
- "testKey": "test_value",
- "timestamp": "2025-11-07T14:30:00.000Z"
}
}This endpoint allows checking access to and listing objects within a specified S3 bucket, with an option to use custom AWS credentials for cross-cloud access.
| prefix | string Prefix to filter objects |
| max_keys | integer [ 1 .. 1000 ] Default: 100 Maximum number of objects to return |
| bucket required | string Bucket name |
| X-AWS-Role-ARN | string Custom AWS role ARN |
| X-AWS-Region | string Custom AWS region (optional) |
| X-AWS-Audience | string Custom AWS audience (optional) |
{- "bucket": "string",
- "prefix": "string",
- "count": 0,
- "objects": [
- {
- "key": "string",
- "size": "string",
- "last_modified": "string",
- "size_formatted": "string"
}
]
}