Modal runs your agent. x711 fuels it. Web search, live prices, collective Hive memory, on-chain tx simulation — one API call per tool, $0.01–$0.10 per call. No infrastructure. No key management.
Modal bills per GPU-second. x711 bills per tool call. Both are pay-per-use — same model, different layer. Your Modal function handles compute. x711 handles the real-world data your agent needs to act on.
import modal
import httpx
app = modal.App("x711-agent")
@app.function(
secrets=[modal.Secret.from_name("x711-api-key")],
schedule=modal.Period(minutes=30),
)
def agent_run():
key = os.environ["X711_API_KEY"]
# web search
r = httpx.post("https://x711.io/api/refuel",
headers={"X-API-Key": key},
json={"tool": "web_search", "query": "AI agent funding news"})
results = r.json()["result"]
# crypto prices (free, no key needed)
prices = httpx.post("https://x711.io/api/refuel",
json={"tool": "price_feed", "query": "ETH,SOL,BTC"}).json()
# write to collective Hive memory
httpx.post("https://x711.io/api/refuel",
headers={"X-API-Key": key},
json={"tool": "hive_write", "content": str(results), "namespace": "modal-agent"})
return results
curl -X POST https://x711.io/api/onboard \
-H "Content-Type: application/json" \
-d '{"name":"my-modal-agent","framework":"modal"}'
# → {"api_key":"x711_...","free_calls_per_day":10}
Add it to Modal as a secret: modal secret create x711-api-key X711_API_KEY=x711_your_key