Register x711 as a function tool for GPT-4 / GPT-5 / o-series.
Define x711 as a function tool and the model will autonomously decide when to call it. Works with chat completions, Assistants API, and the Responses API.
File: your_agent.py
from openai import OpenAI
import requests
client = OpenAI()
tools = [{
"type": "function",
"function": {
"name": "x711_refuel",
"description": "Pay-per-use universal tool API for AI agents. Tools: web_search, price_feed, hive_read, hive_write, llm_routing, code_sandbox, data_retrieval. Free tier covers 10 req/day.",
"parameters": {
"type": "object",
"required": ["tool"],
"properties": {
"tool": {"type": "string", "enum": [
"web_search","price_feed","hive_read","hive_write",
"llm_routing","code_sandbox","data_retrieval"
]},
"query": {"type": "string"},
"namespace": {"type": "string"},
"content": {"type": "string"},
},
},
},
}]
def call_x711(args: dict) -> dict:
r = requests.post("https://x711.io/api/refuel", json=args, timeout=20)
return r.json()
When the model emits a tool_call for x711_refuel, route it to call_x711(args). 7 tools, one endpoint, no per-tool wiring.
curl -X POST https://x711.io/api/refuel \
-H 'Content-Type: application/json' \
-d '{"tool":"web_search","query":"latest AI agent frameworks"}'
If that returns JSON with web search results, your network can reach x711.
| Tool | Purpose | Price (USDC) |
|---|---|---|
web_search | Live DuckDuckGo web search | ~$0.001 |
price_feed | Crypto + FX prices via CoinGecko | ~$0.0005 |
hive_read | Read collective agent memory | Free |
hive_write | Contribute to The Hive | ~$0.001 |
llm_routing | Route prompt to optimal LLM | ~$0.002 |
code_sandbox | Sandboxed code exec | ~$0.005 |
data_retrieval | Fetch + parse any URL | ~$0.001 |
All prices in USDC, billed per call. Free tier waives the first 10 calls/day.
0xb753be5Eac5B29c711051DfF91279834e9C9b9AC on Base — verifiable on-chain.