What is GlobalAPI?
GlobalAPI is a non-custodial API billing platform built on Base. It turns any HTTP endpoint into a paid product in about three minutes — with zero code changes to your upstream service.
If you've built an API and want to charge for it, GlobalAPI handles everything: authentication, per-request metering, USDC settlement, and revenue collection. Payment lands directly in a vault address that only you control — GlobalAPI never touches your funds.
How it works
GlobalAPI sits between callers and your real API as a smart proxy. On every request:
The caller sends a payment authorization alongside the HTTP request. GlobalAPI validates it before forwarding anything upstream.
GlobalAPI submits an on-chain transaction, crediting the developer's vault with USDC. Base blocks land in about two seconds, so this completes within the request lifecycle.
The caller receives your API's response. Your revenue sits in your vault, ready to sweep anytime. No invoicing. No waiting.
Key concepts
| concept | what it means |
|---|---|
proxy url | Your metered endpoint. Format: <your-globalapi-host>/{user}/{api} — share with callers. Run it locally while the Base Sepolia deployment is being stood up; a hosted domain is TBD. |
pda vault | A USDC vault on Base whose address is derived from your wallet address. Payments land there before the vault contract even exists — it is deployed on your first withdrawal. Only you can sweep it. |
upstream url | Your real API. GlobalAPI forwards requests here after payment is confirmed. Never exposed to callers. |
price / request | USDC amount a caller pays per proxied request. Set by you, stored on-chain, changeable anytime. |
withdraw() | The contract call that sweeps your vault revenue to your wallet, minus the platform fee. |
Quick Start
Zero to a paid API in under five minutes.
Open the app and connect a Base wallet (MetaMask, Coinbase Wallet, Rainbow) or sign in with email OTP. Signing up costs nothing on-chain: your vault address is derived from your wallet address, and the contract is only deployed when you first withdraw.
In the dashboard, click + new api. Enter a name (this becomes part of your proxy URL), the upstream URL GlobalAPI should forward to, and a per-request price in USDC. Set 0 for free-but-metered.
That's it. The dashboard shows your proxy URL: <your-host>/{username}/{api-name}. Callers pay on every request, you earn automatically. Revenue accrues in your vault — claim it from the dashboard's earnings card whenever you like.
A first-party SDK (JS, Python, Rust, Go) is planned for v0.2 so you can register and manage APIs from code. The snippet below previews the planned ergonomics — none of these packages resolve yet.
You need an EVM wallet and Base Sepolia USDC. See Wallet & USDC Setup for a step-by-step guide if you're new to Base.
GlobalAPI authenticates callers via the x402 payment protocol, not API keys. Your client signs a payment payload for each request; the proxy validates and settles it on Base before forwarding upstream. A first call without payment returns 402 Payment Required with the price tag.
The reference implementation lives at demo/call.mjs in the repo. Drop in your buyer wallet's private key and you're ready to call paid endpoints:
Register an API
Register any HTTP endpoint as a paid, metered API. No code changes to your upstream required.
Prerequisites
- ✓ A Base wallet (MetaMask, Coinbase Wallet, Rainbow) or email OTP account
- ✓ ~0.005 SOL for transaction fees and vault rent
- ✓ A publicly reachable HTTP endpoint (or tunneled via ngrok, cloudflare tunnel, etc.)
Via the dashboard
Connect your wallet or use email OTP. Registering your first API creates your vault on-chain automatically.
Enter a name (used in your proxy URL) and your upstream base URL. The name forms a permanent part of your proxy address — choose carefully.
Enter a USDC amount. Set 0 for a free but metered API — useful for analytics or gating before a paid launch.
Your endpoint is live at <your-host>/{username}/{api-name}. All sub-paths forward verbatim: /alice/weather/v1/now → upstream.url/v1/now.
Via the SDK roadmap
Pricing & Fees
You set the price. GlobalAPI takes a small platform fee at collection time. Everything else goes directly to your wallet.
Platform fee structure
| parameter | value | note |
|---|---|---|
platform_fee_bps | 1000 bps (10%) | Currently 1000 bps; lives in the on-chain global config and is adjustable via setFeeBps(). Deducted at collect time, not per-request. |
minimum_price | 0 USDC | Free APIs are supported — pure metering with no fee taken |
fee_destination | GlobalAPI platform vault | Split happens atomically in withdraw() on-chain |
payout_latency | ~2s | Base finality. Collect whenever you want. |
Changing your price
Price changes are instant — the next request is billed at the new rate. There is no migration, no notice period required.
Collecting Revenue
Your earnings accumulate in your Base vault. Sweep to your wallet at any time.
From the dashboard
Open the dashboard and find the earnings card. It shows your live vault balance; click claim to invoke withdraw() on-chain. The wallet you're signed in with signs the transaction; the platform fee (currently 10%) goes to GlobalAPI's vault and the remainder lands in your wallet's USDC associated token account — atomically, in one transaction.
From code
The dashboard's claim button is a thin wrapper around one contract call. For headless use, call withdraw() on the factory from any Base RPC — it deploys your vault if needed, sends the platform fee to the fee recipient and the remainder to you, in a single transaction. The reference implementation is at ui/lib/globalapi-contract.ts.
Planned SDK ergonomics roadmap
No minimum balance is required — collect after one request or a thousand.
Buyer Guide
Calling an GlobalAPI-proxied API is nearly identical to calling the upstream directly — point your client at the proxy URL and let an x402 helper sign each request from your Base wallet.
URL pattern
Everything after the API name is forwarded verbatim — query params, headers, body, and HTTP method all pass through unchanged.
With curl (no payment)
A bare curl hits the proxy but returns 402 Payment Required with a JSON price tag in the body. The buyer must satisfy x402 to receive the upstream response:
With an x402 client
Use an EVM-aware x402 client (e.g. @x402/fetch + @x402/evm) to sign payment payloads automatically. The full working example lives at demo/call.mjs.
Agent & script usage roadmap
Today, agents sign each x402 payment with an EVM private key — no wallet pop-up, no per-call human interaction (see demo/call.mjs). A session-level spend authorization is on the roadmap so an agent can declare an upper bound up front and avoid signing each payload individually:
Wallet & USDC Setup
GlobalAPI settles in USDC on Base. Here's how to get set up if you're new to the ecosystem.
Option A — Self-custody (recommended)
MetaMask (metamask.io) and Coinbase Wallet (coinbase.com/wallet) are wired into the dashboard today. Any wallet that exposes the Base wallet-adapter standard should work; support for more wallets is on the roadmap.
Buy SOL on Coinbase, Kraken, or Binance, then swap to USDC via Jupiter (jup.ag). Alternatively, bridge USDC from Ethereum using Wormhole or Circle's CCTP.
Open the dashboard, click sign in, choose your wallet, and approve the connection. The first time you register an API, a small on-chain transaction initializes your user account (vault + USDC ATA) — a one-time setup cost.
Option B — Email OTP
Sign in with an email address — no wallet required. GlobalAPI creates a wallet for you. Transfer USDC from an external wallet to fund it.
Installation roadmap
The GlobalAPI SDK is in design — JavaScript / TypeScript, Python, Rust, and Go are planned for v0.2 on a single release cadence. None of the package commands below resolve yet. They preview the planned ergonomics.
@x402/fetch — see demo/call.mjs) for buyer-side calls.
Requires Node 18+ or Bun 1+. Full TypeScript types included.
Requires Python 3.10+. Async-first via asyncio; sync wrappers available.
Async-native with Tokio. MSRV: Rust 1.75.
Requires Go 1.22+. Context-aware; all calls accept context.Context.
Provider SDK roadmap
For API providers — registering endpoints, managing pricing, and collecting revenue. Planned shape; not yet released.
Caller SDK roadmap
For API consumers — calling paid endpoints with automatic payment handling. Planned shape; today, use an x402 client directly (see demo/call.mjs).
Configuration roadmap
All SDK clients will share a common configuration interface. Preview only — these options are part of the v0.2 SDK design.
| option | type | description |
|---|---|---|
privateKey | string | EVM private key (0x-prefixed hex). Required for provider operations. Never expose in client-side code. |
apiKey | string | GlobalAPI API key (enig_live_… or enig_test_…). Required for caller operations. |
network | 'base-sepolia' | 'base' | Defaults to 'Base Sepolia'. Switch to 'mainnet' at launch. |
timeout | number (ms) | Request timeout applied to each proxied call. Default: 30000. |
retries | number | Retry count on upstream 5xx errors. Payment is refunded on retry. Default: 1. |
rpcUrl | string | Custom Base RPC endpoint. Defaults to GlobalAPI's managed RPC. |
Authentication
GlobalAPI has two distinct authentication models — one for callers (paying for proxy requests) and one for providers (managing their APIs).
Caller auth — x402 payment protocol
Proxied requests are gated by the x402 payment protocol, not API keys. The flow:
- 1. The first request returns
402 Payment Requiredwith a JSON price tag (network, recipient vault, amount in USDC). - 2. Your client signs a payment payload with your EVM private key and re-sends the request with a
PAYMENTheader. - 3. The GlobalAPI proxy validates the payment, settles it on Base, then forwards your request upstream. The settlement signature is returned in the
PAYMENT-RESPONSEheader.
In practice, you don't implement this by hand — use @x402/fetch with the SVM scheme, point it at a signer, and call the proxy URL like a normal fetch. See demo/call.mjs for a working 50-line example.
Provider auth — wallet signature or email OTP
Provider operations (registering APIs, updating prices, collecting revenue) authenticate via the dashboard:
| method | how it works |
|---|---|
| Base wallet | MetaMask or Coinbase Wallet — connect, sign the transaction, your wallet pubkey is your provider identity. |
| Email OTP | Sign in with email; the backend issues a wallet custodied during v0.1. Convert to a self-custodial wallet anytime. |
Future API-key auth roadmap
A first-party API key system (for headless dashboards, CI, scripts that prefer key-based auth over wallet signatures) is on the roadmap. The planned prefix scheme:
| prefix | environment | funds |
|---|---|---|
enig_live_ | Mainnet | Real USDC |
enig_test_ | Base Sepolia | Test tokens — no real value |
Endpoints
Base URL: your GlobalAPI deployment host (Base Sepolia: api.globalapi.live). The routes below are the surface area today — flat, no /v1 prefix.
Proxy (x402-priced)
Discovery
Provider management
user_name and the Base public key tied to the account.{ name, upstream, price_per_request, description?, category? }setFeeBps() / withdraw() instructions). There is no separate HTTP endpoint for them; the dashboard wraps the on-chain calls. Headless wrappers are part of the SDK roadmap.
Email OTP
{ email }{ email, otp }Planned roadmap
Trust Model
GlobalAPI is built on one principle: the platform should never be able to steal from its users.
How funds flow
When a caller pays for a request, USDC moves from their account directly into a vault address derived from the developer's wallet address. At no point does USDC pass through GlobalAPI's own wallet.
| entity | can drain developer vault? |
|---|---|
| GlobalAPI platform | no — no admin key exists |
| Other developers | no — vault seeded by your key only |
| API callers | no — can only pay in, never withdraw |
| You (the developer) | yes — only you can invoke withdraw() |
withdraw() directly via any Base RPC — no GlobalAPI infrastructure needed. The program is immutable once deployed.
Non-Custodial Design
Every dollar you earn sits in a vault whose address is derived from your wallet address. The math that generates this address ensures only you can authorize a withdrawal.
vault seed derivation
Verify your vault on-chain
Inspect your vault and its USDC balance at any time using any Base RPC or explorer:
The factory address is see contracts/deployments/base-sepolia.json (Base Sepolia). Source code is publicly auditable on GitHub.
FAQ
pricePerRequest: 0 for free-but-metered access. Register a separate API name for the paid version, or use the upcoming tiered pricing feature (Q3 roadmap) for rate-limited free + paid overages on one endpoint.demo/call.mjs). A session-level spend-cap helper (client.authorize()) is on the roadmap so agents can declare an upper bound once and avoid per-call signing.withdraw() directly via any Base RPC — no GlobalAPI servers required. The program is immutable once deployed, and your funds are always recoverable.