Skip to content

Make your first paid call.

API Acre uses x402 v2 exact USDC payments on Base or Solana. A compatible buyer reads the HTTP 402 challenge, selects one advertised network, signs one payment authorization, retries the request, and returns the result.

Review a $0.003 USDC checkoutSee the free result first

The preview is unpaid. Connecting a wallet or running a payment command is a separate, explicit step.

2 · Set a wallet

Use a separate low-value buyer wallet with USDC on Base. Coinbase Agentic Wallet uses email authentication and policy controls; AgentCash manages a separate local wallet; the SDK examples read EVM_PRIVATE_KEY locally. API Acre's EIP-3009 USDC payment is gasless for the buyer.

3 · Call

The x402 client handles the challenge and payment. Successful responses include settlement metadata.

Solana buyers

Each unpaid quote advertises separate Base and Solana mainnet options at the same exact USDC price. Choose one option with an x402 v2 SVM-capable client and authorize only its published Solana USDC mint, recipient, resource, and amount. The copy-ready wallet examples below are Base-specific and do not select Solana automatically.

Verify the payment handshake before funding.

The x402 Register independently probes API Acre each hour for valid HTTP 402 challenges, advertised-versus-live price, protocol version, latency, and cross-vantage consistency. Its listing is automatic and unpaid. These probes do not purchase endpoints or verify paid-result correctness; use the live report for its current observation.

Official Coinbase Agentic Wallet

Authenticate and fund the Agentic Wallet separately, then review this exact request. Running x402 pay may pay automatically, so --max-amount is fixed to the listed price in six-decimal USDC atomic units. npx --yes approves package installation; copying the command does nothing.

Raw shell example · Coinbase pay-for-service documentation

# Official Coinbase Agentic Wallet CLI. Authenticate separately before running.
# npx --yes approves package installation. Running this command may pay at most 25,000
# atomic USDC units ($0.025) after the CLI applies its configured spending controls.
npx --yes awal@latest x402 pay https://apiacre.com/v1/data/schema \
  -X POST \
  -d '{"content":"[{\"name\":\"Ada\",\"score\":98}]","format":"json","root_mode":"records"}' \
  --max-amount 25000 \
  --json

Alternative: AgentCash

AgentCash is an optional third-party x402 buyer. Its check command inspects the route without paying. Running fetch may then pay automatically, so the example fixes --max-amount to the exact listed price. The preceding npx --yes approves package installation; copying either command does nothing. Review current wallet storage and approval policy before onboarding or funding it.

Raw shell example · AgentCash CLI documentation · AgentCash wallet documentation

# Optional third-party client. Onboard and fund only a low-value buyer wallet.
# npx --yes approves package installation. Running fetch may automatically pay up to --max-amount.
npx --yes agentcash@latest check https://apiacre.com/v1/data/schema
npx --yes agentcash@latest fetch https://apiacre.com/v1/data/schema \
  --method POST \
  --header 'content-type: application/json' \
  --body '{"content":"[{\"name\":\"Ada\",\"score\":98}]","format":"json","root_mode":"records"}' \
  --payment-protocol x402 \
  --payment-network base \
  --max-amount 0.025

Python

pip install "x402[httpx]" eth-account · raw example

import asyncio
import os

from eth_account import Account
from x402 import x402Client
from x402.http import x402HTTPClient
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client


async def main() -> None:
    client = x402Client()
    account = Account.from_key(os.environ["EVM_PRIVATE_KEY"])
    register_exact_evm_client(client, EthAccountSigner(account))
    response_parser = x402HTTPClient(client)

    async with x402HttpxClient(client) as http:
        response = await http.post(
            "https://apiacre.com/v1/research/sec-filing-signals",
            json={"identifier": "AAPL"},
        )
        await response.aread()
        response.raise_for_status()
        print(response.json())
        print(
            response_parser.get_payment_settle_response(
                lambda name: response.headers.get(name)
            )
        )


asyncio.run(main())

TypeScript

npm install @x402/fetch @x402/evm @x402/core viem · raw example

import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment, x402HTTPClient } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));

const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const responseParser = new x402HTTPClient(client);
const response = await fetchWithPayment(
  "https://apiacre.com/v1/research/sec-filing-signals",
  {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify({ identifier: "AAPL" }),
  },
);

if (!response.ok) throw new Error(`API Acre returned ${response.status}`);
console.log(await response.json());
console.log(await responseParser.processResponse(response));

Cross-origin browser apps

Registered /v1/... routes accept browser preflight and cross-origin JSON POSTs without cookies or account credentials. API Acre exposes PAYMENT-REQUIRED and PAYMENT-RESPONSE so an x402 client can inspect the challenge and settlement, and accepts PAYMENT-SIGNATURE plus Idempotency-Key on the retry. Current official x402 2.x retry clients are covered by the compatibility allowlist. The first-party checkout adds a payment identifier and client-only recovery secret; after an interrupted delivery, its same-origin check returns the original result only when final settlement was recorded and never resubmits the signed request. CORS access never authorizes a payment: the buyer still reviews and signs each request. Admin routes are excluded.

Spend safely

Never expose a Ledger seed phrase or primary wallet private key. Fund a separate low-value buyer wallet, inspect the challenge price, network, and recipient before signing, enforce a per-call and daily budget, and keep idempotency keys when retrying.