One HTTP Endpoint, 37 APIs: Building a Permissionless Gateway for AI Agents
This is part of a series on building httpay.xyz — a pay-per-call API infrastructure for autonomous AI agents.
The Problem: API Access Doesn't Scale for Agents
When you're building an AI agent that needs to fetch data, there's an ugly truth nobody talks about:
Every API requires a human to set it up.
Want your agent to check GitHub repos? Create an account, generate a personal access token, manage scopes, handle rate limits. Weather data? Register with NWS. Wikipedia summaries? Fine, that one's free — but what about HuggingFace, Stripe, Discord, Slack, Notion...?
Each integration is a tax on your time. For a human developer building one product, it's annoying. For an autonomous agent that might need 10 different APIs in a single task, it's a fundamental bottleneck.
The agent can't sign up for an account. It can't pass a CAPTCHA. It can't enter a credit card number. It just... can't.
So you end up manually pre-provisioning credentials for every service your agent might ever need, hoping you guessed right. It doesn't scale.
The Solution: One Endpoint to Rule Them All
We built httpay.xyz/api/gateway — a universal x402-powered proxy that gives agents instant, permissionless access to 37 APIs (5,800+ endpoints) through a single URL pattern:
ANY https://httpay.xyz/api/gateway/{service}/{path}
The agent pays $0.001 USDC per request (some services cost $0.002–$0.005 for more expensive upstreams). No accounts. No API key setup. No signup. Just send USDC and get data.
Here's what it covers right now:
| Category | Services |
|---|---|
| Developer Tools | GitHub (1,080 endpoints), Cloudflare (2,591), GitLab (72), Vercel (231), Postman |
| Communication | Discord (227), Slack (174), Twilio |
| AI/ML | OpenAI, HuggingFace (203), OpenRouter |
| Cloud/Infra | DigitalOcean (545), Fly.io, Render |
| DevOps | CircleCI, PagerDuty (390), Sentry (212), Datadog |
| Payments | Stripe |
| Productivity | Notion, Asana, Jira |
| Media | Spotify |
| Database | Supabase, Turso, Neon |
| Blockchain RPCs | Ethereum (3 providers), Base, Optimism, Arbitrum, Polygon |
| Data | Wikipedia, US Weather (NWS) |
| Resend | |
| Demo | Swagger Petstore |
Try It Right Now (Free Demo Mode)
For public APIs like Wikipedia and US Weather, we have a demo mode — 10 free calls per IP per hour. Just add ?demo=true:
# Discover all available services
curl https://httpay.xyz/api/gateway
# Wikipedia summary — free demo
curl "https://httpay.xyz/api/gateway/wikipedia/page/summary/Bitcoin?demo=true"
# US Weather for Denver, CO — free demo
curl "https://httpay.xyz/api/gateway/weather/points/39.7456,-104.9994?demo=true"
# Ethereum latest block number — free demo
curl "https://httpay.xyz/api/gateway/eth-base?demo=true" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
The /api/gateway discovery endpoint returns the full service catalogue with pricing, auth requirements, and endpoint counts.
How It Works: x402 Protocol
The payment layer is x402 — an open standard that uses HTTP 402 (Payment Required) to enable machine-to-machine micropayments.
Here's the flow:
-
Agent sends a request to
httpay.xyz/api/gateway/github/users/octocat -
Server responds with HTTP 402, including a
X-Payment-Requiredheader specifying the amount ($0.001 USDC) and the receiving address on Base -
Agent constructs a payment, signs a USDC transfer on Base, and sends it in the
X-Paymentheader -
Server verifies the payment, proxies the request to
api.github.com/users/octocat, and returns the response
The agent never needs a GitHub account. It just needs USDC on Base.
# With x402 client (payment auto-handled):
x402-fetch "https://httpay.xyz/api/gateway/github/users/octocat" \
--wallet $PRIVATE_KEY
# Or manually if you understand the protocol:
curl "https://httpay.xyz/api/gateway/github/users/octocat" \
-H "X-Payment: $SIGNED_PAYMENT_HEADER"
For human developers testing the gateway, you can also use demo mode or pre-purchase credits.
For APIs That Require Auth: X-Upstream-Token
Some APIs (GitHub, Slack, OpenAI, etc.) require their own API keys for authenticated operations. For these, pass your upstream key in the X-Upstream-Token header — the gateway forwards it as the appropriate auth header for that service:
# GitHub API with your token (rate limits: authenticated vs. unauthenticated)
curl "https://httpay.xyz/api/gateway/github/user/repos?demo=true" \
-H "X-Upstream-Token: ghp_your_github_token"
# OpenAI — your OpenAI key, gateway handles the routing
curl "https://httpay.xyz/api/gateway/openai/v1/models?demo=true" \
-H "X-Upstream-Token: sk-your-openai-key"
# HuggingFace model info
curl "https://httpay.xyz/api/gateway/huggingface/api/models/bert-base-uncased?demo=true" \
-H "X-Upstream-Token: hf_your_token"
No API key? For public endpoints (Wikipedia, weather, blockchain RPCs, public GitHub repos), no token needed at all.
Why This Architecture Matters for Agents
The standard API access model was designed for humans. You fill out a form, get a key, store it in .env. The underlying assumption is that there's a human in the loop at setup time.
AI agents break this assumption. They're:
- Ephemeral — spun up and torn down dynamically, no persistent env
- Untrusted — can't go through human-only verification flows
- Multi-service — a single task may need GitHub + Wikipedia + weather + blockchain in one session
- Economically sovereign — they have wallets, they can pay directly
The permissionless gateway flips the model: instead of identity-based access (who are you?), it's payment-based access (can you pay $0.001?). Anyone with USDC on Base can use any of the 37 services, instantly, with no setup.
This is how APIs should work for the agentic era.
Agent Integration Example
Here's what a minimal agent workflow looks like using the gateway:
import httpx
from x402.client import X402Client # or use any x402-compatible client
# Initialize with wallet private key (Base mainnet)
client = X402Client(private_key=os.environ["AGENT_PRIVATE_KEY"])
async def agent_research(topic: str):
# Get Wikipedia summary — costs $0.001 USDC
wiki = await client.get(
f"https://httpay.xyz/api/gateway/wikipedia/page/summary/{topic}"
)
# Check weather for a location — costs $0.001 USDC
weather = await client.get(
"https://httpay.xyz/api/gateway/weather/points/39.7456,-104.9994"
)
# Query Ethereum block number — costs $0.001 USDC
block = await client.post(
"https://httpay.xyz/api/gateway/eth-base",
json={"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}
)
return {
"summary": wiki.json()["extract"],
"weather": weather.json(),
"eth_block": block.json()["result"]
}
Total cost for that 3-API workflow: $0.003 USDC. No human setup required.
MCP Server for AI Coding Assistants
If you're building agents with Claude, GPT-4, or any MCP-compatible AI assistant, there's also an MCP server:
npm install -g @httpay/mcp
This exposes the gateway as MCP tools, so your coding agent can call Wikipedia, weather, blockchain RPCs, etc. through the standard MCP protocol.
See the full httpay ecosystem at httpay.xyz.
What's Next
The gateway is live and open. Current roadmap:
- Streaming support — for APIs that return event streams (OpenAI, etc.)
- Batch requests — multiple API calls in one x402 payment
- More services — Twilio, more RPC providers, domain-specific APIs
- Agent-optimized routing — smart load balancing across multiple providers for the same upstream
If you're building AI agents that need API access, try the gateway. You don't need an account. Just USDC on Base.
Links:
- Gateway discovery: httpay.xyz/api/gateway
- MCP server: @httpay/mcp
- Main site: httpay.xyz
Previous articles in this series:
- How to Build Pay-Per-Call APIs with x402 and USDC on Base
- Building an MCP Server for Pay-Per-Call APIs with x402
- How to Make Your API AI-Discoverable with llms.txt and OpenAPI
- I Built 186 AI Agent APIs in a Weekend: Here's What I Learned About x402 Micro-Payments
- Agents Need Permissionless Infrastructure — So We Built It
Top comments (0)