Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.linkup.so/llms.txt

Use this file to discover all available pages before exploring further.

Linkup supports the x402 payment protocol: pay per request in USDC on the Base network, with no account or API key required. This lets AI agents use Linkup autonomously, without requiring a human to create an account. If you already have an API key, nothing changes. x402 is 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.
Need help? Email support@linkup.so, ping us on Discord, or talk to us.