Skip to main content

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:

  1. 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).
  2. 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.
  3. 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 to use within 30 days 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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydantic-ai-specstream 0.2.0
File Size Uploaded Provenance Actions
pydantic_ai_specstream-0.2.0.tar.gz 8.3 kB With provenance Details for pydantic_ai_specstream-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-ai-specstream 0.2.0
File Interpreter ABI Platform Actions
pydantic_ai_specstream-0.2.0-py3-none-any.whl Python 3 none any Details for pydantic_ai_specstream-0.2.0-py3-none-any.whl

Total release size: 15.6 kB

Release files / pydantic_ai_specstream-0.2.0.tar.gz

Download URL pydantic_ai_specstream-0.2.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
49703860d0dd7a5a8c069cddcd02ca8362436c920a922e24db708347273a5f0b
BLAKE2b-256 checksum
How to use checksums
056b2a5d5081fec13ff2bddf0d139fa1a4cdce76f9b59b6eed393ba075c16307
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 9, 2026.

Transparency log

Release files / pydantic_ai_specstream-0.2.0-py3-none-any.whl

Download URL pydantic_ai_specstream-0.2.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb85ec54b12932545fa5383cab16420a3c7819e04579868bcfd46ca3e0fb195c
BLAKE2b-256 checksum
How to use checksums
50ceff080256d61dc5e051f15dcc7dda2c308f0273bfa1ef5782b6bfd12957a9
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 9, 2026.

Transparency log

Security for pydantic-ai-specstream 0.2.0

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.

Select from 2 files

Attestation for pydantic_ai_specstream-0.2.0.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 9, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page