Document Intelligence API

Upload any document. Get structured JSON back. Invoices, contracts, tax forms, leases, receipts — extracted in seconds with AI-powered precision.

Get Your Free API Key

Getting Started

The StellarClose Document Intelligence API extracts structured data from documents using AI. Upload a PDF or image, and receive clean, typed JSON with extracted fields, confidence scores, key dates, and financial summaries.

Quick Start (3 steps)

  1. Sign up below to get your free API key (50 pages/month)
  2. Upload a document via the /api/v1/extract endpoint
  3. Get structured JSON with all extracted data, confidence scores, and key dates
curl -X POST https://api.stellarclose.com/api/v1/extract \
  -H "X-Api-Key: YOUR_API_KEY" \
  -F "file=@invoice.pdf"
import requests

resp = requests.post(
    "https://api.stellarclose.com/api/v1/extract",
    headers={"X-Api-Key": "YOUR_API_KEY"},
    files={"file": open("invoice.pdf", "rb")}
)
data = resp.json()
print(data["data"]["document_type"])
print(data["data"]["extracted_fields"])
const form = new FormData();
form.append("file", fs.createReadStream("invoice.pdf"));

const res = await fetch("https://api.stellarclose.com/api/v1/extract", {
  method: "POST",
  headers: { "X-Api-Key": "YOUR_API_KEY" },
  body: form,
});
const data = await res.json();
console.log(data.data.document_type);
console.log(data.data.extracted_fields);

Authentication

All API requests require an API key passed in the X-Api-Key header.

X-Api-Key: doci_your_api_key_here

API keys start with the doci_ prefix. Keep your key secure — do not commit it to version control or expose it in client-side code.

Getting a Key

Sign up via the form below or call the signup endpoint:

curl -X POST https://api.stellarclose.com/api/v1/signup \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}'

Error Responses

StatusMeaning
401Missing or invalid API key
429Monthly page limit exceeded (free tier)
413File too large or too many pages for tier

Endpoints

Base URL: https://api.stellarclose.com

POST /api/v1/extract Extract structured data from a document

Request

Multipart form upload. Send the document as the file field.

FieldTypeDescription
fileFile (required)PDF, PNG, JPG, GIF, WEBP, TIFF, or BMP. Max 50MB.

Headers

HeaderRequiredDescription
X-Api-KeyYesYour API key

Response

{
  "success": true,
  "data": {
    "document_type": "Commercial Invoice",
    "document_summary": "Invoice #INV-2024-0847 from Acme Corp to Beta LLC for consulting services totaling $12,500.00",
    "extracted_fields": {
      "invoice_number": "INV-2024-0847",
      "invoice_date": "2024-03-15",
      "due_date": "2024-04-14",
      "vendor_name": "Acme Corporation",
      "vendor_address": "123 Business Ave, Suite 400, New York, NY 10001",
      "bill_to": "Beta LLC",
      "subtotal": 12500.00,
      "tax_rate": "0%",
      "tax_amount": 0,
      "total": 12500.00,
      "payment_terms": "Net 30"
    },
    "confidence_scores": {
      "invoice_number": 0.99,
      "invoice_date": 0.98,
      "due_date": 0.95,
      "vendor_name": 0.99,
      "total": 0.99
    },
    "key_dates": [
      {"date": "2024-03-15", "description": "Invoice date", "is_deadline": false},
      {"date": "2024-04-14", "description": "Payment due date", "is_deadline": true}
    ],
    "parties": [
      {"name": "Acme Corporation", "role": "vendor", "contact": "billing@acme.com"},
      {"name": "Beta LLC", "role": "client", "contact": null}
    ],
    "financial_summary": {
      "total_amount": 12500.00,
      "currency": "USD",
      "line_items": [
        {"description": "Strategy consulting — March 2024", "quantity": 50, "unit_price": 250.00, "amount": 12500.00}
      ]
    },
    "metadata": {
      "page_count": 1,
      "language": "en",
      "has_signatures": false,
      "is_executed": true
    }
  },
  "usage": {
    "pages_processed": 1,
    "processing_time_ms": 2340,
    "tokens_used": 1856,
    "monthly_pages_used": 12,
    "monthly_pages_limit": 50
  }
}

Supported Document Types

The API automatically detects and extracts from any document type including:

