# x711 — Universal AI Agent Gas Station # Terraform module for registering an agent and injecting credentials # Homepage: https://x711.io | Docs: https://x711.io/docs # 29 tools: web search, prices, tx simulation, Hive memory, hallucination pills terraform { required_providers { null = { source = "hashicorp/null" } local = { source = "hashicorp/local" } } } variable "x711_agent_name" { description = "Name for this agent in the x711 registry" type = string default = "terraform-agent" } variable "x711_owner_email" { description = "Owner email for low-balance alerts" type = string default = "" sensitive = true } variable "x711_framework" { description = "Framework identifier (terraform, kubernetes, ansible, pulumi)" type = string default = "terraform" } # Register agent with x711 and capture API key resource "null_resource" "x711_onboard" { triggers = { agent_name = var.x711_agent_name } provisioner "local-exec" { command = < /tmp/x711_credentials.json cat /tmp/x711_credentials.json | python3 -c " import sys, json d = json.load(sys.stdin) print('x711 agent registered:') print(' agent_id:', d.get('agent_id','')) print(' fund_page:', 'https://x711.io/fund/' + d.get('agent_id','')) print(' free_calls_per_day:', d.get('free_calls_per_day', 10)) " EOT } } data "local_file" "x711_credentials" { depends_on = [null_resource.x711_onboard] filename = "/tmp/x711_credentials.json" } locals { x711 = jsondecode(data.local_file.x711_credentials.content) } output "x711_agent_id" { description = "Your x711 agent ID" value = local.x711.agent_id sensitive = true } output "x711_api_key" { description = "Your x711 API key — inject into agent environment" value = local.x711.api_key sensitive = true } output "x711_fund_page" { description = "Fund your agent with USDC at this URL" value = "https://x711.io/fund/${local.x711.agent_id}" } output "x711_refuel_endpoint" { description = "Tool call endpoint — POST with X-API-Key header" value = "https://x711.io/api/refuel" } # Usage in your agent: # # export X711_API_KEY=$(terraform output -raw x711_api_key) # # curl -X POST https://x711.io/api/refuel \ # -H "X-API-Key: $X711_API_KEY" \ # -H "Content-Type: application/json" \ # -d '{"tool":"web_search","query":"latest AI agent news"}' # # curl -X POST https://x711.io/api/refuel \ # -H "X-API-Key: $X711_API_KEY" \ # -d '{"tool":"price_feed","query":"ETH,BTC,SOL"}' # # curl -X POST https://x711.io/api/pill \ # -d '{"claim":"USDC on Base is 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","chain":"base"}' # # All 29 tools: https://x711.io/api/tools # MCP endpoint: https://x711.io/mcp