XERJ Reader·xerj-reader-1·Preview
Answers you can point to.
Send a document and a question. XERJ Reader answers with the exact piece of your document that holds the answer, and its character offsets. Or Yes. Or No. Or an explicit “not in this document”. It has no way to write text that is not in your document, so it cannot invent a value.
Access is by invitation during the preview. Sign in with GitHub or Hugging Face through hub.xerj.org to request it. The preview is free, no card.
One request·one answer
JSON in. Evidence out.
Request
curl https://platform.xerj.ai/v1/answers \
-H "Authorization: Bearer $XERJ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "xerj-reader-1",
"document": "From: Maria Keller <[email protected]>\n…",
"question": "How much is invoice INV-20931?"
}'
from xerj import XERJ
client = XERJ() # reads XERJ_API_KEY
res = client.answers.create(
document=email_text,
question="How much is invoice INV-20931?",
)
print(res.answer.text) # 48,200 EUR
print(res.answer.start, res.answer.end) # 533 543
import XERJ from "xerj";
const client = new XERJ({ apiKey: process.env.XERJ_API_KEY });
const res = await client.answers.create({
document: emailText,
question: "How much is invoice INV-20931?",
});
console.log(res.answer.text); // 48,200 EUR
console.log(res.answer.start, res.answer.end); // 533 543
Response
{
"id": "ans_4Jt9qWm2Xc",
"object": "answer",
"created": 1794326407,
"model": "xerj-reader-1",
"answer": {
"type": "span",
"text": "48,200 EUR",
"start": 533,
"end": 543,
"confidence": 0.98
},
"best_guess": null,
"usage": { "input_tokens": 230, "output_tokens": 3, "total_tokens": 233 }
}
In the document · characters 533–543
- Invoice INV-20931 for 48,200 EUR is due on 30 November. Please pay by bank transfer; we no longer accept cheques.
document[533:543] == "48,200 EUR". The text is copied from your document, never written by the model. Example values; the full example email is in the playground.
How it works
Three steps.
Get access
Sign in with GitHub or Hugging Face through hub.xerj.org, the same account you use on the hub, and request access. Access is by invitation during the preview. Once you are approved, open the link we email you and create a key.
Send a document and a question
One POST /v1/answers. Plain text, up to 1,000,000 characters per request. PDF, Word, HTML and email files go through /v1/convert first.
Point at the answer
Use start and end to highlight the answer in your own UI. Below your min_confidence you get “no answer” and the best guess, so nothing is acted on blindly.
Why XERJ Reader
Every answer comes with its source.
Answers you can point to
Every answer is an exact piece of your document with its character offsets, or Yes/No, or an explicit “not in this document”. The model cannot invent a value: it has no way to write text that is not in your document.
Every substring is a possible answer
Choice-style APIs pick from a list of options that you write. XERJ Reader picks from the document itself, so dates, amounts, names, IDs and clauses work without listing them first.
Honest abstention
A confidence comes with every answer. Below min_confidence the API says “no answer” and still shows its best guess. You choose the trade-off between coverage and safety.
Built for documents
Emails, contracts, invoices, receipts, policies, tickets, logs, web pages. One request reads up to 1,000,000 characters.
Cheap and simple
You pay for input tokens only, and output is free. A key, one endpoint, JSON in, JSON out. SDKs for Python and JavaScript, shaped like the ones you already know.
Private by design
Documents and questions are processed in memory and never stored or logged. Usage records hold counts only: tokens, latency, endpoint, status. Privacy note.
Part of XERJ
XERJ search finds the right documents; XERJ Reader answers from them with evidence. XERJ Extract (coming soon) turns fields into checked programs with evidence.
Use cases
Where a value needs a source.
Anywhere a person or a program acts on a value read from a document, and someone may ask where it came from.
- Inbox and claims intakePull order numbers, dates, amounts and promised actions out of customer emails, each with its position in the email.
- Invoices and receiptsRead the invoice number, total and due date with
/v1/extract: up to 20 fields in one call, each with its evidence span. - Contracts and policiesAsk for a notice period, a renewal date or a liability cap. Get the clause text back, or “not in this document”.
- Answers on top of searchSearch finds the right documents. The Reader returns the passage that answers the question, so your UI can show it highlighted.
- Tickets and logsPull a customer, an order ID or an error code out of a ticket or a log line, with the exact characters it came from.
Pricing
Pay for input. Output is free.
per 1M input tokens
Answers are copied from your document, so output tokens cost nothing.
The preview is free, with daily limits.
Access is by invitation during the preview.