pydantic-ai-specstream
SpecStream is the live web data engine for teams and agents. One platform to build, search, extract, enrich, map, and monitor data across the entire web.
Ask for any dataset in plain words, and SpecStream builds it from the entire live web: every match found, extracted and enriched into structured records, then monitored for change. It runs through the API and MCP, and inside Sheets, CRMs, Slack, n8n, Zapier and the other tools teams already use.
Source URL and read time on every value.
Three products:
- Search API:
GET /v1/web-search, $5 per 1,000 searches of up to 10 results. The most accurate web search API in the world (scores and method: https://specstream.ai/benchmarks). - Extract API:
POST /v1/extract, up to 20 URLs a call (web pages, PDF, Word, Excel), $0.80 per 1,000 pages. A page with no text is not charged. - Deep Search: Ask in plain words. Get every match on the live web, in structured rows. Priced per row.
Install
pip install pydantic-ai-specstream
export SPECSTREAM_API_KEY=ss_live_... # Agents & API in your SpecStream workspace
A free account comes with $10 of credit and needs no card: specstream.ai.
Use it as a capability
from pydantic_ai import Agent
from pydantic_ai_specstream import SpecStreamCapability
agent = Agent('openai:gpt-5', capabilities=[SpecStreamCapability()])
result = agent.run_sync('Who won the 2025 Nobel Prize in Physics? Read the announcement page and quote one line.')
print(result.output)
The example needs SPECSTREAM_API_KEY and a model, here pip install "pydantic-ai-slim[openai]" with OPENAI_API_KEY. Any Pydantic AI model works.
SpecStreamCapability gives the agent the specstream_search and specstream_extract tools and instructions for when to call each. A call the API refuses as bad input goes back to the model as a ModelRetry, so the model corrects it. Every other failure raises SpecStreamError.
| Argument | Default | What it does |
|---|---|---|
api_key |
SPECSTREAM_API_KEY |
The SpecStream API key |
search |
True |
Adds specstream_search (Search API) |
extract |
True |
Adds specstream_extract (Extract API) |
passages |
False |
Adds the text of the top pages to every search |
instructions |
built in | Your own guidance, or None for none |
base_url, client |
The API address and a shared httpx.AsyncClient |
|
id, description, defer_loading |
The standard capability fields. defer_loading=True needs an id |
It also loads from an agent spec:
# agent.yaml
model: openai:gpt-5
capabilities:
- SpecStreamCapability:
passages: true
from pydantic_ai import Agent
from pydantic_ai_specstream import SpecStreamCapability
agent = Agent.from_file('agent.yaml', custom_capability_types=[SpecStreamCapability])
Tools and toolset
| Function | What it gives the agent | Cost |
|---|---|---|
specstream_search_tool() |
A specstream_search tool: calls GET /v1/web-search and returns the answer, matching rows and ranked sources, with page passages when passages=True |
$5 per 1,000 searches of up to 10 results |
specstream_extract_tool() |
A specstream_extract tool: calls POST /v1/extract and returns the main text, title and published date of 1 to 20 web pages, PDF, Word or Excel files |
$0.80 per 1,000 pages (pages with no text are free) |
specstream_toolset() |
A FunctionToolset with both tools, for Agent(toolsets=[...]) |
Each function takes api_key (default: the SPECSTREAM_API_KEY environment variable), base_url and a shared httpx.AsyncClient as client. A failed call raises SpecStreamError with the API message.
MIT licensed.
Metadata
Release files for pydantic-ai-specstream 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pydantic_ai_specstream-0.2.1.tar.gz | 8.3 kB | With provenance | Details for pydantic_ai_specstream-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydantic_ai_specstream-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for pydantic_ai_specstream-0.2.1-py3-none-any.whl |
Total release size: 15.6 kB
Release files / pydantic_ai_specstream-0.2.1.tar.gz
| Download URL | pydantic_ai_specstream-0.2.1.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71f0312ac09013685948e3c7429d3f7f0583cdbf2986cf7519aece4ac1424f7f
|
|
BLAKE2b-256 checksum How to use checksums |
ee5bc5430b26fc8609746f5b16a0d25289017c9a04753a463ea6f6b939ccb382
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logRelease files / pydantic_ai_specstream-0.2.1-py3-none-any.whl
| Download URL | pydantic_ai_specstream-0.2.1-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd3b093f6dd8eb7235357802b37c919c041d0b86eef56ef0b3340d8d53816558
|
|
BLAKE2b-256 checksum How to use checksums |
eab8b0dec54be16d958df5c4c7a4ebccd7c08b05702288df1b3876cffa90d9e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logSecurity for pydantic-ai-specstream 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pydantic_ai_specstream-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.