Skip to main content
Linkup supports the x402 payment protocol — pay per request in USDC on the Base network, with no account or API key required. This enables AI agents to use Linkup autonomously, without requiring a human to create an account. If you already have an API key, nothing changes — x402 is simply an alternative way to access the API.

Supported Endpoints

All x402-enabled endpoints are billed at a flat rate of $0.01 per request.
Endpoint
/v1/search
/v1/fetch

How It Works

  1. Send a request without authentication — the API responds with 402 Payment Required and a payment-required header containing the amount, deposit address, network, and asset.
  2. Sign a USDC transfer (EIP-712 / EIP-3009) with your wallet, then resend the same request with the signed payload in the payment-signature header.
  3. The API verifies the signature, executes the payment on-chain, and returns 200 with a payment-response header containing the transaction hash.

Setting Up a Wallet

If you don’t have a wallet yet, follow these steps to create one and fund it with USDC on Base.
1

Install MetaMask

Download and install the MetaMask app on your phone or browser extension.
2

Create an account

Follow the onboarding flow to create a new wallet.
3

Export your private key

  • Tap on your account name in the top left corner
  • Next to the account name, tap the three dots menu on the right
  • Select Private key
  • Copy your private key — this is what you’ll use in the SDK to sign payments on Base
4

Fund your wallet with USDC on Base

  • In MetaMask, switch to the Base network
  • Buy USDC (USD Coin) — you may need to verify your identity and enter personal information
  • Complete the purchase
Once your wallet is funded, you can use your private key in the SDK to pay for Linkup API requests.

Quickstart

1

Install dependencies

pip install 'linkup-sdk[x402]'
2

Send a paid request

from eth_account import Account
from linkup import LinkupClient
from linkup.x402 import create_x402_signer

account = Account.from_key("0xYOUR_PRIVATE_KEY")
signer = create_x402_signer(account)
client = LinkupClient(x402_signer=signer)

result = client.search(
    query="What is Linkup?",
    depth="standard",
    output_type="sourcedAnswer",
)
print(result.answer)

Headers Reference

HeaderDirectionDescription
payment-requiredResponse (402)Base64 JSON — amount, deposit address, network, asset
payment-signatureRequestBase64 JSON — signed payment authorization
payment-responseResponse (200)Base64 JSON — transaction hash, success status
For the full x402 specification, visit x402.org. The @x402/core and @x402/evm packages are open-source.
Facing issues? Reach out to our engineering team at support@linkup.so or via our Discord or book a 15 minutes call with a member of our technical team.