autogen-x402-discovery
AutoGen tool for x402 service discovery — let your AutoGen agents find and call any paid API endpoint at runtime.
When your AutoGen agent needs web search, image generation, data enrichment, or any other external capability, it calls x402_discover to find the best available service from the live x402 discovery catalog.
Installation
pip install autogen-x402-discovery
Quick Start
import autogen
from autogen_x402_discovery import register_with_autogen
config_list = [{"model": "gpt-4o", "api_key": "your-key"}]
assistant = autogen.ConversableAgent(
"assistant",
llm_config={"config_list": config_list},
system_message="Use x402_discover to find paid API services when needed.",
)
# Register the discovery tool
register_with_autogen(assistant)
user_proxy = autogen.UserProxyAgent("user", human_input_mode="NEVER")
user_proxy.initiate_chat(assistant, message="Find a crypto price API under $0.01/call")
OpenAI Function Calling Schema
from autogen_x402_discovery import get_autogen_tool_schema, x402_discover
# Get the schema for use with any OpenAI-compatible API
schema = get_autogen_tool_schema()
# Call the function directly
result = x402_discover("web search", max_price_usd=0.10)
print(result)
Tool Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
query |
str |
required | Natural language description of the capability needed |
max_price_usd |
float |
0.50 |
Maximum acceptable price per call in USD |
How It Works
- Agent calls
x402_discover("web search") - Tool fetches the free catalog
- Services are filtered by
max_price_usdand matched by keyword - Results are ranked by uptime % and latency
- Returns endpoint URL, price, and a Python snippet
Links
License
MIT
Metadata
Release files for autogen-x402-discovery 1.0.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 | |
|---|---|---|---|
| autogen_x402_discovery-1.0.1.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autogen_x402_discovery-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 kB
Release files / autogen_x402_discovery-1.0.1.tar.gz
| Download URL | autogen_x402_discovery-1.0.1.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2523bbb239327f9571218bf8b79393688c3472ac1f29eec03e371cf33a8c4ced
|
|
BLAKE2b-256 checksum How to use checksums |
c3b8d035151d15314760c5398c8594d7cb99eaeb95e80b6571acdbfeaac011c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / autogen_x402_discovery-1.0.1-py3-none-any.whl
| Download URL | autogen_x402_discovery-1.0.1-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1529459a8d9a69e004c132ec9f88c20baf080b2cdf89016ed1d5023752d4d775
|
|
BLAKE2b-256 checksum How to use checksums |
c0672e28f71800077386ff7281574fa9fd80ccae368020479af37b2756d78adf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|