Constaia

What to use

When to use analyze, classify, batches, the widget, the MCP server or a no-code tool in Constaia, with the cost, latency and limits of each option.

Constaia offers several ways to process documents. They all use the same API and the same keys; what changes is the cost, the latency and who uploads the file.

Summary

OptionWhat forCostResponse
POST /v1/analyzeVerdict + extracted data for one document1 credit per 2 pages (minimum 1)Synchronous up to 30 s; otherwise 202 and webhook
POST /v1/classifyOnly find out which document type it is0.2 creditsSynchronous
POST /v1/batchesMany documents at once (1–100)Like analyze, per documentAlways 202; batch.completed webhook
Widget <constaia-upload>Browser capture with camera and quality controlThat of the analysis your backend runsWhatever your backend returns
MCP serverLet an AI agent (Claude, Cursor…) analyse documentsLike analyze / classifyMCP tools
No-coden8n, Make, Zapier, Power Automate… with HTTP requestsLike analyze / classifyDepends on the tool

How to decide

QuestionIf the answer is yes
Do you need to know whether the document is valid and get its data?analyze with expect and checks.
Do you only need to route (is it an invoice or a receipt?) without extracting data?classify. It costs a fifth.
Do you receive several documents at once (a folder, an email with attachments, an import)?batches, with a combined export.
Does the user upload from a browser or phone and you want to guide the photo?Widget in the frontend + analyze in your backend.
Are you working from an AI assistant or agent?MCP server.
Don't want to write code?The no-code guide for your tool.

You can combine them: for example, classify to decide the type and then analyze with the right expect, or the widget in the form and batches for bulk imports.

Cost

  • analyze: ceil(pages / 2) credits, minimum 1. An ID card with both sides in one file or a 2-page PDF costs 1 credit; a 5-page PDF, 3.
  • classify: 0.2 credits per document.
  • Batches: each document is charged as an analyze. In live mode Constaia checks up front that you have at least 1 credit per document (otherwise 402).
  • Exports are included. Test mode never charges.

See Credits and billing and Pricing.

Latency

  • analyze and classify wait up to 30 seconds. If the analysis hasn't finished, they respond 202 with the analysis in queued or processing and the result arrives by webhook or by polling GET /v1/analyses/{id}.
  • With async: true the response is always an immediate 202.
  • Batches are always asynchronous: you get analysis.review_required and analysis.failed per document and a single batch.completed at the end.

Limits

LimitValue
File size20 MB
Pages per PDF30 synchronous, 200 with async: true or in batches
Documents per batch1–100
Types in expect1–20
Requests per secondPer key: 2 on the free plan, 10 on paid
Concurrent synchronous analysesPer account: 2 on the free plan, 10 on paid (batches and async: true don't count)
Pages per minutePer account: 60 on the free plan, 600 on paid (see Rate limits)

Examples

analyze

Terminal
curl https://api.constaia.com/v1/analyze \
  -H "Authorization: Bearer $CONSTAIA_API_KEY" \
  -F file=@dni_valid.jpg \
  -F 'options={"expect":"es_dni","checks":{"min_age_years":18}}'

Returns the full analysis: document, verdict, fields, checks, warnings. See Quickstart.

classify

Terminal
curl https://api.constaia.com/v1/classify \
  -H "Authorization: Bearer $CONSTAIA_API_KEY" \
  -F file=@dni_valid.jpg \
  -F 'options={"expect":"es_dni"}'
Response (excerpt)
{
  "object": "classification",
  "status": "completed",
  "document": { "type": "es_dni", "label": "DNI (España)", "confidence": 0.97, "side": "both", "country": "ESP" },
  "candidates": [{ "type": "es_dni", "confidence": 0.97 }],
  "verdict": {
    "expected": ["es_dni"],
    "match": true,
    "status": "valid",
    "reasons": [{ "code": "type_match", "severity": "info", "message": "El documento es DNI (España)." }]
  },
  "warnings": []
}

The classify verdict only evaluates the type (type_match or type_mismatch): it does not check expiry or extract fields.

Batch

Terminal
curl https://api.constaia.com/v1/batches \
  -H "Authorization: Bearer $CONSTAIA_API_KEY" \
  -F "files[]=@invoice-001.pdf" \
  -F "files[]=@invoice-002.pdf" \
  -F 'options={"expect":"invoice","export":["xlsx"]}'

It responds 202 with a batch object (bat_...) in processing. When it finishes you get batch.completed with counts and the combined export in exports.xlsx, one row per document. See Bulk batches.

Widget

signup.html
<script type="module" src="https://cdn.jsdelivr.net/npm/@constaia/widget@0.1"></script>

<constaia-upload endpoint="/api/constaia" document="es_dni" lang="en"></constaia-upload>

The widget never holds the key: it sends the file to your endpoint (/api/constaia), and your backend calls POST /v1/analyze with the expect and checks it decides. See Widget.

MCP

Terminal
claude mcp add constaia --env CONSTAIA_API_KEY=ck_test_... -- npx -y @constaia/mcp

It exposes the tools analyze_document, classify_document, list_document_types, get_analysis and get_balance. See MCP server.

No-code

In n8n, Make, Zapier or Power Automate you use the tool's HTTP module to call POST /v1/analyze. See the n8n, Make and Zapier guides.

Coming soon

  • Verification links (POST /v1/verification-links): a URL you send to the user so they upload the document without going through your backend. Today it responds 501 not_implemented.
  • Official n8n node and publishable browser keys.

Next steps

On this page