Quickstart
Get from zero to a working x402 agent call in about five minutes. By the end you will have a funded agent wallet, an enabled service, and a verified paid API response.
Create a Gordon account and buyer profile.
Add an agent — Gordon provisions its wallet and shows the scoped key once.
Deposit USDC on Base to the agent's wallet.
Curated services are pre-enabled — set spend caps or disable any you don't want.
Use the MCP tool or SDK to make your first paid request.
Register
Go to withgordon.ai and create an account. After email verification, Gordon creates your buyer profile. Wallets in Gordon are per agent — you provision and fund a wallet for each agent you create (next step), not at the account level.
No credit card is required at signup. Each agent gets a CDP-managed custody wallet on Base (Coinbase Developer Platform); you fund it with USDC through Coinbase Onramp in the dashboard or by sending USDC directly from any Base-compatible wallet or exchange. Gordon signs x402 authorizations on the agent's behalf but never holds your private keys.
faucet.circle.com), and those calls do not move real funds.Create an agent
Go to Account → Agents → New agent. Give it a name (e.g. "research-bot") and click Create. Gordon provisions a CDP custody wallet on Base for the agent and auto-enrolls it into the curated service catalog at permissive defaults — so the agent is ready to call services as soon as its wallet is funded.
Gordon generates a key pair for the agent. Copy both halves — the secret is shown only once:
# Public key (safe to log)
gak_pub_abc123...
# Secret key (treat like a password — never log or commit)
gak_sec_xyz789...
# Combined — pass this as GORDON_AGENT_KEY
gak_pub_abc123...:gak_sec_xyz789...The agent key is scoped to a single agent. If you compromise a key, rotate it in the dashboard — existing calls in flight will fail within 60 seconds as the cache expires.
Fund your wallet
Open your agent (Account → Agents → [your agent]) and click Fund. Gordon shows the agent's Base wallet address (and a Buy-with-Coinbase option); send USDC from any Base-compatible wallet or exchange.
Gordon uses micro-units internally: 1,000,000 units = $1.00 USD. For most catalog services, individual calls cost between 100 and 5,000 units ($0.0001 – $0.005). A $5 deposit provides thousands of API calls.
| USD | Units | Approx. calls @ 1,000 units/call |
|---|---|---|
| $1.00 | 1,000,000 | 1,000 |
| $5.00 | 5,000,000 | 5,000 |
| $10.00 | 10,000,000 | 10,000 |
| $50.00 | 50,000,000 | 50,000 |
Deposits confirm on Base in about 2 seconds. The balance is available immediately after on-chain confirmation.
Review & limit services
New agents are auto-enrolled into the curated catalog at permissive limits, so your agent can call those services as soon as its wallet is funded — no manual enabling required to get started.
Go to Account → Agents → [your agent] → Services to tighten this. Set a per-call cap, restrict operations, or disable any service you don't want the agent to reach. Enforcement is fail-closed: a service that isn't in the agent's enabled set is blocked (service_not_enabled), so a compromised key can't spend on services you've disabled.
When a service is enabled, all its operations are allowed by default (enabled_operations: null). Restrict to specific operations from the service settings panel.
| Service | Slug | Typical price | What it does |
|---|---|---|---|
| Exa | exa | ~1,000 units/call | AI-powered web search |
| Zlurp | zlurp | 5,000 units/scrape | URL scraping to clean markdown |
| CoinGecko | coingecko | Varies by operation | Crypto market and token data |
Your first paid call
With an agent key and a funded wallet, you can make your first call two ways: via the MCP server in your IDE, or via the TypeScript SDK directly.
Option A: Platform API (curl)
# 1. List catalog services (public — no auth required)
curl https://api.withgordon.ai/services
# 2. Authorize a payment for an Exa search (agent key required)
curl -X POST https://api.withgordon.ai/x402/authorize \
-H "Authorization: Bearer gak_pub_...:gak_sec_..." \
-H "Content-Type: application/json" \
-d '{
"idempotency_key": "req_001",
"service_id": "exa",
"operation_id": "search.web",
"payment_requirement": { ... },
"max_payment_units": 50000
}'Option B: TypeScript SDK
npm install @withgordon/coreimport { Gordon } from "@withgordon/core";
const gordon = new Gordon({
platformUrl: "https://api.withgordon.ai",
agentApiKey: process.env.GORDON_AGENT_API_KEY!,
agentApiSecret: process.env.GORDON_AGENT_API_SECRET!,
});
// Drop-in replacement for fetch — handles the 402 → authorize → retry → confirm
// cycle. Pass serviceId + operationId so Gordon enforces the agent's service policy.
const { response, receipt } = await gordon.fetch("https://api.exa.ai/search", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ query: "x402 protocol agentic payments", numResults: 5 }),
serviceId: "exa",
operationId: "search.web",
maxPaymentUnits: 5000, // $0.005 cap; 1,000,000 units = $1.00
});
const data = await response.json();
console.log(data);
if (receipt?.confirmed) {
console.log("Paid", receipt.amount_units, "units · settlement", receipt.settlement_id);
}Receipt shape
{
"settlement_id": "stl_abc123",
"transaction_id": "txn_xyz789",
"amount_units": 1000,
"network": "base",
"pay_to": "0x6d6E695b09861467c7d462f5AAF31cF3540B9192",
"confirmed": true
}receipt is null and the original Response is returned unchanged. receipt.confirmed === truemeans the provider returned payment proof and Gordon accepted the settlement. If a provider returns 2xx but settlement can't be confirmed, gordon.fetch() throws GordonPaymentError (unless you set allowUnconfirmed) — you won't silently receive data without knowing payment status.MCP quickstart
If you prefer to work through your IDE rather than code, configure the Gordon MCP server in your client and ask it to call a service:
// .cursor/mcp.json or claude_desktop_config.json
{
"mcpServers": {
"gordon": {
"url": "https://api.withgordon.ai/mcp",
"headers": {
"Authorization": "Bearer gak_pub_...:gak_sec_..."
}
}
}
}Then type a prompt in your IDE:
Search the web for recent papers about agentic payments using Exa and summarize the top 3.The model will automatically call gordon_call_service with service_id: "exa". Gordon handles authorization, payment, and receipt — the model just gets the search results back.
See the MCP install page for client-specific setup instructions (Cursor, Claude Desktop, VS Code, Codex, Windsurf).
SDK quickstart
Install the Gordon TypeScript SDK:
npm install @withgordon/core
# or
yarn add @withgordon/coreCatalog services vs arbitrary x402 endpoints
import { Gordon } from "@withgordon/core";
const gordon = new Gordon({
platformUrl: "https://api.withgordon.ai",
agentApiKey: process.env.GORDON_AGENT_API_KEY!,
agentApiSecret: process.env.GORDON_AGENT_API_SECRET!,
});
// Catalog service — pass serviceId + operationId so Gordon enforces
// the agent's service enablement + spend policy:
const { response } = await gordon.fetch("https://api.exa.ai/search", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ query: "agentic web search", numResults: 3 }),
serviceId: "exa",
operationId: "search.web",
maxPaymentUnits: 5000,
});
// Arbitrary x402 endpoint — omit serviceId/operationId. The call is still
// authorized + signed and capped by maxPaymentUnits, but there's no
// per-service policy to enforce:
const { response: raw } = await gordon.fetch("https://api.example.com/data", {
method: "GET",
maxPaymentUnits: 10_000,
});serviceId and operationId, Gordon enforces the agent's per-service enablement and spend policy. Omit them only for unlisted x402 endpoints that aren't in the catalog — those calls are still authorized and capped by maxPaymentUnits, but there's no per-service policy to apply.What's next
Client-specific setup for Cursor, Claude Desktop, VS Code, Codex, and Windsurf.
Full endpoint docs with request/response schemas and authentication details.
Complete error code table with resolution steps for every Gordon error.
Explore all available catalog services and their operations and pricing.