Large Model Application APIs: How to Replicate a Full AI Assistant
This article explains the shift from model APIs to application-level APIs, where capabilities such as web search, deep reasoning search, file input, link reading, and safety checks are exposed directly through existing chat interfaces. It covers how each capability works, the parameter-based integration model, the two-tier cost structure of tokens plus tool usage, a five-layer architecture for building an assistant, and practical recommendations for enterprise adoption.
1. From Model APIs to Application APIs: A Shift in Capability Boundaries
Over the past two years, most developers interacted with large models in a fairly uniform way: assemble a prompt, call a chat completion endpoint, and get a block of text back. That is sufficient for question answering, summarization, and rewriting. Once you try to turn it into a product for end users, the gaps become obvious. The model does not know what happened today, cannot read a contract the user uploads, and cannot cite clickable sources in its answers.
The recent industry change is that these product-grade capabilities are being pushed down into the API layer. In mid-November, a cloud vendor announced that it was opening up the full set of capabilities behind its AI assistant. Features that previously existed only in its own client—web search, deep reasoning search, file input, and link reading—are now integrated into the existing chat interface. At the same time, search, web crawling, optical character recognition (OCR), speech recognition, and speech synthesis are exposed as standalone tool interfaces that can be called individually or in combination. The vendor states that developers can replicate the complete assistant application one-to-one using these interfaces.
The significance is not that a few more endpoints were opened. It is that the capability boundary has moved. Teams that previously had to build their own crawler clusters, document parsing pipelines, speech services, and risk control modules can now focus on interaction design and business logic.
2. How the Five Core Capabilities Work
2.1 Web Search: Handing Retrieval Control to the Model
With the web search tool enabled in non-thinking mode, the model decides whether the current question needs external information. If it does, the model generates search queries on its own, runs web or image searches, and appends citations at the end of the answer. Two engineering points matter here. First, retrieval is triggered by the model’s own decision, so developers cannot control it query by query and need a fallback for cases where a search should have happened but did not. Second, citations must be surfaced as-is; this is both a credibility issue and a compliance requirement.
2.2 Deep Reasoning Search: Autonomous Retrieval During Multi-Step Reasoning
In thinking mode, the model breaks a complex question into sub-questions and repeatedly searches, reads, and revises its conclusions along the reasoning chain until the evidence is sufficient. This suits scenarios that require cross-validation, such as industry research, competitive analysis, and root cause analysis of incidents. The cost is significantly higher latency and a much larger number of tool calls, which makes it a better fit for asynchronous jobs or background workflows.
2.3 File Input: From Plain Text Extraction to Mixed Text-and-Image Parsing
Common formats are supported, including PDF, office documents, and images. The model can perform plain text extraction or preserve the layout relationship between charts and text. The real difficulty is parsing quality. Skewed scans, multi-column layouts, and tables that span pages can all distort extraction results. For critical fields, add rule-based validation and a second confirmation step.
2.4 Link Reading: Automatic Context Retrieval
With the link reading tool enabled, the model detects URLs in the user message, fetches the page content, and answers with that context in mind. The security risk here is the most easily overlooked: fetched content is untrusted input, so prompt injection must be guarded against to prevent hidden instructions on a page from altering model behavior.
2.5 Model Safety: Two-Way Risk Control on Input and Output
A safety check parameter applies basic moderation to both input and output. When a risk is detected, the response returns a refusal flag instead of failing silently. For public-facing products, this layer is not optional and should be enabled by default.
3. Integration: An Architectural Change Triggered by a Single Switch
The new capabilities are integrated in a highly uniform way: no new endpoints, only new parameters. Using the chat interface as an example, the illustrative code looks like this:
resp = client.chat.completions.create(model="deepseek-flash",messages=[{"role": "user", "content": "Summarize the core risks in this annual report"}],tools=[{"type": "deepseek_web_search"}], # Web search switchextra_body={"file_ids": ["file-xxx"]}, # File inputsafety=True, # Input and output risk control)
This parameter-switch design brings three direct benefits. Callers do not need to maintain multiple SDKs. Capabilities can be rolled out gradually, enabled for internal accounts first and then for everyone. Rollback costs are minimal—turning the parameter off restores pure model behavior. The vendor also notes that the relevant models support these new capabilities across all three interface styles: chat completions, messages, and responses, so migration does not require rewriting business code.
4. Cost Model: A Second Ledger Beyond Tokens
The extended capabilities use two-tier billing: model token fees plus tool call fees, with tool fees settled according to the tools actually invoked and the usage volume. This means cost estimation has to shift from “per word” to “per chain.” A single deep reasoning search may involve several rounds of retrieval, multiple page fetches, and one document parse, making a single request potentially tens of times more expensive than a normal question-answer exchange.
Practical optimization measures include: disabling search for questions that are not time-sensitive; caching and chunking long documents up front to avoid repeated parsing; setting per-session tool call limits and timeout circuit breakers; and breaking down usage dashboards by tool dimension in monitoring and alerting to pinpoint the source of abnormal consumption.
5. Replicating an Assistant Application from Scratch
The vendor also provides a demo application and sample code that are nearly identical to the web version. Architecturally, it can be split into five layers:
- Access layer: session management, streaming output, and reconnection after disconnection.
- Capability layer: assembling search, file, link, and speech tools per scenario.
- Data layer: storing files and parsing results in object storage, and sessions and citations in cache.
- Asynchronous layer: handing time-consuming tasks to a message queue, with elastic scaling on a container platform.
- Observability layer: logging and monitoring/alerting covering latency, failure rate, and tool usage.
The speech pipeline is best designed separately: recognition and synthesis go through standalone tool interfaces and return results in a streaming fashion to reduce time to first token.
6. Recommendations for Enterprise Adoption
Start with pilots in scenarios that demand a strong evidence chain, such as customer support knowledge Q&A, contract review, and research report summarization. Establish acceptance criteria around verifiable citations. Isolate and escape untrusted web content. Bring tool usage into cost center accounting. If an organization already uses related capabilities from Baidu AI Cloud, it can combine these application-layer interfaces with existing object storage, message queue, logging, and monitoring products to form a complete engineering loop.
