Web Search

Web search on CompanyFabric. POST /v1/search returns ranked results (title, url, snippet, published date) in one shape: DeepSeek on your CompanyFabric balance, Exa and Parallel on your own provider key (BYOK, 0% fee). companyfabric/auto-search picks the engine per query.

What it is

One endpoint for an agent's search.web tool. You send a query, you get ranked results in one shape whichever engine found them, and source_provider says which one did. Pick a mode, not a vendor: companyfabric/search (the default) uses the cheapest engine that supports the fields you sent, and companyfabric/auto-search picks an engine for each query.

Not OpenAI-compatible, because OpenAI has no search endpoint to be compatible with.

curl https://api.companyfabric.com/v1/search \
  -H "Authorization: Bearer $COMPANYFABRIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "companyfabric/auto-search",
    "query": "speculative decoding benchmarks arxiv",
    "max_results": 5
  }'

Request fields

  • query (required): what to search for, up to 1,000 characters. A few words to a sentence works best.
  • model: companyfabric/search (default), companyfabric/auto-search, or one engine by name: deepseek/search, parallel/search, exa/search.
  • max_results: 1 to 20, default 10.
  • include_domains / exclude_domains: up to 50 domains each, e.g. ["arxiv.org"].
  • published_after: YYYY-MM-DD, only results published on or after that date.

How auto-search picks

Four explicit rules, first match wins: a published_after date means news and goes to Exa (news category, date filter); technical or academic words (paper, arxiv, docs, API, SDK, GitHub, an error message) or code in the query go to Parallel; recency words (news, latest, today, breaking) go to Exa; anything else goes to DeepSeek. Only engines you can use are considered: without your own Exa or Parallel key, every query goes to DeepSeek. If the chosen engine is down or cannot serve the request, the next one by price answers. The engine that answered is in the engine field and the x-fabric-served-model header.

Engines: resold, or on your own key

DeepSeek search is resold: it runs on our key and bills your CompanyFabric balance. Exa and Parallel do not allow their search to be resold without their written agreement. Until each confirms, exa/search and parallel/search run on your own Exa or Parallel key only: add it in the BYOK vault (dashboard, BYOK) and they work through the same endpoint at 0% fee, billed by Exa or Parallel directly. Without that key, naming one answers 403 byok_required, and the two modes leave it out. GET /v1/models shows each engine's access: credits or byok.

  • deepseek/search (balance): about $1.59 per 1,000 searches, up to 20 results at that price, and nothing when it finds nothing. Queries up to 128 characters; no domain lists or published_after (requests with them skip it). Each snippet is DeepSeek's summary written for a model to read. Processed in China, like DeepSeek's chat models.
  • parallel/search (your Parallel key): supports domains and published_after; snippets are long markdown excerpts from the page. Use a paid Parallel API key from platform.parallel.ai.
  • exa/search (your Exa key): supports domains and published_after; snippets are Exa's highlights. Keys from dashboard.exa.ai.

Cost, failures and BYOK

On the balance, billed per search, the exact figure in usage.cost_usd; the welcome credit covers search. On your own key, cost_usd is 0 and the provider bills you. If an engine fails (down, rate-limited), the next engine you can use answers and you are billed once, for the one that did. A search that ran on your own key never fails over onto your balance: if your key's engine fails, only your other own-key engines are tried. If all fail, or the engine rejects the query as invalid (400), nothing is billed.

A DeepSeek key in the BYOK vault also runs deepseek/search on your own DeepSeek account, at 0% fee.

From an agent (MCP)

The MCP server at companyfabric.com/api/mcp exposes this endpoint as the web_search tool, with the same fields. It runs on the agent's own sk-cf key: the same engines, BYOK keys, cost and budget cap as a direct POST, and each search shows in usage. A refusal such as byok_required comes back as a tool error with its resolution, so the agent can tell you what to add.