Skip to main content
Use this cookbook to build a GTM enrichment agent or pipeline on top of Exa’s /search and /contents endpoints, paid per request through the Machine Payments Protocol (MPP). MPP supports multiple payment methods; the examples here use stablecoins on Tempo. No monthly subscription, no API key, and no seat-based pricing: fund a wallet with USDC.e and pay as you enrich leads or companies.
MPP is currently supported on Exa’s /search and /contents endpoints only. The Agent API (/agent/runs) and /answer require an Exa API key and go through the standard API key billing flow.

What you’ll build

A lightweight enrichment pipeline that, given a list of company names or target descriptions:
  1. Uses Exa /search with type: "deep" and output_schema to find the official company page and extract key metadata.
  2. Uses contents.highlights on the returned result to pull source snippets for funding, headquarters, employees, and product.
  3. Emits a CSV or JSON enrichment record per input.
This pattern works for lead-list enrichment, account research, and outbound personalization. Because it is composed of discrete /search + /contents calls, every step can be paid for with MPP.

Prerequisites

  • A Tempo-compatible wallet funded with USDC.e on Tempo mainnet.
  • A safe way to load the wallet private key at runtime (see below; never commit the key or expose it in source code).
  • mppx (TypeScript) or pympp (Python) installed.
For a command-line setup that doesn’t need a raw private key, use the Tempo Wallet CLI. tempo wallet login creates or connects a wallet and may include free MPP Credits for new sign-ups.

MPP setup

Install the client

Load your private key safely

Never hardcode a private key. The examples below read WALLET_PRIVATE_KEY from your runtime environment for local development only. In production, load it from a secrets manager such as 1Password, AWS Secrets Manager, or HashiCorp Vault.

Make a paid search request

A successful response returns Exa results plus a Payment-Receipt header with the on-chain transaction hash.

Make a paid contents request

GTM enrichment recipe

Enrich a list of companies

Given a list of company names, search for each company’s page and extract structured details.

Enrich a person profile

This recipe uses type: "deep", contents.highlights, and output_schema to research a person and return a structured profile.
This uses type: "deep" for richer reasoning and output_schema to shape the response. Deep search is priced at $0.012 per request, and contents.highlights adds $0.001 per result.

Structured output

If you want JSON fields instead of raw text, use output_schema in the search request. Exa returns an output object shaped to your schema.
output_schema works best with deep-lite or deep search types. It adds an LLM call on Exa’s side, so it is priced as deep-lite/deep.

Pricing and limits

MPP uses the same per-request pricing as API key billing. MPP search requests are capped at 10 results. See Pay with MPP (Tempo) for the full reference, including rate limits, network details, and payment headers.

Production tips

  • Fund the wallet with USDC.e only. Exa sponsors the Tempo network fee, so the wallet does not need a separate gas token.
  • Handle 402 responses. The MPP SDK retries automatically, but a custom client should retry on 402 using the WWW-Authenticate: Payment challenge.
  • Cache /contents results. Contents are priced per URL. Cache by URL to avoid paying twice for the same company page.
  • Watch the 10-result cap. MPP search clamps numResults to 10.
  • Never commit private keys. Load WALLET_PRIVATE_KEY from a secrets manager, not source control.

FAQ

No. In the Exa codebase, MPP is wired only to /search and /contents. /agent/runs and /answer require an Exa API key and use standard API key billing.
No. If a request includes x-api-key or Authorization: Bearer, the API key flow takes priority and MPP is bypassed.
Exa returns 402 with a fresh WWW-Authenticate: Payment challenge and no results. Your client can retry with a new payment. No results are returned until settlement succeeds.
You can reuse the same wallet, but we recommend separate wallets for development and production. Per-wallet QPS is 10 requests/second across all requests from that wallet.

Next steps

Last modified on July 31, 2026