CategoryExamples
FinancialInvoices, receipts, bank statements, purchase orders
TaxW-2, 1099, W-9, tax returns
LegalContracts, NDAs, lease agreements, terms of service
Real EstatePurchase agreements, disclosures, title commitments, closing docs
InsurancePolicies, claims, EOBs
MedicalMedical records, lab results, prescriptions
IdentityDriver licenses, passports (image upload)
OtherResumes, reports, forms — any structured document
POST /api/v1/signup Create account and get API key

Request Body (JSON)

{"email": "developer@example.com"}

Response

{
  "success": true,
  "message": "Account created. Your API key is below.",
  "api_key": "doci_a1b2c3d4e5f6...",
  "tier": "free",
  "limits": {"pages_month": 50, "pages_request": 5, "price": 0},
  "docs": "https://api.stellarclose.com/docs"
}
GET /api/v1/usage Current month usage statistics

Headers

X-Api-KeyRequired

Response

{
  "email": "developer@example.com",
  "tier": "free",
  "monthly_usage": {
    "pages_used": 23,
    "pages_limit": 50,
    "pages_remaining": 27,
    "overage_pages": 0,
    "overage_charge": 0,
    "reset_date": "2024-04-01"
  },
  "tier_limits": {
    "pages_per_month": 50,
    "pages_per_request": 5,
    "price_per_month": 0
  }
}
GET /api/v1/health API health status (no auth required)
{"status": "healthy", "service": "stellarclose-document-intelligence", "version": "1.0.0"}

Full Examples

Python — Extract and process invoice

import requests

API_KEY = "doci_your_key_here"
BASE = "https://api.stellarclose.com"

# Upload a PDF invoice
with open("invoice.pdf", "rb") as f:
    resp = requests.post(
        f"{BASE}/api/v1/extract",
        headers={"X-Api-Key": API_KEY},
        files={"file": ("invoice.pdf", f, "application/pdf")}
    )

result = resp.json()
if result["success"]:
    doc = result["data"]
    print(f"Type: {doc['document_type']}")
    print(f"Summary: {doc['document_summary']}")

    # Access extracted fields
    fields = doc["extracted_fields"]
    print(f"Invoice #: {fields.get('invoice_number')}")
    print(f"Total: ${fields.get('total')}")

    # Check deadlines
    for d in doc.get("key_dates", []):
        if d["is_deadline"]:
            print(f"DEADLINE: {d['date']} — {d['description']}")
else:
    print(f"Error: {resp.status_code}")

JavaScript (Node.js) — Batch processing

const fs = require("fs");
const FormData = require("form-data");

const API_KEY = "doci_your_key_here";
const BASE = "https://api.stellarclose.com";

async function extractDocument(filePath) {
  const form = new FormData();
  form.append("file", fs.createReadStream(filePath));

  const res = await fetch(`${BASE}/api/v1/extract`, {
    method: "POST",
    headers: {
      "X-Api-Key": API_KEY,
      ...form.getHeaders(),
    },
    body: form,
  });

  return res.json();
}

// Process multiple files
const files = ["invoice1.pdf", "contract.pdf", "receipt.jpg"];
for (const file of files) {
  const result = await extractDocument(file);
  console.log(`${file}: ${result.data.document_type}`);
  console.log(`  Fields: ${Object.keys(result.data.extracted_fields).length}`);
}

cURL — Upload an image

# Extract from a photo of a receipt
curl -X POST https://api.stellarclose.com/api/v1/extract \
  -H "X-Api-Key: doci_your_key_here" \
  -F "file=@receipt.jpg"

# Check your usage
curl https://api.stellarclose.com/api/v1/usage \
  -H "X-Api-Key: doci_your_key_here"

Pricing

Start free. Scale as you grow. All tiers include the same AI extraction quality.

Free

$0/mo
  • 50 pages/month
  • 5 pages/request
  • All document types
  • JSON + confidence scores

Starter

$29/mo
  • 500 pages/month
  • 20 pages/request
  • Overage: $0.05/page
  • Priority support

Scale

$199/mo
  • 10,000 pages/month
  • 100 pages/request
  • Overage: $0.05/page
  • Dedicated support

Rate Limits

TierPages/MonthPages/RequestOverage
Free505Hard cap (upgrade required)
Starter50020$0.05/page
Growth2,00050$0.05/page
Scale10,000100$0.05/page

Need more? Contact support@stellarclose.com for enterprise pricing.

Get Your API Key