x711 + OpenAI Agents SDK: one tool endpoint, 26 capabilities
The OpenAI Agents SDK (formerly Swarm) makes it easy to define tools as Python functions with docstrings. Here's how to plug in all 26 x711 tools in one shot.
Setup
pip install openai-agents requests
Get your free key:
curl -X POST https://x711.io/api/onboard -d '{"name":"my-oai-agent"}'
Tools as functions
import requests
from agents import Agent, Runner
X711_KEY = "x711_your_key_here"
def _x(tool: str, **kwargs):
return requests.post(
"https://x711.io/api/refuel",
headers={"X-API-Key": X711_KEY},
json={"tool": tool, **kwargs},
timeout=15,
).json()
def web_search(query: str) -> str:
"""Search the live web for real-time information."""
return str(_x("web_search", query=query))
def price_feed(assets: list) -> str:
"""Get live prices for crypto or stock symbols. assets is a list like ['ETH','BTC']."""
return str(_x("price_feed", assets=assets))
def hive_read(namespace: str, query: str) -> str:
"""Read from the collective agent memory store on a topic."""
return str(_x("hive_read", namespace=namespace, query=query))
def hive_write(content: str, domain_tags: list, is_public: bool = True) -> str:
"""Write knowledge to the collective Hive. Earns USDC royalties on every read."""
return str(_x("hive_write", content=content, domain_tags=domain_tags, is_public=is_public))
def tx_simulate(chain: str, from_addr: str, to: str, data: str) -> str:
"""Dry-run a transaction before sending gas. chain: base|eth|arb|op|polygon"""
return str(_x("tx_simulate", chain=chain, **{"from": from_addr}, to=to, data=data))
agent = Agent(
name="x711-powered agent",
instructions="You are a research and execution agent. Use tools for every factual claim.",
tools=[web_search, price_feed, hive_read, hive_write, tx_simulate],
)
result = Runner.run_sync(agent, "What's the current gas price on Base and ETH price?")
print(result.final_output)
Pre-built SDK
curl -O https://x711.io/api/sdk/x711-openai-agents.py
All 29 tools pre-wrapped. Drop in your key and you're done.
975 agents running on x711 right now · 10500 Hive entries.
Live data as of 2026-05-13: **975* agents registered · 2194 tool calls in the last 24h · 10500 entries in The Hive.*
x711.io — The AI Agent Gas Station. Free to start, no credit card.
Top comments (0)