Large Model Capability APIs: How Anyone Can Build a Super App
This article explains how exposing built-in capabilities such as web search, deep research retrieval, file parsing, link reading, and voice interaction as API parameters changes AI application development. It breaks down the input and output contract of each tool, walks through a reference backend architecture with orchestration pseudocode, and covers key engineering practices for latency, context budgeting, fallback, document Q&A, voice pipelines, observability, and cost. It also outlines governance and compliance boundaries, and recommends starting from a narrow high-frequency scenario and iterating with measurable metrics.
1. From a Single Chat Box to a Full Capability Set: What This Opening Changes
For a long time, a usable AI assistant product consisted of two layers: a general-purpose language model at the bottom, and a toolchain polished by the vendor inside its own official client on top. What users saw as “it can search, read files, open web pages, and hold a voice conversation” was essentially the client orchestrating multiple capabilities along a single conversation path. Once these capabilities are exposed as API parameters, the product shape changes fundamentally: capabilities are no longer tied to a specific client but become foundational resources that any application can call.
For developers, this means three things. First, the capability boundary expands from “what the model can say” to “what the model can do,” upgrading a question-answering system into an agent with tool-use ability. Second, the engineering focus shifts from “implementing tools” to “orchestrating tools,” since retrieval, parsing, and voice stages can directly reuse server-side implementations. Third, the battleground for product differentiation moves forward to scenario design, interaction experience, and data feedback loops, rather than repeatedly rebuilding underlying capabilities.
It is worth stressing that open APIs do not mean zero cost. Tool calls introduce extra latency, failure rates, and billing dimensions. How to balance experience against cost is the core engineering question explored in the rest of this article.
2. Capability Breakdown: What Each of the Five Tool Types Solves
Abstracted out, these capabilities fall into five general-purpose tool types. Understanding their input and output contracts is the prerequisite for designing orchestration logic.
- Web search: the input is a query rewritten by the model, and the output is candidate web page snippets plus source information. Its value is filling the model’s gaps in timeliness and factual accuracy, at the cost of introducing external uncertainty.
- Deep research retrieval: aimed at questions that require multiple rounds of evidence gathering, it first decomposes sub-questions, then iteratively retrieves and filters, and finally consolidates the evidence. It suits research-style Q&A and not casual chat.
- File parsing: converts unstructured documents into searchable structured text, typically including layout restoration, table extraction, and chunking. Parsing quality directly determines the ceiling of subsequent Q&A.
- Link reading: given a URL, it fetches the main content and removes noise, compressing a long document into a summary or segments that fit into the context.
- Voice interaction: covers both speech recognition and speech synthesis, with a focus on streaming responses, sentence-splitting strategy, and interruption handling.
3. Reference Architecture: What a Request Goes Through on the Backend
A practical implementation is usually divided into an access layer, an orchestration layer, a capability layer, and a governance layer. The orchestration layer is the design focus, because it decides “when to use a tool, which tool to use, and what to do on failure.”
Client↓ streaming connectionAccess layer (auth / rate limiting / session persistence)↓Orchestration layer (intent detection → tool selection → context assembly → result fusion)↓ ↓ ↓Search service Parsing service Voice service↓Governance layer (logging / metrics / cost / content safety)
The orchestration layer can be described with pseudocode for its main logic, where the emphasis is on “first decide whether a tool is needed, then decide whether to call in parallel”:
def handle(query, session, files):plan = planner.classify(query) # chit-chat / factual Q&A / research / document Q&Aif plan.kind == "chat":return llm.stream(query, session)tasks = []if plan.needs_web:tasks.append(search(query=plan.rewrite(query), top_k=6))if files:tasks.append(parse_and_index(files)) # parse + chunk + vectorizeresults = parallel(tasks) # run in parallel to cut latencycontext = assembler.pack(results, budget=plan.token_budget)return llm.stream(query, session, context=context, tools=plan.tools)
Three easily overlooked details matter here: query rewriting determines recall quality; context assembly must enforce a budget, otherwise long documents will crowd out the conversation history; and streaming responses should be decoupled from the tool-calling stage, emitting a “searching” status first so users do not face a long blank screen.
4. Engineering Implementation Essentials
Latency governance. Tool calls are the main source of serially stacked delay. Practical options include parallel calls, caching retrieval results, reusing results for high-frequency questions, and setting differentiated timeouts per intent. It is recommended to define separate metrics for “time to first token” and “full answer time” instead of looking only at averages.
Context budget. Allocate the limited window across system instructions, conversation history, retrieval evidence, and user input, with a cap for each category. Evidence snippets should keep source identifiers so the answer can provide verifiable citations.
Failure fallback. External capabilities will inevitably fluctuate. The design needs three levels of fallback: if the primary search fails, switch to a backup search; if search is entirely unavailable, degrade to a pure model answer and clearly state the limitation; if parsing fails, prompt the user to change the format. Fallback paths must be observable and must not fail silently.
Document Q&A pipeline. Parsing, chunking, indexing, recall, and reranking are the standard five steps. Chunking must balance semantic completeness against recall granularity, and reranking can significantly improve “answering the wrong question.” Indexes and original files are best stored in object storage, with task scheduling handled by a message queue to smooth out peaks.
Voice pipeline. Both recognition and synthesis should support streaming, and the sentence-splitting strategy affects naturalness. Interruption and silence-detection rules must also be defined clearly to avoid echo and false triggers.
Observability and cost. For each request, log the number of tool calls, the time spent at each stage, input and output size, and cache hits, and close the loop with a logging service plus monitoring and alerting. Cost optimization should start with “reducing ineffective tool calls” rather than compressing model capability.
5. Governance and Compliance Boundaries
Opening up capabilities also widens the boundary of responsibility. On the application side, teams need content safety filtering, two-way review of inputs and outputs, protection of minors, and minimal data collection. When user documents are involved, storage location, retention period, and deletion mechanisms must be defined. Citing external web pages requires source attribution, to avoid presenting unverified content as fact. If the application serves the public, routine requirements such as generated-content labeling, a privacy policy, and registration may also apply. Technically, it is advisable to make safety policies an independent, pluggable module decoupled from the orchestration logic, so they can be adjusted quickly as rules change.
6. Conclusion
When underlying capabilities are opened up as parameters, the barrier to building a fully functional intelligent application drops sharply, and real competition returns to scenario selection, orchestration quality, and governance. Developers are advised to start from a narrow, high-frequency scenario, first stabilize the search and document Q&A pipelines, then gradually layer on voice and multi-round research capabilities, driving iteration with observable metrics. If you need elastic compute, object storage, message queues, and monitoring and alerting as infrastructure support, you can build on the general cloud products offered by Baidu AI Cloud and focus your energy on the product and the experience itself.
