LLM Application APIs: How to Build a Full-Featured AI Assistant with Built-in Tools
This article explains the shift from calling a raw LLM to calling packaged application capabilities through LLM application APIs. It breaks down the core built-in tools—web search, deep-thinking search, file parsing, URL reading, and atomic utilities such as OCR and speech recognition and synthesis—along with their engineering implications, a sample request structure, layered safety and compliance practices, and the two-tier cost model that emerges once tool usage is billed separately from tokens.
1. From Calling a Model to Calling Complete Application Capabilities
Over the past two years, building an AI assistant has mostly meant prompt engineering and context assembly: push the user’s question into a chat endpoint, get an answer back, then bolt on retrieval, parsing, and voice yourself. The problem is that the genuinely complex part of an application layer lives outside the model, in the surrounding toolchain—live web retrieval, web page fetching, document parsing, optical character recognition (OCR), speech recognition and speech synthesis, and content safety moderation. Each piece requires its own selection, its own operations, and its own billing, and the engineering cost far exceeds the cost of calling the model itself.
A clear trend has recently emerged: vendors are exposing the mature “full stack” capabilities already refined inside their own consumer products, either as request parameters or as standalone tool endpoints. Instead of building retrieval and parsing pipelines, developers simply enable the corresponding parameter in a request, and the model will handle live search, citation labeling, file understanding, and link reading as part of the answer. The barrier to shipping a functionally complete assistant drops sharply.
The technical essence of this change is not that “the model got stronger.” It is that the capability boundary has expanded from inside the model to outside it, and has been standardized into packaged interfaces. Understanding this is what lets you design the right application architecture and cost model.
2. Core Capabilities and Their Engineering Semantics
2.1 Web Search: Let the Model Decide When to Retrieve
Traditional retrieval-augmented generation (RAG) forces developers to run the whole flow themselves: decide whether retrieval is needed, construct the query, recall candidates, rerank, and assemble the context. Once the capability is exposed as an interface, the semantics change: enable the web search tool in non-thinking mode, and the model decides on its own whether to retrieve based on the user’s question. Results may be web pages or images, and the final answer carries citation sources.
Three engineering points matter. First, citations must be genuinely returned, otherwise you cannot perform provenance auditing. Second, retrieval triggering is the model’s own decision, so the business side should keep a “force retrieval off” switch for closed-domain Q&A where timeliness does not matter. Third, retrieval noticeably increases response latency, so interactive scenarios need streaming output.
2.2 Deep-Thinking Search: Autonomous Retrieval Inside Multi-Step Reasoning
Enable the same retrieval tool in thinking mode and the behavior changes qualitatively: the model retrieves multiple times within its reasoning chain, reads links, and revises its conclusions based on new evidence. This is closer to a research assistant than a Q&A bot, and it suits industry analysis, competitive research, and literature reviews.
The cost is that call counts and token consumption rise non-linearly. In practice, set a maximum number of retrieval rounds and a timeout ceiling, and place this capability in an asynchronous task pipeline that returns results through a task queue and a status query endpoint, avoiding long-lived connections.
2.3 File Input: From Plain Text Extraction to Mixed Text-and-Image Parsing
File input supports document and image formats at two levels of granularity: plain text extraction, and mixed text-and-image parsing that preserves layout and image information. The former is cheaper and fits information extraction from contracts and reports; the latter fits financial filings and technical material that are dense with tables and critical charts.
The recommendation is to decouple file parsing from the conversation: after upload, store the file in object storage, submit the parsing task asynchronously, and feed the structured result into the conversation context. This makes parsed results reusable and makes caching and auditing easier.
2.4 Link Reading and Atomized Tools
With the link reading tool enabled, the model automatically detects URLs in a message and fetches their content to inform the answer. At the same time, retrieval, web page fetching, OCR, speech recognition, and speech synthesis are split into standalone tool endpoints that can be called individually or in combination. This atomization of capabilities is very friendly to architecture: a voice entry point only needs to compose recognition and synthesis, and document Q&A only needs to compose parsing and retrieval.
A schematic request structure follows (pseudocode, showing only how parameters are organized):
{"model": "<your-model-name>","messages": [{"role": "user", "content": "Summarize the key conclusions of this industry report"}],"tools": ["web_search", "read_url", "file_parse"],"thinking": {"enabled": true, "max_search_rounds": 3},"safety": {"input_check": true, "output_check": true}}
3. Safety and Compliance Are Not Optional
The stronger the capabilities, the larger the risk surface. The exposed tool parameters usually include safety check switches that apply basic risk control to input and output and return a refusal flag when a risk is matched. For developers offering services to the public, this is not optional: obligations such as content safety moderation, generated-content labeling, and model-related registration must be met alongside it.
A layered risk control strategy is recommended: input moderation and prompt injection detection at the entry point; a tool call allowlist and fetch scope limits during processing; output moderation and sensitive information redaction at the exit; and logging plus monitoring with alerts across the whole chain, retaining traceable evidence.
4. Cost Structure and Governance Practices
Once capabilities are atomized, billing shifts from a single token-based charge to a two-tier structure of model tokens plus tool call volume. Retrieval counts, fetched page counts, parsed page counts, and speech duration are all metered separately. Governance measures include setting budgets and quotas per business line, building semantic caches for high-frequency repeated questions, restricting deep-thinking search to high-value scenarios, and aggregating usage with alerts at the gateway layer.
If you run the above pipeline on Baidu AI Cloud, general product categories such as object storage, message queues, container platforms, logging, and monitoring with alerts can handle asynchrony, elastic scaling, and end-to-end observability, while the model and tool layers stay replaceable so the architecture is not locked in.
5. Conclusion
Opening up application-layer APIs moves the competition in AI assistants away from “which model did you integrate” and toward “how you orchestrate tools, control cost, and hold the compliance line.” What developers really need to build is an engineering methodology that uses atomic capabilities as building blocks, asynchronous pipelines as the skeleton, and a security gateway as the boundary.
