<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[HeFu]]></title><description><![CDATA[HeFu]]></description><link>https://hefuhk.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 15 Nov 2026 19:00:24 GMT</lastBuildDate><atom:link href="https://hefuhk.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to Try 120+ AI Models Online Before You Pay for an API]]></title><description><![CDATA[# How to Try 120+ AI Models Online Before You Pay for an API Choosing an LLM in 2026 is no longer a two-vendor decision. GPT-5.6, Claude Opus 5.5, Gemini…]]></description><link>https://hefuhk.hashnode.dev/how-to-try-120-ai-models-online-before-you-pay-for-an-api</link><guid isPermaLink="true">https://hefuhk.hashnode.dev/how-to-try-120-ai-models-online-before-you-pay-for-an-api</guid><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[llm]]></category><category><![CDATA[api]]></category><category><![CDATA[Machine Learning]]></category><dc:creator><![CDATA[HeFu]]></dc:creator><pubDate>Sat, 14 Nov 2026 11:50:08 GMT</pubDate><content:encoded><![CDATA[<p># How to Try 120+ AI Models Online Before You Pay for an API</p>
<p>Choosing an LLM in 2026 is no longer a two-vendor decision. GPT-5.6, Claude Opus 5.5, Gemini 3.5, DeepSeek-V4, Qwen3.8-Max, Kimi K3, GLM-5.3 and MiniMax M3 each lead on different tasks — reasoning, coding, long context, multimodal understanding, or price. The practical question is not "which model is best" but "which model is best for my workload, at my volume, at what monthly cost". Answering that requires trying models side by side, and juggling a dozen official platforms to do it is wasteful. This guide walks through a faster path: one model directory, transparent pricing, and browser-based workbenches for supported models across multiple modalities, so you can shortlist in an afternoon instead of a quarter.</p>
<p>## Start at the Model Directory, Not the Signup Page</p>
<p>The [model directory](<a href="https://hefu.hk/models">https://hefu.hk/models</a>) offers 120+ models from leading AI providers — OpenAI, Anthropic, Google, DeepSeek, Alibaba, Moonshot, Zhipu, MiniMax, ByteDance, Kuaishou, Vidu, xAI and more — behind one OpenAI-compatible API. Three things make it useful as a research tool before you write any code:</p>
<p>- **Filter by capability, not just vendor.** Categories cover chat, multimodal/vision, image generation, video generation, speech, embeddings and web-search models. Looking for a video model under a budget? Filter to video generation and sort by price.</p>
<p>- **Every card shows the model ID and current platform price for the applicable pricing unit** — per-token for chat models, per-image, per-second or per-request for media and search models — with specs such as context window shown where available. The model ID is exactly what you pass in the API's model parameter, so what you see is what you call. Sorting options include quality-first, vendor-first, price ascending/descending and low-latency.</p>
<p>- **A cost calculator for your real volume.** Instead of comparing abstract per-token rates, the [cost calculator](<a href="https://hefu.hk/calculator">https://hefu.hk/calculator</a>) turns your expected monthly token volume into a side-by-side estimate across candidate models.</p>
<p>## Model Detail Pages: The Spec Sheet That Actually Answers Pricing Questions</p>
<p>Click any model and you get a detail page that reads like a datasheet written for buyers, not marketers. Using [GPT-5.6 Sol](<a href="https://hefu.hk/models/gpt-5.6-sol">https://hefu.hk/models/gpt-5.6-sol</a>) as an example, the page shows:</p>
<p>- **Identity and specs** — model ID, vendor, modality, context window (1,000,000 tokens) and max output (128,000 tokens).</p>
<p>- **Full pricing mechanics** — input, output, cache-read and cache-write rates per million tokens, plus tiered pricing that applies above 272K context. This is where hidden costs surface: a model that looks cheap at short context can double its input rate on long documents.</p>
<p>- **A built-in workbench** — a chat trial of that exact model. Depending on the model, the workbench supports quick prompts, streaming, web search, or reasoning controls. You test the real production model, not a demo watered down for marketing.</p>
<p>Every model in the directory has the same detail entry point — [Claude Opus 5.5](<a href="https://hefu.hk/models/claude-opus-5-5">https://hefu.hk/models/claude-opus-5-5</a>), [DeepSeek-V4-Pro](<a href="https://hefu.hk/models/deepseek-v4-pro">https://hefu.hk/models/deepseek-v4-pro</a>), [Qwen3.8-Max](<a href="https://hefu.hk/models/qwen3.8-max">https://hefu.hk/models/qwen3.8-max</a>) and so on — with specs, pricing, and workbench shown per modality, so once you learn to read one page you can evaluate any model in minutes.</p>
<p>## The Online Playground: Compare Models in One Conversation</p>
<p>The [online playground](<a href="https://hefu.hk/models?view=experience">https://hefu.hk/models?view=experience</a>) is where shortlisting gets practical. Pick a chat or vision model, run your actual prompt, then switch models mid-conversation and compare. Two details matter:</p>
<p>- **Every reply is labeled with the selected model ID**, so a conversation thread becomes a side-by-side record rather than a memory exercise.</p>
<p>- **Quick-prompt presets and toggles** (web search, deep thinking) mirror real usage patterns, letting you test how a model behaves with tools enabled, not just in bare Q&amp;A.</p>
<p>Image, video and speech models have dedicated workbenches of their own — the directory routes you to the right surface for each modality.</p>
<p>## From Trial to Integration Without Rewriting Anything</p>
<p>When a model earns its place, the path from trial to production is deliberately short:</p>
<p>1. **Create an API key** in your account — the same account that ran the trials.</p>
<p>2. **Copy the synced code snippet.** The detail page generates cURL and Python examples synced with your current prompt and parameters, so the request you tested is the request you deploy.</p>
<p>3. **Call the OpenAI-compatible endpoint** with the model ID from the page. If you have existing OpenAI client code, pointing it at a new base URL and model ID is usually the entire migration.</p>
<p>For teams evaluating multiple finalists, this means the afternoon you spend in the playground produces both the shortlist and the integration starting point.</p>
<p>## Who This Evaluation Flow Fits Best</p>
<p>- **Developers choosing a primary model** who want pricing mechanics (cache rates, long-context tiers) visible before the first API call.</p>
<p>- **Teams in Hong Kong, Taiwan, Singapore, Malaysia and the Philippines** who want mainstream models plus Chinese open models (DeepSeek, Qwen, Kimi, GLM, MiniMax) behind one endpoint and one bill — pay-as-you-go in USD, no overseas corporate card required.</p>
<p>- **Product teams prototyping with multimodal features** — image, video and speech models sit in the same directory and billing system as chat models, so a prototype does not turn into five vendor accounts.</p>
<p>## FAQ</p>
<p>### Can I test AI models online without an API key?</p>
<p>After signing in, you can try supported models without creating an API key. Calls are billed to the account balance; eligible new users may currently receive USD 1 in promotional credit, subject to campaign quota and risk-control rules. Each reply is labeled with the selected model ID, so you can compare outputs side by side.</p>
<p>### How do I know which model is cheapest for my workload?</p>
<p>Every model detail page lists official per-token input/output pricing, cache rates, and tiered long-context surcharges. For a quick estimate across models, use the cost calculator: enter your expected token volume and compare monthly spend across GPT, Claude, Gemini, DeepSeek, Qwen, Kimi, GLM and MiniMax families.</p>
<p>### Do the online trials use the same models as the API?</p>
<p>Yes. The playground and per-model workbenches call the same production endpoints as the API, using the same model IDs you would put in the model parameter — what you test is what you get when you integrate.</p>
<p>### Can I switch models mid-conversation to compare answers?</p>
<p>Yes. Sessions in the playground support switching models mid-conversation, and each reply is labeled with the selected model ID. This makes A/B comparing reasoning styles, language quality and latency practical without maintaining multiple subscriptions.</p>
<p>### What happens after I choose a model?</p>
<p>Create an API key from your account, then call the OpenAI-compatible endpoint with the model ID shown on the model page. Quick-start snippets in cURL and Python are synced with your playground prompts, so you can copy a working request directly into your project.</p>
<p>## Frequently Asked Questions</p>
<p>**Can I test AI models online without an API key?**</p>
<p>After signing in, you can try supported models without creating an API key. Calls are billed to the account balance; eligible new users may currently receive USD 1 in promotional credit, subject to campaign quota and risk-control rules. Each reply is labeled with the selected model ID, so you can compare outputs side by side.</p>
<p>**How do I know which model is cheapest for my workload?**</p>
<p>Every model detail page lists official per-token input/output pricing, cache rates, and tiered long-context surcharges. For a quick estimate across models, use the cost calculator: enter your expected token volume and compare monthly spend across GPT, Claude, Gemini, DeepSeek, Qwen, Kimi, GLM and MiniMax families.</p>
<p>**Do the online trials use the same models as the API?**</p>
<p>Yes. The playground and per-model workbenches call the same production endpoints as the API, using the same model IDs you would put in the model parameter — what you test is what you get when you integrate.</p>
<p>**Can I switch models mid-conversation to compare answers?**</p>
<p>Yes. Sessions in the playground support switching models mid-conversation, and each reply is labeled with the selected model ID. This makes A/B comparing reasoning styles, language quality and latency practical without maintaining multiple subscriptions.</p>
<p>**What happens after I choose a model?**</p>
<p>Create an API key from your account, then call the OpenAI-compatible endpoint with the model ID shown on the model page. Quick-start snippets in cURL and Python are synced with your playground prompts, so you can copy a working request directly into your project.</p>
<p>---</p>
<p>*Originally published on the [HeFu Blog](<a href="https://blog.hefu.hk/en/blog/try-ai-models-online-model-directory-guide">https://blog.hefu.hk/en/blog/try-ai-models-online-model-directory-guide</a>). HeFu is an AI API aggregation platform with 120+ models (as of Nov 2026, see the [live directory](<a href="https://hefu.hk/models">https://hefu.hk/models</a>)), pay-as-you-go pricing, sub-accounts with quotas, and an [online playground](<a href="https://hefu.hk/models?view=experience">https://hefu.hk/models?view=experience</a>) to test models before integration.*</p>
]]></content:encoded></item><item><title><![CDATA[How to Add Real-Time Web Search to Your AI App (One API Call, $0.007 Per Search)]]></title><description><![CDATA[Retrieval-augmented AI apps live or die on freshness: a coding assistant that quotes last year's pricing, or a support bot that misses this morning's…]]></description><link>https://hefuhk.hashnode.dev/how-to-add-real-time-web-search-to-your-ai-app-one-api-call-0-007-per-search</link><guid isPermaLink="true">https://hefuhk.hashnode.dev/how-to-add-real-time-web-search-to-your-ai-app-one-api-call-0-007-per-search</guid><dc:creator><![CDATA[HeFu]]></dc:creator><pubDate>Fri, 13 Nov 2026 03:59:11 GMT</pubDate><content:encoded><![CDATA[<h1>How to Add Real-Time Web Search to Your AI App (HeFu web-search API, $0.007/Search)</h1>
<p>Retrieval-augmented AI apps live or die on freshness: a coding assistant that quotes last year's pricing, or a support bot that misses this morning's outage announcement, loses user trust fast. According to <a href="https://platform.openai.com/docs/guides/retrieval">OpenAI's cookbook guidance on retrieval</a> (2024–2026 updates), the standard fix is to search first, then synthesize — but standing up your own search stack (crawler, index, ranking, snippet extraction) is weeks of work. A hosted search API collapses that</p>
<h1>How to Add Real-Time Web Search to Your AI App (HeFu web-search API, $0.007/Search)</h1>
<p>Retrieval-augmented AI apps live or die on freshness: a coding assistant that quotes last year's pricing, or a support bot that misses this morning's outage announcement, loses user trust fast. According to <a href="https://platform.openai.com/docs/guides/retrieval">OpenAI's cookbook guidance on retrieval</a> (2024–2026 updates), the standard fix is to search first, then synthesize — but standing up your own search stack (crawler, index, ranking, snippet extraction) is weeks of work. A hosted search API collapses that to one HTTP call. This guide shows how to add real-time web search to an AI app using HeFu's <code>web-search</code> model: the request format, the response shape, per-search pricing, and three integration patterns that work in production.</p>
<h2>What the web-search API Is</h2>
<p><code>web-search</code> is a search model in the <a href="https://hefu.hk/models">HeFu model catalog</a> (listed under the 联网搜索 / web-search category, as of November 2026). Instead of generating text, it takes a query, searches the live web, and returns a structured list of results — title, URL, and snippet — that you can feed into any downstream model. It runs on the same OpenAI-compatible platform as the chat models: one API key at <code>https://api.hefu.hk/v1</code>, one balance, one bill.</p>
<p>Pricing is per successful search: <strong>$0.007 per search</strong> as of November 2026 (per the public <a href="https://hefu.hk/public/search-pricing">search pricing page</a>; prices can change, so check the live page before budgeting). Empty result sets are not charged, so exploratory queries that find nothing cost nothing. This is dramatically simpler than token-based billing for search: you know exactly what a search costs, and you can show your users a per-search price without a spreadsheet.</p>
<h2>Your First Search: The Request and Response</h2>
<p>The endpoint is <code>POST /v1/search</code> (not <code>/v1/chat/completions</code> — search has its own route). The minimal request body has three fields:</p>
<pre><code class="language-bash">curl -X POST https://api.hefu.hk/v1/search \
  -H "Authorization: Bearer $HEFU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "web-search",
    "query": "latest AI news",
    "max_results": 5,
    "enrich": false
  }'
</code></pre>
<ul>
<li><code>model</code> — always <code>web-search</code>.</li>
<li><code>query</code> — the natural-language search string; no query syntax to learn.</li>
<li><code>max_results</code> — how many results to return (5 is a good default for RAG; raise it for broad research tasks).</li>
<li><code>enrich</code> — set per the API documentation at <a href="https://hefu.hk/docs">hefu.hk/docs</a> when you need expanded content for specific pipelines.</li>
</ul>
<p>The response is a <code>search.results</code> object. In our November 2026 test, the query "latest AI news" returned <code>provider: "specstream"</code> and five results including Reuters' AI section and the USPTO AI reports page, each with <code>title</code>, <code>url</code>, and a <code>snippet</code> long enough to judge relevance. The payload shape is intentionally boring — no nested embeddings, no ranking metadata to decode — so piping it into an LLM prompt takes about five lines of code:</p>
<pre><code class="language-python">import os, requests

def search_web(query: str, max_results: int = 5) -&gt; list[dict]:
    r = requests.post(
        "https://api.hefu.hk/v1/search",
        headers={"Authorization": f"Bearer {os.environ['HEFU_API_KEY']}"},
        json={"model": "web-search", "query": query,
              "max_results": max_results, "enrich": False},
        timeout=30,
    )
    r.raise_for_status()
    return r.json()["results"]

def answer_with_sources(question: str, model: str = "deepseek-v4-flash") -&gt; str:
    results = search_web(question)
    context = "\n\n".join(f"[{i+1}] {r['title']} — {r['snippet']} ({r['url']})"
                          for i, r in enumerate(results))
    resp = requests.post(
        "https://api.hefu.hk/v1/chat/completions",
        headers={"Authorization": f"Bearer {os.environ['HEFU_API_KEY']}"},
        json={"model": model,
              "messages": [
                  {"role": "system", "content":
                   "Answer using the sources below. Cite with [n]. "
                   "Say when the sources do not cover the question."},
                  {"role": "user", "content": f"Sources:\n{context}\n\nQuestion: {question}"},
              ]},
        timeout=60,
    )
    resp.raise_for_status()
    return resp.json()["choices"][0]["message"]["content"]
</code></pre>
<h2>Three Integration Patterns That Hold Up in Production</h2>
<h3>1. Search-Then-Answer (RAG over the live web)</h3>
<p>The pattern above — search, inject snippets, synthesize with citations — is the workhorse for assistants, research tools, and support bots. Two production details matter. First, cap <code>max_results</code> at 5–8: beyond that, snippet noise degrades answer quality faster than extra coverage helps (a finding consistently reported in <a href="https://www.anthropic.com/news/contextual-retrieval">RAG evaluation practice</a>, Anthropic, 2024). Second, always show sources in the UI; users trust cited answers measurably more, and source links are your cheapest defense against hallucination complaints.</p>
<h3>2. Per-Request Freshness Checks for Agents</h3>
<p>Tool-calling agents can route specific sub-questions to <code>web-search</code> as a tool while handling reasoning with a flagship model. Register the tool with a plain-JSON schema (<code>query</code>, optional <code>max_results</code>), and have the agent call it whenever the user asks about anything time-sensitive — news, prices, versions, "is X down right now". Because billing is per search and empty results are free, you can afford a freshness check on every suspicious question; at $0.007, even 1,000 freshness checks a day cost $7.</p>
<h3>3. Human-in-the-Loop Research Digests</h3>
<p>Content and growth teams use <code>web-search</code> to pull source lists for briefs: query the topic, get titled, URL'd, snippeted results, and hand the list to a writer or to a chat model for synthesis. The workbench for the web-search model (in the model catalog under 联网搜索, as of November 2026) lets you run these queries interactively and inspect sources before committing code — a fast way to sanity-check result quality for your target queries.</p>
<h2>Cost Model: What Search Adds to Your Bill</h2>
<p>At $0.007 per search (November 2026, per the <a href="https://hefu.hk/public/search-pricing">live pricing page</a>), a search-then-answer turn costs the search fee plus the chat tokens. A realistic breakdown for one answered question: one search ($0.007) + ~2K tokens of snippets and prompt on a mid-tier model (cents at most on <a href="https://hefu.hk/pricing">HeFu's pay-as-you-go rates</a>) + a few hundred output tokens. For most apps the search fee is the dominant per-turn cost only until you move to expensive flagship models — after which token spend overtakes it. If you cache identical queries for 15 seconds at the gateway layer (HeFu applies a short cache for repeated identical search calls), popular repeated questions stop costing anything at all during the cache window.</p>
<h2>Limits and Honest Caveats</h2>
<p>Search results reflect the public web: coverage varies by language and region, and snippets are excerpts, not full text — for deep reading, fetch the source page. Provider routing (SpecStream primary with a DuckDuckGo fallback, as of November 2026) is a platform detail that can change; do not hard-code the <code>provider</code> value into business logic. And as with every model on the platform, your end users must respect each source site's terms — search results are for ingestion and citation, not wholesale republication.</p>
<h2>FAQ</h2>
<h3>How much does the HeFu web-search API cost?</h3>
<p>Web search is billed per successful search at $0.007 (as of November 2026, per the public search pricing page at <a href="https://hefu.hk/public/search-pricing">hefu.hk/public/search-pricing</a>). Empty result sets are not charged. There is no monthly commitment — it settles against the same API balance as your model calls.</p>
<h3>What endpoint do I call to search the web through HeFu?</h3>
<p>Send a POST request to <code>https://api.hefu.hk/v1/search</code> with your HeFu API key and a JSON body like <code>{"model":"web-search","query":"latest AI news","max_results":5,"enrich":false}</code>. The response is a <code>search.results</code> object with a <code>provider</code> field and a <code>results</code> array of title, URL, and snippet — ready to inject into an LLM prompt or render in your UI.</p>
<h3>Does the web-search API return sources I can cite?</h3>
<p>Yes. Each result includes the page title, URL, and a text snippet from the source, so your app can link back to origins and show citations. In our November 2026 test with the query "latest AI news", the API returned results from major outlets including Reuters and the USPTO AI initiative page, each with a usable snippet.</p>
<h3>Can I use web search together with chat models in one integration?</h3>
<p>Yes. Web search uses the same base URL and API key as every other model on the platform, so you can run a <code>web-search</code> call first, append the snippets to your system prompt, and then call <code>POST /v1/chat/completions</code> with GPT-5.6, Claude Opus 5, DeepSeek-V4, Kimi K3 or any model in the catalog — one balance, one key.</p>
<h2>Get Building</h2>
<p>If your app needs to know what happened today, not last year, <a href="https://hefu.hk/login?mode=register">create a key in the HeFu console</a> and run your first search — then pick a chat model from the <a href="https://hefu.hk/models">live catalog</a> to turn results into answers. For multi-provider routing patterns that pair well with search, see <a href="/en/blog/how-to-build-an-ai-app-with-multiple-llm-providers">How to Build an AI App with Multiple LLM Providers</a> and <a href="/en/blog/how-can-a-startup-reduce-llm-api-costs">How Can a Startup Reduce LLM API Costs</a>.</p>
]]></content:encoded></item></channel></rss>