Skip to content
Virasathome

For developers

Use Virasat as a service

Send a document, get the details. Send the details, get the claim route, the debate verdict and the forms. Any bank, insurer, service centre or NGO can use this from their own software.

Sandbox key

vs_test_demo

Free. Sample data and your own files. 30 requests a minute.

Live keys

vs_live_...

For institutions. Stored only as a SHA-256 hash on the server. Scopes and limits per key.

Errors

application/problem+json

Every error follows with a plain-language detail field. headers on every response.

Limits, honestly

X-Virasat-RateLimit-Store

Every response says which counter it used. shared means Upstash Redis, one counter across every instance, one round trip. instance means that store was not configured or did not answer within 1.5 seconds, and the limit fell back to this instance's memory, which is weaker than the number suggests. We fail open rather than fail a family's claim because a cache blinked.

Quickstart

Your first call in one minute

HOST=https://virasat-indol.vercel.app

# 1. Route a claim (rules plus the AI Review)
curl -X POST $HOST/api/v1/claims/route \
  -H "Authorization: Bearer vs_test_demo" -H "Content-Type: application/json" \
  -d '{"input":{"assetType":"bank","institution":"State Bank of India","amountInr":158420,
       "nomineePresent":true,"jointHolder":false,"claimantRelation":"spouse","otherHeirs":true}}'

# 2. Read a sample document
curl -X POST $HOST/api/v1/extract -H "Authorization: Bearer vs_test_demo" -F sampleId=passbook

# 3. Read your own document with your own AI key (Bring Your Own Key)
curl -X POST $HOST/api/v1/extract -H "Authorization: Bearer vs_test_demo" \
  -H "x-byo-anthropic-key: sk-ant-..." -F file=@passbook.jpg

Endpoints

MethodPathWhat it does
POST/api/v1/extractUpload a photo (multipart file) or sampleId. Returns the extracted fields with confidence per field.
POST/api/v1/ais/parseUpload an PDF (multipart file) or sample=true. Returns the asset map. No AI needed.
POST/api/v1/claims/routeJSON: input, optional extraction, userNotes, , rules (). Returns the rule decision and the debate verdict.
POST/api/v1/claims/packJSON: claim, asset, claimant. Returns the claim pack PDF.
GET/api/v1/dividends/search?name=Search the unpaid-dividend index by shareholder name.
GET/api/v1/rulesList the built-in and versions.
POST/api/v1/rulesValidate a against the schema.
GET/api/v1/rules/corpusThe whole claim . No key, no permission, MIT licensed.
GET/api/v1/rules/schemaThe a must satisfy, generated from the code that validates it.
GET/api/v1/healthService status and whether live AI is on.

Playground

Try the API in the browser

POST /api/v1/claims/route

Bring your own

Your data, your key, your rules

Bring Your Own Data

Files you send are processed for that request and returned. Nothing is stored beyond the request. Photos are re-encoded to strip metadata before the AI reads them (planned) and never used for training.

Bring Your Own Key

Send x-byo-anthropic-key with your Anthropic key. Your AI usage is billed to you and covered by your own data agreement. The key is used for that request only and is never stored or logged.

Bring Your Own Rules

Pass a rules array to /claims/route, or validate one first with POST /rules. Every result records the rule id and version used, so your compliance team can audit it.

{"institution":"My Bank","assetType":"bank","version":1,
 "rules":[{"id":"MYBANK_NOMINEE_V1","when":{"nomineePresent":true},
   "route":"nominee","documents":["claim_form","supporting_certificate","nominee_id"],
   "timelineDays":10}],
 "escalation":{"afterDays":30,"to":"RBI Ombudsman","how":"cms.rbi.org.in"}}

Open corpus

The rules are the part worth taking

The app is the replaceable bit. What does not exist anywhere today is the claim procedure of each Indian institution written down as data a machine can follow: which documents, in which order, above which amount, and where a family actually gets each one.

So the corpus is open, MIT licensed, and served with no key and no permission. If a bank, a government portal, or another team serves families better by taking it, that is the result we want. We would rather be the standard than the site.

Read it

GET /api/v1/rules/corpus returns every rule set, versioned as a whole so a result can cite exactly which corpus it came from.

Check yours against it

GET /api/v1/rules/schema is generated from the same Zod schema that validates incoming rule sets, so the published contract and the enforced one cannot drift apart.

Add one

You do not need to write code. The guide walks through writing a rule set, validating it, and trying it on a real situation.

Source and docs

Run it yourself

git clone https://github.com/usv240/virasat.git && cd virasat
npm install
cp .env.example .env.local     # optional: ANTHROPIC_API_KEY=sk-ant-... for live AI
npm run dev                    # http://localhost:3000

Without a key the app runs in Sample mode and the demo still works end to end. The repository README lists the stack, the tests and how to run them.