FrontierAgent
Run FrontierAgent's web_search on SpecStream's Search API by changing two lines in .env. FrontierAgent's Serper client stays as it is, and each search costs $1 per 1,000.
SpecStream for FrontierAgentAgent frameworks & buildersWhat you need
- FrontierAgent, from a clone (
uv sync --python 3.12 --extra dev) or installed withuv tool install, with an OpenAI-compatible model endpoint set in.envas its README describes. - A SpecStream key. Get your key on the Search API screen of your SpecStream workspace. New accounts start with $10 of credit, no card.
- 1
1. Set the two Serper lines in .env
FrontierAgent's
web_searchposts every query toSERPER_BASE_URLplus/search, with the key in theX-API-KEYheader. SpecStream answers Serper's calls at its own address and reads the key from the same header.Keep
WEB_SEARCH_PROVIDER=serper, the default, and set the address and your key. Give the address without/search: FrontierAgent adds it..env - 2
2. Start a new session
FrontierAgent loads
.envwhen it starts, so start the TUI again after the edit, in either mode:Terminal - 3
3. Check a search
Ask about something from this week. The tool lists the results with their titles, links and snippets. Each call is in the request log of your SpecStream workspace, with the Serper route as its endpoint and the price it cost.
Where the lines can live
Exported variables and a project .env come first. An install made with uv tool install also reads ${XDG_CONFIG_HOME:-$HOME/.config}/apodex/env: put the lines there to use SpecStream from every project, and chmod 600 the file. Keep the key out of anything you commit.
Read pages with the Extract API
web_fetch reads pages through Jina Reader at JINA_BASE_URL, with JINA_API_KEY as a Bearer token. SpecStream answers Jina Reader's calls too, so the same key reads the pages FrontierAgent sends there. Set the two lines below. FrontierAgent sends the page both ways Jina takes it, in a JSON body to the address and after the address, and SpecStream answers both, in Jina's reply shape.
Each page is one Extract API page at $0.80 per 1,000 pages, and a page with no text is not charged. Pages FrontierAgent routes elsewhere, such as papers it looks up through Unpaywall, keep their own route.
What changes and what stays
Only the address and the key change. FrontierAgent's Serper client, its result text, its URL filters and its retries stay as they are, and SpecStream answers in Serper's shape: organic[] with title, link, snippet and position. With WEB_SEARCH_PROVIDER=serper, every web_search goes to SpecStream. The parallel and keenable providers are not touched.
FrontierAgent's README names a Serper-compatible address as the way to change the search provider, so the switch needs no fork and no pull request.
Why SpecStream for web_search
SpecStream's Search API reads each answer from the live web at the moment of the call. It scores 97.9 F-score on all 1,000 SimpleQA Verified questions and 64.0 item F1 on all 200 WideSearch tasks. Scores and method are on the benchmarks page.
The same key also reads pages through the Extract API, and, over MCP, asks for structured records with a source URL and read time on every value.
What each search costs
Each query is one Search API call on the fast tier: $1 per 1,000 searches of up to 10 results, a fifth of the default search's $5. A web_search call with several queries sends one search for each.
FrontierAgent asks for 10 results unless the agent sets num, which it caps at 100. Each started block of 10 more results costs in the same proportion, so a call for 50 results is $0.0058. A search that returns no results costs nothing. Calls come out of your balance with no quote and no approval.
Limits and errors
- With
SERPER_API_KEYempty, the tool answers[ERROR]: SERPER_API_KEY environment variable not set.and sends nothing. - A missing or wrong key is refused with
401, and nothing is charged. - When the account has used its calls for the minute, SpecStream answers
429withRetry-After. FrontierAgent's client retries an HTTP error up to three times, with a wait between tries.
Undo
Set SERPER_BASE_URL back to https://google.serper.dev with a Serper key, and JINA_BASE_URL back to https://r.jina.ai with a Jina key. Revoke the SpecStream key on the Search API screen of your workspace. Questions go to [email protected].
More
SpecStream for FrontierAgent covers what it does in FrontierAgent on one page. Every other tool has its guide in Connect your tools. You see the most a request can cost before it starts, and the matches are paid from your balance. Billing has the details. For help, email [email protected].