Baidu AI Search (Qianfan) compatible
Change one address.
Baidu's search API on Qianfan lists ¥0.036 a call on its standard edition, with 3 QPS by default and 100,000 calls a day before you must contact Baidu. SpecStream answers the same POST /v2/ai_search/web_search in Baidu's own JSON for $1 per 1,000 searches.
The switch is one address: https://api.specstream.ai/qianfan in place of https://qianfan.baidubce.com, and a SpecStream key as the Bearer token. Your code reads references[] with title, url, content and date as before.
SpecStream scores 97.9 F-score on all 1,000 SimpleQA Verified questions and 64.0 item F1 on all 200 WideSearch tasks. New accounts get $10 of credit, no card.
New accounts get $10 of credit, no card. It covers 10,000 searches.
Baidu AI Search on Qianfan to SpecStream, parameter by parameter and field by field
| SpecStream | Baidu AI Search (Qianfan) | |
|---|---|---|
| Address | POST https://api.specstream.ai/qianfan/v2/ai_search/web_search | POST https://qianfan.baidubce.com/v2/ai_search/web_search |
| The key | A SpecStream key as Authorization: Bearer, or in X-Appbuilder-Authorization | A Baidu API key as Authorization: Bearer |
| Price | $1 per 1,000 searches of up to 10 results, the same for every edition | ¥0.036 a call on the standard edition, ¥0.04 on the enhanced edition and ¥0.072 on the flagship edition for content inside China. IT Home reports a promotion from October 30, 2026 with a lowest price of 4.9 yuan per 1,000 calls |
| Prepaid packs | Credit you buy never expires | 10,000 calls for 352 yuan, 100,000 for 3,420 yuan and 1,000,000 for 30,600 yuan, each valid for 1 year |
| Limit | No limit per key and no daily limit | 3 QPS by default, and 100,000 requests a day before you contact Baidu |
| Free use | $10 of credit on a new account, no card: 10,000 searches, with no end date | 1,500 calls a month, given out at about 50 a day |
| `resource_type_filter` | web with top_k 0 to 50, 20 when you send no filter. image with top_k up to 30 when the call asks for no web result | web up to 50, video up to 10, image up to 30 and aladdin up to 5. Default: web 20 |
| Site filter | search_filter.match.site at no extra cost, and block_websites to leave sites out | Up to 100 sites. Baidu's reference calls it a paid feature that is free for a limited time |
| The reply | request_id and references[] with id, title, url, web_anchor, website, snippet, content, date, type, icon, image, video and rerank_score | request_id and references[] |
The Baidu AI Search reference, on SpecStream
The call, before and after
# Before
curl -X POST https://qianfan.baidubce.com/v2/ai_search/web_search \
-H "Authorization: Bearer $BAIDU_API_KEY" -H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "Who founded Mistral AI and when?"}], "resource_type_filter": [{"type": "web", "top_k": 10}]}'
# After
curl -X POST https://api.specstream.ai/qianfan/v2/ai_search/web_search \
-H "Authorization: Bearer $SPECSTREAM_API_KEY" -H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "Who founded Mistral AI and when?"}], "resource_type_filter": [{"type": "web", "top_k": 10}]}'The body and the parser stay. The host changes to api.specstream.ai/qianfan, and the key changes. The results come from the SpecStream Search API, in Baidu's JSON.
An AppBuilder client that sends its key as X-Appbuilder-Authorization: Bearer is read too.
Every parameter the route uses
Used in the search: messages (the search is the content of the last message), resource_type_filter (web with top_k 0 to 50, image with top_k 0 to 30), search_recency_filter (week, month, semiyear or year) and safe_search.
In search_filter: match.site keeps results to the sites you name, block_websites leaves sites out, and range.page_time keeps a window of days when you send both ends, with gte or gt and lte or lt. Each end is a day as YYYY-MM-DD or a preset such as now/d, now-1w/d, now-1M/d or now-1y/d.
One call is one search: the web results when it asks for any, and the image results when it asks for images alone. video and aladdin are accepted with their top_k and answered with no result. edition, search_source and query_policy are accepted, and the price is the same for every edition.
Refused with HTTP 400 and Baidu's InvalidArgument: a top_k above the kind's maximum, a resource type other than web, image, video or aladdin, a search_recency_filter Baidu does not take, and a call that asks for neither web nor image results.
Every field that comes back
The reply has request_id and references. Each reference has id (counted from 1), title, url, web_anchor, website, snippet, content, date as YYYY-MM-DD HH:MM:SS when the page gives a time, type (web or image) and rerank_score.
content carries the result's snippet text. On a web reference icon, image and video are null. An image reference has image with url, height and width.
One field is added: specstream, with what the Search API returns beyond Baidu's fields, including the call's price_usd. A parser that reads Baidu's fields never sees it.
A refusal carries Baidu's requestId, code and message and keeps its HTTP status, so a client's status check sees it: 216003 with 401 for a key that cannot be read, BILLING_INSUFFICIENT_BALANCE with 402 and RATE_LIMIT_SEARCH_QPS with 429.
$1 per 1,000 searches, with no QPS cap
A call of up to 10 results costs $0.001. Each started block of 10 more results adds $0.0012: top_k 20 costs $0.0022 and top_k 50 costs $0.0058. A call with no resource_type_filter returns 20 web results, as on Baidu, so send top_k 10 to pay $0.001.
The site filter and the date filter cost nothing extra. A call stopped by a 429 charges nothing, and credit you buy never expires.
The most accurate web search API, in about one second
On SimpleQA Verified the SpecStream Search API scores 97.9 F-score on all 1,000 official questions, 978 of them correct. On WideSearch it scores 64.0 item F1 and 43.4 row F1 on all 200 official tasks. The Extract API scores 0.908 F1 on WCXB. Every score and its method is on the benchmarks page.
Every call on this route runs the fast search. Measured on production on November 9, 2026, its median was 0.82 s at 1 search a second and 1.07 s at 20 a second, the 95th percentile stayed between 1.09 and 1.73 s, and it answered 718 of 720. It has no limit per key and no daily limit.
You decide what is kept, on each key
Create the key with zero_retention and a search made with it keeps no request text and no answer after the reply: it is not in the history, its answer is not reused for another call, and its log lines carry neither. spend_cap_cents is the most the key can spend.
curl -X POST https://api.specstream.ai/v1/account/keys \
-H "Authorization: Bearer $SPECSTREAM_API_KEY" -H "Content-Type: application/json" \
-d '{"name": "production", "scopes": ["account:read", "finds:spend"], "spend_cap_cents": 500000, "zero_retention": true}'Search, pages and rows on one key
The same key reads up to 20 pages or documents a call with the Extract API at $0.80 per 1,000 pages, and a page with no text is not charged. Deep Search returns every match for a request in plain words as structured rows, at 5¢, 15¢ or $1 a row, with a source URL on every value. The most a run can cost is approved before it starts.
What else Baidu AI Search users price
Alibaba Cloud IQS Web Search
Alibaba Cloud's search API for agents, priced by engine: 8 CNY per 1,000 calls on China Edition LiteBasic, 42 CNY on the Generic edition's first tier at 30 QPS, and 56 CNY on Global Edition GlobalAdvanced. SpecStream answers its POST /search/unified as well, at https://api.specstream.ai/aliyun-iqs, for $0.001 a search of up to 10 results.
Tavily
A search API sold in credits at $0.008 each pay as you go: a basic search takes 1 credit and an advanced search 2. SpecStream answers Tavily's POST /search at https://api.specstream.ai/tavily for $0.001 a basic search and $0.005 an advanced one.
Brave Search API
A search API on Brave's own index at $5 per 1,000 requests, with $5 in free credits every month and 50 queries per second. SpecStream answers Brave's call at https://api.specstream.ai/res/v1/web/search at $1 per 1,000, a fifth of Brave's rate, and has no limit per key.
How SpecStream scores
The same numbers as the benchmarks page, from the official tasks and scorers.
How to migrate, step by step
1. Create a key under Agents & API in the workspace. A new account gets $10 of credit, no card, which covers 10,000 searches.
2. Set the host to https://api.specstream.ai/qianfan where your code has https://qianfan.baidubce.com, and send the SpecStream key as the Bearer token. In Python:
import requests
BASE = "https://api.specstream.ai/qianfan" # was https://qianfan.baidubce.com
reply = requests.post(
f"{BASE}/v2/ai_search/web_search",
headers={"Authorization": f"Bearer {SPECSTREAM_KEY}"},
json={
"messages": [{"role": "user", "content": "Who founded Mistral AI and when?"}],
"resource_type_filter": [{"type": "web", "top_k": 10}],
"search_recency_filter": "year",
},
timeout=30,
)
reply.raise_for_status()
for ref in reply.json()["references"]:
print(ref["id"], ref["title"], ref["url"], ref["date"])3. In JavaScript:
const res = await fetch("https://api.specstream.ai/qianfan/v2/ai_search/web_search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPECSTREAM_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
messages: [{ role: "user", content: "Who founded Mistral AI and when?" }],
resource_type_filter: [{ type: "web", top_k: 10 }],
}),
});
const data = await res.json();
for (const ref of data.references) console.log(ref.title, ref.url);4. Read 402 as an empty balance and 429 as a call to send again after Retry-After. Neither is charged.
5. When your product needs every match in place of a results page, write the request in plain words. SpecStream reads it back as the conditions every row must meet and the facts to bring back, quotes the most it can cost, and delivers the rows after you approve.
Frequently asked questions
Something we didn't answer? Talk to a human
Is there a Baidu AI Search compatible API?
POST /v2/ai_search/web_search at https://api.specstream.ai/qianfan/v2/ai_search/web_search in Baidu's JSON, for $0.001 a search of up to 10 results.How much does the Baidu search API cost?
How do I migrate from qianfan.baidubce.com?
https://api.specstream.ai/qianfan in place of https://qianfan.baidubce.com, and a SpecStream key as the Bearer token. The body and the code that reads references[] stay as they are, and a search of up to 10 results costs $0.001.What is the Baidu search API rate limit?
Retry-After at no charge when search is busy.Are the results from Baidu's index?
Do video and Aladdin results work?
video and aladdin in resource_type_filter are accepted and answered with 0 results. Web results come back up to 50 a call, and image results up to 30 when the call asks for images alone.How much does a call with no resource_type_filter cost?
top_k 10 and the call costs $0.001.Sources
SpecStream wrote this page. Each Baidu fact comes from Baidu's own API reference and billing page, the promotion price from IT Home's report of October 30, 2026, and each other provider's figure from that company's own page. Each SpecStream line describes the route as it answers on November 13, 2026.
- Baidu Qianfan, Baidu Search API referencecloud.baidu.com/doc/qianfan-api/s/Wmbq4z7e5, read Nov 13, 2026
- Baidu Qianfan, Baidu Search billingcloud.baidu.com/doc/qianfan/s/1mh4sv6c4, read Nov 13, 2026
- IT Home, Baidu search API promotion priceithome.com/1/020/165.htm, read Nov 13, 2026
- Alibaba Cloud IQS, billing for Web Searchhelp.aliyun.com/en/document_detail/2862023.html, read Nov 13, 2026
- Tavily API creditsdocs.tavily.com/documentation/api-credits.md, read Nov 13, 2026
- Brave Search APIbrave.com/search/api/, read Nov 13, 2026
- SpecStream benchmarksspecstream.ai/benchmarks, read Nov 13, 2026
- SpecStream pricingspecstream.ai/pricing, read Nov 13, 2026
- SpecStream for agentsspecstream.ai/agents.md, read Nov 13, 2026




