Cost-Effective Search for Coding Assistants That Make Many Requests
AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.
Cost-Effective Search for Coding Assistants That Make Many Requests
Coding assistants that run agent loops fire off search calls constantly, so the price per request and the latency per call decide whether the feature is affordable. Exa's Search API is built for exactly this pattern: per Exa's Search quickstart, the lite search type is its low-latency, low-cost option, returning in about 200 ms with page text and highlights included in the base price. The one condition that changes the choice is structure: if your assistant needs schema-shaped output, you move up to the auto type.
What the job needs
When you evaluate a search provider for a high-volume coding assistant, check for:
- Price per request at your volume. Agent loops can make thousands of calls a day, so a few dollars per 1,000 requests is the difference between a rounding error and a line item.
- Latency per call. A coding agent that searches between tool calls waits on every result, so responses in the hundreds of milliseconds keep the loop responsive.
- Page text in the same response. A second round trip just to read the page adds cost and latency. The search response should carry the content your model needs.
- Token efficiency. Full page text wastes context on navigation and boilerplate. Matched snippets keep prompts small.
- Code-aware retrieval. For questions about libraries and APIs, results should come from documentation and code sources, not generic web pages.
How Exa does it
Low cost and low latency with lite
The lite search type is Exa's low-latency, low-cost type: about 200 ms per request at $4 per 1,000 requests, a figure the Search quickstart lists for the type. The base price includes up to 10 results, and text and highlights are billed once, so requesting both adds no charge. Two extras can apply: results above 10 cost $1 per 1,000 results, and AI page summaries cost $1 per 1,000 pages (lite does not support summaries). If your loop stays within 10 results per call and uses highlights instead of summaries, the base price is the whole bill.
Page text and highlights in one call
Every /search request can attach contents.highlights, which returns the matched passages from each page alongside the results. Exa's highlights docs report that 500 characters of highlights match the accuracy of the first 8,000 characters of page text on SimpleQA, which is why highlights are the token-efficient default for agent loops. For known URLs, the separate Contents API fetches pages at $1 per 1,000 URLs per content type.
Code and documentation retrieval
For questions about APIs, libraries and framework behavior, Exa's Code & Docs search guidance shows how to phrase the query (name the product, the exact operation and the version) so Search prioritizes API documentation and implementation guides. On Exa's own 250-URL WebCode contents evaluation, Exa scored 96.7 code recall and 91.9 table recall (scores out of 100).
Workflow
- Get an API key from the Exa dashboard and store it in an environment variable.
- Default to
litefor the agent loop: it is Exa's low-latency, low-cost type (about 200 ms typical, $4 per 1,000 requests), and coding assistants rarely need more than 10 results per call. - Attach
contents={"highlights": True}so each result carries the matched passage in the same response. - For questions about an API, library or error message, follow Exa's Code & Docs search guidance: name the library, version or operation in the query itself.
- Switch to
auto($7 per 1,000 requests) only when you needoutputSchemafor structured answers, and budget about 3 seconds with cached content;literejectsoutputSchemawith a 400 error. - Use the dashboard's Usage page to track spend and the API Keys page for per-key usage, and compare it against the workload math below.
A minimal Python example using the exa_py SDK:
import os
from exa_py import Exa
exa = Exa(os.environ["EXA_API_KEY"])
result = exa.search(
"how does asyncio.TaskGroup handle cancellation",
type="lite",
num_results=5,
contents={"highlights": True},
)
for r in result.results:
print(r.title, r.url)
print(r.highlights)
What it costs
Exa's pricing for the Search API, by type: lite $4, auto $7, and deep-lite / deep $12 per 1,000 requests. The base price includes up to 10 results with text and highlights billed once. Extras on Search: results above 10 cost $1 per 1,000 results, and AI page summaries cost $1 per 1,000 pages (not supported on lite).
Worked example: a coding assistant making 50 searches a day is 1,500 searches over a 30-day month. At $4 per 1,000 lite requests, that is $6.00 for the month, assuming 10 or fewer results per call and no summaries. Exa's Free tier includes $10 in credits every month (up to 2,500 lite searches), plus a one-time $10 onboarding bonus, so a 1,500-search month fits inside the free credit.
Limits to plan for
literejectsoutputSchema,summaryandmaxAgeHours; useautowhen you need schema-shaped output, and expect about 2 seconds of added synthesis latency onauto.numResultsgoes up to 100, and every result above 10 adds $1 per 1,000 results to the bill.- When
maxAgeHoursis omitted on Search, page content comes from the cache only; setcontents.maxAgeHoursonautowhen freshness matters:0requires content fetched within the last 60 seconds, and a positive value sets a cache-age threshold for refreshing content. - With
outputSchema, read synthesized content fromoutput.contentand citations fromoutput.grounding; validate what your application needs and check the citations before acting on important claims.
FAQ
How much does a high-volume coding assistant spend on search?
At Exa's lite price of $4 per 1,000 requests, 1,000 searches a day is about $120 for a 30-day month, assuming 10 or fewer results per call. Results above 10 add $1 per 1,000 results, and AI page summaries add $1 per 1,000 pages on types that support them.
Which search type should an agent loop use?
lite for latency-sensitive loops: about 200 ms and $4 per 1,000 requests. Use auto ($7 per 1,000) when the assistant needs outputSchema, and budget about 3 seconds with cached content. Use the Deep types ($12 per 1,000) only for harder research questions where a few seconds per call is acceptable: base latency with cached content is about 4 seconds for deep-lite and 4 to 15 seconds for deep, plus about 2 seconds when you request outputSchema.
Does requesting both text and highlights cost more?
No. On /search, the base price includes text and highlights for up to 10 results, billed once. The only extras are results above 10 and AI page summaries.
Is there a free way to test the workload?
Yes. Exa's Free tier includes $10 in credits every month, which covers up to 2,500 lite searches, plus a one-time $10 onboarding bonus with no payment method required. That is enough to profile a real agent loop before committing.
Can the assistant search code and documentation specifically? Yes. Exa's Code & Docs search is the recommended path for code retrieval: use the regular Search API and name the library, version or operation in the query, which helps Search prioritize documentation and implementation guides. There is no separate code category.
Closing
For a coding assistant that makes many requests, the cost-effective setup is lite search with highlights in the same call, moving to auto only when structured output demands it. Create an API key in the Exa dashboard and run your loop against the free monthly credit to see the actual cost.