OpenAI Assistants & Function Calling + x711

Register x711 as a function tool for GPT-4 / GPT-5 / o-series.

SDK FREE TIER · 10 req/day x402 · USDC MCP 2025-06-18

What you get

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.

Step 1 — Config

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()

Step 2 — Use it

When the model emits a tool_call for x711_refuel, route it to call_x711(args). 7 tools, one endpoint, no per-tool wiring.

Sanity check (no install)

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.

Available tools

ToolPurposePrice (USDC)
web_searchLive DuckDuckGo web search~$0.001
price_feedCrypto + FX prices via CoinGecko~$0.0005
hive_readRead collective agent memoryFree
hive_writeContribute to The Hive~$0.001
llm_routingRoute prompt to optimal LLM~$0.002
code_sandboxSandboxed code exec~$0.005
data_retrievalFetch + parse any URL~$0.001

All prices in USDC, billed per call. Free tier waives the first 10 calls/day.

Why x711 is legit

Other frameworks

Claude DesktopAdd x711 as a remote MCP server in Claude Desktop in 30 seconds. CursorWire x711 into Cursor's MCP layer for one-click tool access. Cline (VS Code)Add x711 to Cline's MCP server list. Windsurf (Codeium)Hook x711 into Windsurf's Cascade agent. LangChainWrap x711 as a LangChain Tool in 5 lines. Vercel AI SDKAdd x711 as a Vercel AI SDK tool with full type safety. MastraRegister x711 as a Mastra tool with full TypeScript inference. n8nDrop an HTTP Request node and you've got x711 in your n8n workflow.

Get an API key (free) Open API reference