PDF summarizer
Give the URL of a PDF. SpecStream’s Extract API reads the whole file into Markdown, and your own model writes the summary from it. The tool opens in the workspace after sign-up and runs on the $10 of credit a new account gets, no card.
import os import anthropic from specstream_client import Client # 1. The Extract API reads the PDF into Markdown. client = Client(api_key=os.environ["SPECSTREAM_API_KEY"]) page = client.extract_pages({"urls": ["https://arxiv.org/pdf/1706.03762"]})["results"][0] # 2. Your model writes the summary from that text. reply = anthropic.Anthropic().messages.create( model=os.environ["ANTHROPIC_MODEL"], max_tokens=1024, messages=[{"role": "user", "content": "Summarize this document in five bullet points.\n\n" + page["text"]}], ) print(reply.content[0].text)
{
"data": {
"results": [
{
"url": "https://arxiv.org/pdf/1706.03762",
"status": "ok",
"title": "Attention Is All You Need",
"text": "... ## 1 Introduction\n\nRecurrent neural networks, long short-term memory ..."
}
]
}
}How it works
Two steps. The first runs on the Extract API, the second on the model you already use.
- Give the URL of the PDF
- Paste a link to a PDF in the Extract tab of the API playground. Word and Excel files are read the same way.
- The Extract API reads the file
- You get the full text of the document as Markdown, with its headings and lists kept. A file that gives no text is not charged.
- Your model writes the summary
- Give the Markdown to the model you use, with the instruction you want: a short summary, the main points, or the answer to one question. An agent connected through MCP does both steps in one request.
PDF summarizer questions
Something we didn't answer? Talk to a human
Does SpecStream write the summary?
No. The Extract API returns the text of the PDF as Markdown. The summary comes from your own model, which reads that text. The code on this page does both steps.
What does it cost?
A new account gets $10 of credit, with no card. After that, the Extract API is charged per 1,000 pages read, and the pricing page has the price. The model that writes the summary is charged by its own supplier.
Which files can it read?
PDF, Word and Excel files at a public URL, and web pages. Send up to 20 URLs in one call.
Can an agent use it?
Yes. Connect the SpecStream MCP server and the agent calls read_pages with the URL of the PDF, then writes the summary from the text.
Read your first PDF
Sign up, paste the URL of a PDF, and get its text as Markdown. The same call runs from your code with an API key.