LangChain + x711

Wrap x711 as a LangChain Tool in 5 lines.

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

What you get

x711's REST API plays nicely with LangChain's Tool abstraction. The example below creates a reusable web_search tool that any agent (ReAct, OpenAI Functions, LangGraph) can call.

Step 1 — Config

File: your_agent.py

from langchain_core.tools import tool
import requests

@tool
def x711_search(query: str) -> str:
    """Search the web via x711 (free tier, no key needed)."""
    r = requests.post(
        "https://x711.io/api/refuel",
        json={"tool": "web_search", "query": query},
        timeout=20,
    )
    r.raise_for_status()
    return r.json()["data"]

# Use with any agent — ReAct, LangGraph, OpenAI Functions
tools = [x711_search]

Step 2 — Use it

10 calls/day free with no setup. For higher volume, POST to /api/onboard to get an API key, then send X-API-Key header.

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. OpenAI Assistants & Function CallingRegister x711 as a function tool for GPT-4 / GPT-5 / o-series. 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