All guides
Summarize and question long documents
Long-context models read up to about a million tokens in one request: several books, a full codebase or a year of meeting notes. For many documents that is simpler and more accurate than building a search pipeline.
Recommended models
Chosen from models whose abilities we have verified for this job. Cost is for a ~300-page document (about 120K tokens in, 800 out), at current prices.
| Model | Input / 1M | Output / 1M | Context | Per request |
|---|---|---|---|---|
| Our pickDeepSeek V4.1 Flash deepseek/deepseek-v4.1-flash | $0.375 | $1.50 | 1.05M | $0.0462 |
| Also strongKimi K3 moonshotai/kimi-k3 | $3.75 | $18.75 | 1.05M | $0.4650 |
| Lowest costDeepSeek V4 Flash 0423 deepseek/deepseek-v4-flash | $0.175 | $0.35 | 1.05M | $0.0213 |
How it works
- 1Load the document as plain text (convert PDFs to text first).
- 2Wrap it in clear delimiters such as <document> tags and put your question after it.
- 3Ask for a specific output: bullet points, a table of deadlines, or answers with quotes.
Copy, paste, run
Set AMR_API_KEY to a key from your dashboard, install the OpenAI SDK (pip install openai or npm install openai) and run it. It reads document.txt from the current folder; use your own file. Swap the model for any other in the table.
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.aimodelsrouter.ai/v1", api_key=os.environ["AMR_API_KEY"])
MODEL = "deepseek/deepseek-v4.1-flash"
# A whole contract, transcript, report or book chapter: long-context models read hundreds of pages at once.
with open("document.txt", encoding="utf-8") as f:
document = f.read()
response = client.chat.completions.create(
model=MODEL,
messages=[
{"role": "system", "content": "You summarize documents for busy readers. Be accurate and never invent facts."},
{"role": "user", "content": f"<document>\n{document}\n</document>\n\n"
"Summarize this in 5 bullet points, then list every deadline and amount it mentions."},
],
)
print(response.choices[0].message.content)
print(f"\n{response.usage.prompt_tokens:,} tokens in, {response.usage.completion_tokens:,} out")Tested 2026-10-28: both versions were run against the live API with each model recommended at the time, and their answers checked.
Tips
- Input tokens dominate the cost here: check the input price on each model and the estimate below before sending very large files.
- Asking for quotes from the document makes answers easier to verify.
- For many questions about the same document, keep the document at the start of the prompt and only change the question at the end.
All 12 models that fit this job
- DeepSeek V4 Flash 0423$0.0213
- DeepSeek V4 Flash 0731$0.0213
- GLM 5.3 Flash$0.0230
- Nemotron 3.5 Super VL$0.0457
- DeepSeek V4.1 Flash$0.0462
- DeepSeek V4.1 Flash 1017$0.0462
- Beam 1.0 501B A23B$0.0612
- DeepSeek V4 Pro 0813$0.2020
- GLM 5.3$0.2144
- DeepSeek V4 Pro 0423$0.2645
- Qwen3.8 Max (open weights, 2.4T A95B)$0.3060
- Kimi K3$0.4650