BlockRun

Exa Web Search

Real-time neural web search for AI agents. Four endpoints that give your agent a live internet connection — search, read, synthesize, and discover.

The Problem Exa Solves

LLMs have a knowledge cutoff. When an agent needs to answer "what happened last week" or "which projects are using x402 right now", the LLM either hallucinates or says it doesn't know.

Exa gives agents a live internet connection with structured, grounded results — not HTML soup, but clean text ready to feed into your next LLM call.

A complete research workflow costs $0.033:

  • 1 search ($0.011) → find relevant URLs
  • 5 page reads in one call ($0.002/URL + $0.001 per-request fee → $0.011) → get full content
  • 1 synthesized answer ($0.011) → grounded conclusion

Endpoints

EndpointMethodPriceDescription
/api/v1/exa/searchPOST$0.011Neural web search — find relevant URLs for a query
/api/v1/exa/answerPOST$0.011Get a cited, synthesized answer to any question
/api/v1/exa/contentsPOST$0.002/URL + $0.001/requestFetch full Markdown text from a list of URLs
/api/v1/exa/find-similarPOST$0.011Find pages similar to a given URL

All four are POST only. Any other path under /api/v1/exa/ returns 404 with an available list. Requests are forwarded to Exa with a 30-second timeout.


POST /api/v1/exa/search

Neural (semantic) search across the live web. Unlike keyword search, Exa understands meaning — searching "x402 payment implementation" returns implementations, not pages that mention those words.

Request Body

ParameterTypeRequiredDescription
querystringYesNatural language search query
numResultsintegerNoNumber of results to return (default: 10, max: 100)
categorystringNoRestrict to a content category (see below)
startPublishedDatestringNoOnly include pages published after this date (ISO 8601)
endPublishedDatestringNoOnly include pages published before this date (ISO 8601)
includeDomainsarrayNoOnly search within these domains
excludeDomainsarrayNoExclude these domains from results

Category Options

Narrow your search to a specific type of content:

CategoryDescription
githubGitHub repositories and code
newsNews articles from major outlets
research paperAcademic papers and preprints
linkedin profileLinkedIn profile pages
personal sitePersonal and portfolio sites
tweetTwitter/X posts
financial reportEarnings reports and financial filings
pdfPDF documents
companyCompany websites and about pages

Response

{
  "requestId": "d581de9ed6d77165",
  "resolvedSearchType": "neural",
  "results": [
    {
      "id": "https://github.com/example/x402-impl",
      "title": "x402 Payment Protocol — Reference Implementation",
      "url": "https://github.com/example/x402-impl",
      "publishedDate": "2026-03-15T00:00:00.000Z",
      "score": 0.94
    }
  ],
  "searchTime": 860,
  "costDollars": { "total": 0.007 }
}

The gateway returns Exa's JSON body verbatim — there is no data wrapper.


POST /api/v1/exa/answer

Ask a factual question, get a synthesized answer with citations. Like Perplexity in an API — grounded in real sources, not hallucinated.

Best for: "What is X?", "How does Y work?", "What's the current state of Z?"

Request Body

ParameterTypeRequiredDescription
querystringYesThe question to answer

Response

{
  "requestId": "601e412c9b1d0891",
  "answer": "x402 is an open payment standard built around the HTTP 402 status code...",
  "citations": [
    {
      "id": "https://x402.org",
      "title": "x402 - Payment Required | Internet-Native Payments Standard",
      "url": "https://www.x402.org"
    }
  ]
}

POST /api/v1/exa/contents

Fetch the full text content from a list of URLs. Returns clean Markdown — no HTML, no boilerplate — ready to drop into an LLM context window.

This is the cheapest way to read web pages: $0.002 per URL, plus the $0.001 per-request fee charged once no matter how many URLs you pass. Fetching 10 pages costs $0.021; a single page costs $0.003.

Request Body

ParameterTypeRequiredDescription
urlsarrayYesList of URLs to fetch (up to 100)

Response

{
  "results": [
    {
      "id": "https://x402.org",
      "url": "https://x402.org",
      "title": "x402 - Payment Required",
      "text": "x402 is an open, neutral standard for internet-native payments...",
      "author": null
    }
  ],
  "costDollars": { "total": 0.002 }
}

POST /api/v1/exa/find-similar

Given a URL, find semantically similar pages. Useful for discovering competitors, alternatives, or related resources.

Request Body

ParameterTypeRequiredDescription
urlstringYesThe reference URL to find similar pages for
numResultsintegerNoNumber of results (default: 10, max: 100)
excludeSourceDomainbooleanNoExclude pages from the same domain (default: false)

Response

Same format as /exa/search.


Use Cases

1. Research Agent — Full Grounded Analysis

An agent asked to analyze a topic. Cost: ~$0.036.

// Step 1: Find relevant sources
const search = await client.exaSearch("x402 protocol adoption 2026", {
  numResults: 5,
  category: "news"
});

// Step 2: Read full content of top results
const urls = search.results.map(r => r.url);
const pages = await client.exaContents(urls);

