Research with sources
Search the web, read the pages behind the best sources, and write a summary that quotes them, on one Flux key, from your agent or your own code.
Give your agent a question and get back a short answer that quotes its sources, with links you can check. The recipe has three steps, each on the same Flux key:
- Search with
web_search(orPOST /v1/search) to get an answer and its source URLs. - Read the best few sources in full with
web_fetch(orPOST /v1/fetch). - Write the summary with
flux-auto, quoting the pages you read.
| Step | Status |
|---|---|
| Search | Rolling out |
| Read a page | Live |
Both are paid abilities. You need a paid, cleared plan; see Plans.
From your agent
Add the Flux tools server to your agent. Pick yours:
Built into Murage, which decides which abilities it uses. Nothing to set up here. See murage.ai.
Built into Wayland, which decides which abilities it uses. Nothing to set up here. See getwayland.com.
Add the Flux tools server from your terminal.
claude mcp add --transport http flux-tools https://api.fluxrouter.ai/mcp-tools/ \
--header "Authorization: Bearer sk-YOUR-FLUX-KEY"
Then ask Claude Code:
Use the Flux web_search tool to find what changed in the latest Node.js LTS release, and list the sources.
From Claude Code's own docs, checked 2026-09-28.
Add the Flux tools server to the same config. Codex reads the key from FLUX_API_KEY, which you exported above. File: ~/.codex/config.toml
[mcp_servers.flux-tools]
url = "https://api.fluxrouter.ai/mcp-tools/"
bearer_token_env_var = "FLUX_API_KEY"
Then ask Codex:
Use the Flux web_search tool to find what changed in the latest Node.js LTS release, and list the sources.
From Codex's own docs, checked 2026-09-28.
Add the Flux tools server to your global MCP config, then restart Cursor. File: ~/.cursor/mcp.json
{
"mcpServers": {
"flux-tools": {
"url": "https://api.fluxrouter.ai/mcp-tools/",
"headers": {
"Authorization": "Bearer sk-YOUR-FLUX-KEY"
}
}
}
}
Then ask Cursor:
Use the Flux web_search tool to find what changed in the latest Node.js LTS release, and list the sources.
From Cursor's own docs, checked 2026-09-28.
Add the Flux tools server to the same config, then restart Hermes. File: ~/.hermes/config.yaml
mcp_servers:
flux-tools:
url: "https://api.fluxrouter.ai/mcp-tools/"
headers:
Authorization: "Bearer sk-YOUR-FLUX-KEY"
Then ask Hermes:
Use the Flux web_search tool to find what changed in the latest Node.js LTS release, and list the sources.
From Hermes's own docs, checked 2026-09-28.
Not checked yet. We have not checked how OpenClaw adds an MCP server, so we do not show a recipe. See OpenClaw's own docs.
Open Cline's MCP servers panel, edit the settings file, and add the Flux tools server.
{
"mcpServers": {
"flux-tools": {
"type": "streamableHttp",
"url": "https://api.fluxrouter.ai/mcp-tools/",
"headers": {
"Authorization": "Bearer sk-YOUR-FLUX-KEY"
}
}
}
}
Then ask Cline:
Use the Flux web_search tool to find what changed in the latest Node.js LTS release, and list the sources.
From Cline's own docs, checked 2026-09-28.
Then give it the whole job in one message:
Research this question: "What changed in the latest Node.js LTS release?" First call the Flux
web_searchtool. From its citations, pick the three most authoritative pages and read each with the Fluxweb_fetchtool. Then answer in five bullet points. Every bullet must quote a sentence from one of the pages you read and give its URL. If the pages disagree, say so. Do not read more than three pages.
The last line is the budget: each page read is billed, so tell the agent how many to read.
From your own code
The same three steps in Python, with requests. The TypeScript version follows the same shape with fetch.
import requests
BASE = "https://api.fluxrouter.ai/v1"
HEADERS = {"Authorization": f"Bearer {FLUX_API_KEY}"}
MAX_PAGES = 3 # your budget: each page read is billed
question = "What changed in the latest Node.js LTS release?"
# 1. Search: an answer plus the URLs it drew on.
search = requests.post(f"{BASE}/search", headers=HEADERS, json={"query": question})
search.raise_for_status()
result = search.json()
print("Search cost (USD):", result["cost_usd"], "searches:", result["searches"])
# 2. Read the first few sources in full. Skip any page that will not read.
pages = []
for url in result["citations"][:MAX_PAGES]:
page = requests.post(f"{BASE}/fetch", headers=HEADERS, json={"url": url})
if page.status_code != 200:
continue # blocked, social network or failed: not billed
pages.append((url, page.json()["markdown"][:20000]))
print("Pages read:", len(pages))
# 3. Write the summary, quoting only what was read.
sources = "\n\n".join(f"SOURCE {url}\n{text}" for url, text in pages)
chat = requests.post(
f"{BASE}/chat/completions",
headers=HEADERS,
json={
"model": "flux-auto",
"messages": [
{
"role": "system",
"content": "Answer in five bullet points. Every bullet quotes one sentence "
"from a SOURCE below, in quotation marks, followed by its URL. "
"Use nothing that is not in the sources. Say so if they disagree.",
},
{"role": "user", "content": f"Question: {question}\n\n{sources}"},
],
},
)
chat.raise_for_status()
print(chat.json()["choices"][0]["message"]["content"])
The [:20000] trims each page so a long one cannot crowd the others out of the model's context. Trim to suit the model you route to.
Budgeting each step
| Step | Billed | Where the cost shows |
|---|---|---|
| Search | priced per call, plus the tokens that write its answer | cost_usd in the response |
| Read a page | priced per call; a repeat within 6 hours is free | Count the pages you read; each read is on your usage page |
| Write the summary | Chat tokens | Your usage page |
Ways to keep a run cheap:
- Cap the pages. The biggest lever is how many sources you read. Three is usually enough.
- Skip the read when the answer will do. The search answer already cites its sources. Read pages only when you need exact quotes.
- Let failures be free. Blocked URLs, social networks and failed reads are not billed, so skipping them costs nothing.
- Set a spend cap on the key for unattended runs. See Spend caps.
If a step fails
- Search problems: Web search problems.
- Page problems, including
social_blockedand empty pages: Read a page problems. - Tool problems in your agent: Tools server problems.