deep-research (dzhng)
deep-research by dzhng reads one setting for its search address, FIRECRAWL_BASE_URL. Set it to https://api.specstream.ai/firecrawl and put your SpecStream key in FIRECRAWL_KEY, and every search of a research run goes to the SpecStream Search API. You change no code.
What you need
- deep-research cloned from
github.com/dzhng/deep-research, with Node.js and an OpenAI key or another model set up as its README shows. - A SpecStream API key. New accounts start with $10 of credit, no card. Create an account.
- 1
1. Get a SpecStream API key
Get your key on the Search API screen of your SpecStream workspace. deep-research sends it as a Bearer token, the way it sends a Firecrawl key.
- 2
2. Set two lines in .env.local
deep-research reads its settings from
.env.localin the repository folder. Put your SpecStream key inFIRECRAWL_KEY, and remove the#in front ofFIRECRAWL_BASE_URLand set it to the SpecStream address. LeaveOPENAI_KEYand the model lines as they are.Write the address without
/v1. The Firecrawl SDK the tool installs,@mendable/firecrawl-js1.16.0, adds/v1/searchto it..env.local - 3
3. Run a research
Start the tool and answer its prompts: the query, the breadth (default 4), the depth (default 2) and the follow-up questions. With Docker, the same
.env.localis used:docker compose up -d, thendocker exec -it deep-research npm run docker.The report is saved as
report.md, oranswer.mdin answer mode, with the visited URLs listed at the end.Shell - 4
4. Check the calls
Each search of the run is in the request log of your SpecStream workspace, with the Firecrawl route as its endpoint. Each charged reply carries an
X-Balance-Centsheader with your balance in cents. - 5
5. Or get the whole report in one call
If you want the report and not the loop, SpecStream writes it.
POST /v1/researchtakes the question in plain words and answers202with the report'sid. ReadGET /v1/research/{id}untilstatusiscompleted.report.contentis the text with[1]markers,report.citationsgives each cited sentence its page, read time and passage, andreport.sourceslists every page read.depthisquick,standard(the default) ordeep: $0.10, $0.30 or $1.00 a report. No OpenAI key is needed for this call. The research docs have every field.Shell
What deep-research sends
src/deep-research.tscreates one Firecrawl client withapiKeyfromFIRECRAWL_KEYandapiUrlfromFIRECRAWL_BASE_URL. When the second is empty, the SDK callshttps://api.firecrawl.dev.- Each generated query is one
firecrawl.searchcall:POST /v1/searchwithlimit5, atimeoutof 15000 andscrapeOptionsasking formarkdown. The tool makes no separate scrape call. - SpecStream answers in Firecrawl's v1 shape:
data[]withurl,title,descriptionandmarkdown. The tool readsurlfor the source list of the report andmarkdownfor the learnings its model extracts. - In SpecStream's answer,
markdownholds the text found for the query on each result, a passage and not the whole page. To read a whole page, call the Extract API at $0.80 per 1,000 pages.
Cost of a run
Each search through the Firecrawl address is one Search API call at $1 per 1,000 searches of up to 10 results, the fast tier every drop-in address runs on. The tool asks for 5 results, so every search is in that price.
The number of searches follows from breadth and depth. Each level halves the breadth and rounds up. With the defaults, breadth 4 and depth 2, a run sends 4 searches, then 2 more for each of them: 12 searches, $0.012. Breadth 10 and depth 3 is 10, then 50, then 150: 210 searches, $0.21. The model calls are paid to your model provider and are the larger part of a run. New accounts start with $10 of credit, no card. Balance and billing has the details.
Three ways to run the search step
| Setup | What you change | What you pay for search |
|---|---|---|
| SpecStream address | FIRECRAWL_KEY and FIRECRAWL_BASE_URL in .env.local | $1 per 1,000 searches of up to 10 results |
| Firecrawl's own API (the default) | FIRECRAWL_KEY only | Firecrawl's plan |
| Self-hosted Firecrawl | FIRECRAWL_BASE_URL="http://localhost:3002" and a Firecrawl server you run | Your own server, and the search backend you give it |
| SpecStream research report | One POST /v1/research call, no deep-research loop and no OpenAI key | $0.10, $0.30 or $1.00 a report |
Concurrency
The tool runs 2 searches at once by default. The code reads FIRECRAWL_CONCURRENCY (Number(process.env.FIRECRAWL_CONCURRENCY) || 2). The README names CONCURRENCY_LIMIT, which the code does not read, so set FIRECRAWL_CONCURRENCY. A higher number makes a wide run finish sooner. If SpecStream answers 429 with Retry-After, the account used its calls for the minute: lower the number. Nothing is charged for that reply.
If searches fail
401: the key did not reach SpecStream. CheckFIRECRAWL_KEYin.env.local, and that the file is in the repository folder.- A
404or405: check thatFIRECRAWL_BASE_URLishttps://api.specstream.ai/firecrawl, with no/v1and no trailing slash. - A report with no sources: the tool logs each failed query and goes on, so read the terminal output for the error of the first search.
429withRetry-After: wait that many seconds, or setFIRECRAWL_CONCURRENCY="1".
Other ways to use SpecStream
For a list with the same facts on every row, ask an assistant connected to the SpecStream MCP server at https://api.specstream.ai/mcp. The Firecrawl migration page lists every Firecrawl parameter the address applies. For the web version of this tool, see the Deep Research Web UI guide.
Switch back
Put the # back in front of FIRECRAWL_BASE_URL and your Firecrawl key back in FIRECRAWL_KEY. The tool calls https://api.firecrawl.dev again on the next run.
More
SpecStream for deep-research (dzhng) covers what it does in deep-research (dzhng) 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].