Fyin
Set BING_ENDPOINT in Fyin's .env to SpecStream's Bing Web Search v7 address and put your SpecStream key in BING_SUBSCRIPTION_KEY. Fyin's Bing code stays as it is, and every question searches the live web through SpecStream's Search API, at $1 per 1,000 searches of up to 10 results.
What you need
- Fyin from GitHub, built with Rust and Cargo or with Docker. An OpenAI key, or Ollama running on the same machine.
- 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. Clone Fyin and add the search module
The README's clone address names
fyin.app. The repository isshadowfax92/Fyin.On the
mainbranch,src/main.rsdeclaresmod search;and callssearch::fetch_web_pages, while the search code is still insrc/bing.rs.cargo buildthen stops withfile not found for module search. Copy the file to the namemain.rsasks for:Terminal - 2
2. Create .env from sample.env
Fyin loads its settings with
dotenv, which reads.envin the folder you run Fyin from. The README says to copysample.envto.fyin.env, butdotenvdoes not read that name. Copy it to.env:Terminal - 3
3. Set the search lines
In
.env, set the three search lines below, with your key in place ofYOUR_SPECSTREAM_KEY.BING_ENDPOINTtakes the whole search address: Fyin sends itsGETto that address as it is.Do not leave
BING_ENDPOINTblank. The sample'sLeave blank for defaultsets an empty address, and Fyin's code uses its built-in Microsoft address only when the line is missing. Write every value in.envwithout quote marks, so the same file also works with Docker's--env-file..env - 4
4. Set the model lines
Fyin checks that
OPENAI_API_KEY,BING_SUBSCRIPTION_KEY,EMBEDDING_MODEL_NAMEandCHAT_MODEL_NAMEare set and not empty before it starts.With OpenAI, set
OPENAI_API_KEYto your OpenAI key and keepOPENAI_BASE_URLempty,EMBEDDING_MODEL_NAME=text-embedding-ada-002andCHAT_MODEL_NAME=gpt-4oas in the sample.With Ollama, use the values in the sample's comments:
OPENAI_API_KEY=ollama,OPENAI_BASE_URL=http://localhost:11434/v1, andllama3for both model names. An address withlocalhostin it puts Fyin in local mode, and it printsRunning in local mode using ollama. - 5
5. Ask a question
Pass the question with
--query, and the number of results with--search(or-s), 10 by default. The README's-nis not a flag Fyin defines. Aftercargo run, put--before Fyin's own flags:Terminal - 6
6. Check the search
Fyin prints
Fetching search results from bing..., thenSearch returned: 10 results. It reads each page it found, then streams the answer from your model.
What Fyin sends, and what comes back
| Fyin sends | SpecStream |
|---|---|
GET to BING_ENDPOINT | https://api.specstream.ai/v7.0/search, the path of Bing Web Search v7 |
The Ocp-Apim-Subscription-Key header, from BING_SUBSCRIPTION_KEY | Your SpecStream key, read from the same header |
q, your question | Searched on the live web as written |
count, from --search | That many results, up to 50 |
mkt=en-US | Read as English results for the United States |
Reads webPages.value[], with name and url | Bing's JSON: webPages.value[] with name, url and snippet |
Why the Bing setting
Microsoft retired the Bing Search APIs on August 11, 2025, so the default address in Fyin's code no longer answers. See the move from Bing Web Search v7.
sample.env also lists searxng and duckduckgo, but Fyin's search code reads webPages.value from every reply. That is Bing's field, and a SearXNG or DuckDuckGo reply does not have it, so Fyin stops on those replies. SpecStream answers in Bing's shape, so the Bing setting works with no change to Fyin's code.
Run it in Docker
The Dockerfile copies src into the image, so make the src/search.rs copy from the first step before you build. Then build the image and pass .env to the container:
What each question costs
Each question 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. Each started block of 10 more results adds $0.0012, so --search 20 costs $0.0022.
Fyin reads the pages it found by itself, from your machine, so page reading costs nothing on SpecStream. A call that returns no results costs nothing. Searches come out of your balance, with no quote and no approval. New accounts start with $10 of credit, no card.
Limits and errors
Failed to retrieve 'OPENAI_API_KEY'means Fyin found no.env. Run it from the folder that holds the file.Request failed with status code: 401 Unauthorizedmeans SpecStream got no valid key. CheckBING_SUBSCRIPTION_KEYin.env, and that the key was made on the Search API screen.Request failed with status code: 429 Too Many Requestsmeans search was busy. SpecStream answers withRetry-Afterand charges nothing. Ask again after a moment.- A
builder errorfromreqwestmeansBING_ENDPOINTis empty. Set it to the whole address in the step above.
Read pages and get rows too
The same key reads pages with the Extract API at $0.80 per 1,000 pages, and a page with no text is not charged. For a dataset, add SpecStream's MCP server at https://api.specstream.ai/mcp to an MCP client and ask for the records in plain words. Deep Search returns every match as structured rows at 5¢, 15¢ or $1 a row, under a maximum you approve. See MCP.
Remove
Set BING_ENDPOINT and BING_SUBSCRIPTION_KEY in .env to another provider's values. To end the key's access, revoke it under API keys in Agents & API in your workspace. Questions go to [email protected].
More
SpecStream for Fyin covers what it does in Fyin 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].