// Step 3: Feed into LLM for analysis
const analysis = await client.chat("anthropic/claude-opus-5", [
  { role: "system", content: "Analyze based only on the provided sources." },
  { role: "user", content: `Sources:\n${pages.results.map(p => p.text).join("\n---\n")}\n\nQuestion: What is driving x402 adoption?` }
]);

2. Fact-Checking Agent — No Hallucinations

Agent needs a reliable answer to a factual question. Cost: $0.011.

const result = await client.exaAnswer(
  "How many x402 transactions happened in the last 30 days?"
);
// answer is grounded in real web sources with citations
console.log(result.answer);
console.log("Sources:", result.citations.map(c => c.url));

3. Competitive Intelligence — Find Similar Projects

Discover what's being built in your space. Cost: $0.011.

const similar = await client.exaFindSimilar("https://blockrun.ai", {
  numResults: 10,
  excludeSourceDomain: true
});
// Returns pages semantically similar to blockrun.ai — competitors, partners, alternatives

4. Developer Agent — Find Code Examples

AI coding agent looking for real implementation examples. Cost: $0.014 (one search at $0.011 + one URL of contents at $0.003).

// Find GitHub repos implementing a specific pattern
const repos = await client.exaSearch(
  "x402 payment middleware implementation Next.js",
  { numResults: 5, category: "github" }
);

// Read the README of the most relevant repo
const readmes = await client.exaContents([repos.results[0].url]);
// Feed into coding agent context

5. Monitoring Agent — Track News About a Topic

Weekly check on what's happening. Cost: $0.011/run.

const lastWeek = new Date();
lastWeek.setDate(lastWeek.getDate() - 7);

const news = await client.exaSearch("Coinbase x402 announcement", {
  category: "news",
  startPublishedDate: lastWeek.toISOString()
});

SDK Usage


Pricing

EndpointPrice per call
/exa/search$0.011
/exa/answer$0.011
/exa/find-similar$0.011
/exa/contents$0.002 per URL + $0.001 per request

Every price above already includes the flat $0.001 per-transaction fee (base $0.01 per call, or $0.002 per URL for /contents). Payment is in USDC on Base or Solana via x402. No account needed — your wallet is your identity.

The 402 response

An unpaid request returns 402 with the exact charge in the body and the signable x402 v2 requirements in the X-Payment-Required / PAYMENT-REQUIRED headers (base64 JSON; also mirrored in WWW-Authenticate), plus the same challenge mirrored into the body as x402Version/accepts. For /contents the body is read first, so price.amount reflects urls.length:

{
  "x402Version": 2,
  "accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "5000", "asset": "0x8335…", "payTo": "0x…", "maxTimeoutSeconds": 300 }],
  "error": "Payment Required",
  "message": "This endpoint requires x402 payment",
  "endpoint": "/api/v1/exa/contents",
  "method": "POST",
  "description": "Extract full text content from specific URLs. ...",
  "price": { "amount": "0.0050", "currency": "USD" },
  "paymentInfo": { "network": "base", "asset": "USDC", "x402Version": 2 }
}

Send the signed payload back in X-PAYMENT (or PAYMENT-SIGNATURE). A GET on any of the four paths returns a discovery 402 whose paymentInfo.price is the per-unit base rate; for /contents it also carries pricingUnit: "per-url" and a pricingNote.

Successful responses carry X-Payment-Response (x402 v2 settlement receipt) and X-Payment-Receipt (the settlement transaction hash).


vs. Other Options

BlockRun ExaExa directlyGoogle Search API
PaymentUSDC per callSubscriptionSubscription
Account requiredNoYesYes
Works for autonomous agents❌ (needs API key)
Clean Markdown output
Same wallet as LLM callsN/AN/A

Error Handling

CodeDescription
402Payment required — sign and retry. Also returned when a payment header is present but fails verification (error: "Payment verification failed", see codes below), when an authorization is reused (code: "PAYMENT_REPLAY"), or when settlement fails after the call (error: "Payment settlement failed")
400–499Exa rejected the request — the upstream status is passed through unchanged with error: "Bad Request", status, and Exa's own error in details. Payment was NOT charged.
404Unknown endpoint path (available lists the four valid paths)
502Exa returned a 5xx (error: "Upstream provider error"). Payment was NOT charged
503Exa integration not configured, or temporarily paused
500Gateway error (error: "Internal server error"), including a 30-second upstream timeout

Payment is verified before the upstream call and settled only after Exa answers, so a failed or rejected request never costs anything.

Payment verification codes

A verification 402 spreads a machine-readable code so clients can branch without parsing the human-readable details:

codeMeaning
PAYMENT_INVALIDSignature, amount, network or recipient did not match the requirements (default; message omitted)
PAYMENT_UNFUNDEDThe authorization could not execute on-chain — usually insufficient USDC on Base, or an expired validAfter/validBefore window
PAYMENT_BLOCKHASH_STALESolana gateway only: signed against an expired blockhash — re-sign and retry
PAYMENT_REPLAYThat authorization was already used. Sign a fresh one for each request

What's next?