Skip to main content
Glama

azeth_pay

Pay for x402-gated HTTP services by automatically handling 402 payment responses. Supports smart accounts, on-chain agreements, and direct settlements to access paid APIs.

Instructions

Pay for an x402-gated HTTP service. Makes the request, handles 402 payment automatically, and returns the response.

Use this when: You need to access a paid API or service that uses the x402 payment protocol (HTTP 402). The tool automatically detects if you have an active payment agreement (subscription) with the service. If an agreement exists, access is granted without additional payment. Otherwise, a fresh USDC payment is signed.

Returns: Whether payment was made, the payment method used ("smart-account" for a fresh smart-account settlement, "agreement" for access granted by an active on-chain payment agreement, "session" for SIWx reuse of a prior payment session (older servers may also report agreement-granted access as "session"), "x402" for a direct EOA settlement, or "none"), the HTTP status, and the response body.

Note: Requires USDC balance to pay (unless an agreement grants access). Set maxAmount to cap spending. Only HTTPS URLs to public endpoints are accepted. The payer account is determined by the AZETH_PRIVATE_KEY environment variable.

Example: { "url": "https://api.example.com/data" } or { "url": "https://api.example.com/data", "maxAmount": "1.00" }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe HTTPS URL of the x402-gated service to access. Must be a public endpoint.
bodyNoRequest body for POST/PUT/PATCH requests (JSON string, max 100KB).
chainNoTarget chain. Defaults to AZETH_CHAIN env var or "baseSepolia". Accepts "base", "baseSepolia", "ethereumSepolia", "ethereum" (and aliases like "base-sepolia", "eth-sepolia", "sepolia", "eth", "mainnet").
methodNoHTTP method. Defaults to "GET".
maxAmountNoMaximum USDC amount willing to pay (e.g., "5.00"). Rejects if service costs more.
smartAccountNoSmart account to pay from. Use "#1", "#2", etc. (index from azeth_accounts) or a full address. Defaults to your first smart account.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully discloses behavioral traits: auto-handles 402, checks agreements, signs USDC, requires balance, uses maxAmount cap, only HTTPS, payer from AZETH_PRIVATE_KEY. It also details return values and payment methods.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Approximately 150 words, well-paragraphed. Front-loads purpose, then usage, behavior, notes, example. Every sentence adds value. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 params, no output schema), the description is thorough: covers payment flow, return values, env vars, chain defaults, smart account selection, and examples. Could mention error handling but overall complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, baseline 3. The description adds meaningful context: examples, explanation of maxAmount as a cap, default chain, smart account indexing, and body usage for POST etc. This goes beyond the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool pays for x402-gated HTTP services, handles 402 automatically, and returns the response. The verb 'pay' and resource 'x402-gated HTTP service' are specific and distinguish it from siblings like azeth_smart_pay or azeth_create_payment_agreement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly says 'Use this when: You need to access a paid API or service that uses the x402 payment protocol'. This provides clear context for when to use. It does not list alternatives, but the specificity is sufficient. No exclusions are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/azeth-protocol/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server