LLM Application API Open Access: How to Replicate an AI Assistant
This article explains the shift from model APIs to application-capability APIs, where major LLM providers expose tools such as web search, deep reasoning search, file input, link reading, and safety checks directly through API parameters. It breaks down the technical behavior of each capability, outlines the common interface formats and declarative tool configuration, and covers billing models, cost governance, compliance obligations, and a practical rollout approach for building AI assistants.
1. The Trend: From Model APIs to Application-Capability APIs
Over the past two years, the mainstream way to build AI assistant applications has been “model API plus a self-built toolchain.” Retrieval, crawling, document parsing, and voice capabilities all had to be selected, deployed, and maintained by the developer. A clear recent shift is that leading LLM providers have begun exposing the full capability stack that was previously packaged inside their own applications, in the form of parameter switches. This lets developers obtain web search, file understanding, and link reading directly within a single model call.
The essence of this change is pushing application-layer capabilities down to the interface layer. For developers, the benefits fall into three areas:
- Shorter prototyping cycles: a retrieval-augmented pipeline that used to take days to set up can now be brought up by enabling a single tool parameter.
- Lower operational overhead: heavy engineering capabilities such as crawling, parsing, and voice are managed on the platform side.
- Flexible capability composition: tools can be triggered automatically during a conversation or invoked independently, making on-demand orchestration easier.
It is worth stressing that this openness does not mean “zero cost.” Tool calls introduce additional billing items, and offering services to the public also involves compliance obligations, both covered below.
2. A Technical Breakdown of Five Core Capabilities
2.1 Web Search: Embedding Retrieval into Generation
With the web search tool enabled outside reasoning mode, the model decides on its own, based on the semantics of the user’s question, whether to launch a web or image search, and attaches citation sources to the generated result. Three engineering points matter here: first, the accuracy of the trigger decision, to avoid over-searching on casual questions; second, traceable citations, where each conclusion in the answer should ideally link back to a specific source; third, result caching, where short-lived caching of high-frequency queries can significantly reduce cost.
2.2 Deep Reasoning Search: Autonomous Retrieval During Multi-Step Reasoning
In reasoning mode, the model breaks a question into several sub-questions and repeatedly searches, reads links, and reasons again within the reasoning chain until it converges. This “think-and-search” pattern suits complex fact-checking, competitive research, and technical selection comparisons. The practical recommendation is to set a maximum number of retrieval rounds and a timeout limit to prevent latency and runaway costs from divergent reasoning.
2.3 File Input: From Plain-Text Extraction to Mixed Text-and-Image Parsing
Supported formats typically cover PDF, common office documents, and images. Technically there are two tiers: plain-text extraction suits structured text such as contracts and reports, while mixed text-and-image parsing preserves layout and chart semantics, making it suitable for scanned documents, slides, and research materials with charts. In practice, pay attention to per-file size limits, pagination strategy, and context trimming strategy for long documents.
2.4 Link Reading: Automatic Detection and Context Retrieval
With the link-reading tool enabled, the model can identify URLs in the user’s message, fetch the main content, and answer in context. The key engineering issues here are the quality of main-content extraction (removing ads and navigation), the readability of dynamically rendered pages, and the design of fallback responses when fetching fails.
2.5 Model Safety: Two-Way Risk Control for Input and Output
The safety-check parameter performs basic moderation on both input and output and returns a refusal flag when a risk is detected. For developers, this is a “baseline guardrail,” but it cannot replace a self-built content moderation system, especially for public-facing applications.
3. Interface Formats and Parameter Design
These capabilities generally cover three mainstream interface formats: chat completion interfaces, message orchestration interfaces, and stateful response interfaces. They differ in how they manage context and in the granularity of streaming output, so developers can choose based on business needs. The sample code below is illustrative only, showing the idea of parameter switches rather than a platform-specific syntax:
resp = client.chat.completions.create(model="deepseek-flash",messages=[{"role": "user", "content": "Compare the use cases of three vector retrieval approaches"}],tools=[{"type": "deepseek_web_search"}, # Web / deep reasoning search{"type": "deepseek_read_url"}, # Link reading],stream=True,)
The key point is that tools are passed in as a declarative list and can be added or removed as needed; file input is usually carried by multimodal segments within the message; and safety checks are mostly boolean switches.
4. Billing Model and Cost Governance
The pricing logic for extended capabilities is typically “model token fees plus tool-call fees,” with tool fees settled by the type and usage of the tools actually called. Cost governance recommendations:
- Tiered routing: send simple Q&A to the plain model and enable retrieval only for complex questions.
- Round and frequency limits: set caps for deep reasoning search.
- Caching and deduplication: apply short-lived caching to retrieval results and fetched content.
- Observability: build monitoring and alerting dashboards for call volume, failure rate, and average cost per call for each tool type.
5. Compliance and Safety Obligations
Developers offering services to external users generally need to fulfill obligations such as content safety moderation, generative AI service registration, and AI-generated content labeling, in addition to enabling safety checks. It is advisable to reserve a moderation middleware layer and a label-injection point in the architecture to avoid rework before launch.
6. Implementation Recommendations
- Build a capability matrix first: map business problems to the five capability categories of “plain model / search / file / link / voice.”
- Then build fallback paths: define default response strategies when any tool fails.
- Finally, run canary releases and cost accounting, and gradually scale up.
Overall, API-based application capabilities have lowered the barrier to building an AI assistant to the “parameter-tuning” level, but real competitiveness still comes from engineering capabilities in scenario understanding, data governance, and cost and compliance.
