Skip to main content

openai-agents-agentsearch

Function tools for the OpenAI Agents SDK backed by AgentSearch: live web search for agents. Free search needs no API key.

Tool Cost
agentsearch_search Free (25 searches/day per user, up to 5 results, no key). Paid and unlimited if a wallet is set.
agentsearch_extract $0.005/call (USDC on Base via x402)
agentsearch_render $0.005/call (headless browser for JS pages)

Install

pip install -U openai-agents-agentsearch

Quickstart

from agents import Agent, Runner
from openai_agents_agentsearch import agentsearch_search, agentsearch_tools

agent = Agent(
    name="Researcher",
    instructions="Answer with current facts. Cite URLs.",
    tools=[agentsearch_search],          # or agentsearch_tools() for search + extract + render
)
result = Runner.run_sync(agent, "What changed in the latest OpenAI Agents SDK release?")
print(result.final_output)

Paid mode

Install the paid extra (pip install "openai-agents-agentsearch[paid]") and set AGENTSEARCH_WALLET_PRIVATE_KEY to the private key of a new wallet made only for this, funded with a little USDC on Base (e.g. $1; no ETH needed). Each call costs $0.005 and is paid over x402 through the Pocket Network Agentic Portal using the official x402 Python SDK. With a key set, search also goes paid and unlimited.

Env var Default
AGENTSEARCH_MAX_TOTAL_ATOMIC 1000000 ($1.00 per process)
AGENTSEARCH_MAX_PER_CALL_ATOMIC 5000 ($0.005; can only be lowered)
AGENTSEARCH_TIMEOUT_MS 30000

Limits are checked before anything is signed. The key is never logged or returned. Paid results include a payment object.

Errors

Tools return "Error: ..." strings instead of raising. A 429 from the free relay means the daily limit (25 searches/day per user) was hit, and the message explains how to upgrade.

Development

pip install -e ".[test]" && pytest     # unit tests (mocked)
AGENTSEARCH_LIVE=1 pytest -k live       # one real free search

Docs: https://agentsearchhq.com/agents.md?utm_source=openai-agents-agentsearch&utm_medium=package

MIT

Metadata

Release files for openai-agents-agentsearch 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 openai-agents-agentsearch 0.2.0
File Size Uploaded
openai_agents_agentsearch-0.2.0.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openai-agents-agentsearch 0.2.0
File Interpreter ABI Platform
openai_agents_agentsearch-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.5 kB

Release files / openai_agents_agentsearch-0.2.0.tar.gz

Download URL openai_agents_agentsearch-0.2.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dcb8f90b34957d46e317746a62d733d31b036dcdb875ec05362a8a9b567793d4
BLAKE2b-256 checksum
How to use checksums
a5be424c214526fe7ff18d67f68758f213cdebbf26de366def22557404b45356
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

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

Download URL openai_agents_agentsearch-0.2.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5cefe1a76af73f837792313d1ffe572f12b3ef2ed393ab360983b231c06d7e96
BLAKE2b-256 checksum
How to use checksums
ada0fd8f8c0c25d82549dbf3811228d2634f72c3e5c256473745344aad064ebc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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