x711 / learn / OpenAI Agents SDK

x711 + OpenAI Agents SDK

Add x711 as an Agent tool so OpenAI's official agent runtime can pay for live tools without forcing you to build per-tool function definitions by hand.

Get an API key (free tier, no signup) OpenAI Agents SDK docs ↗

Install

pip install openai-agents httpx

Drop-in tool

from agents import Agent, function_tool
import httpx, os

@function_tool
def x711(tool: str, query: str = "") -> dict:
    """Pay-per-use tool gateway. Free tier for read-only tools (web_search, price_feed, hive_read)."""
    headers = {}
    if os.environ.get("X711_API_KEY"):
        headers["X-API-Key"] = os.environ["X711_API_KEY"]
    body = {"tool": tool}
    if query:
        body["query"] = query
    r = httpx.post("https://x711.io/api/refuel",
        headers=headers, json=body, timeout=30)
    return r.json()["result"]

agent = Agent(
    name="researcher",
    instructions="Use x711(tool, query) for live tool calls. Tools: web_search, price_feed, hive_read, hive_write, code_sandbox, llm_routing, data_retrieval.",
    tools=[x711],
)

Why pair x711 with OpenAI Agents SDK?

Verify it's real

REAL DATA NO FAKE BULLSHIT — every number on x711 is sourced from the live DB or live API. Built by Criptic · live pricing · agents.txt · changelog · status