Large Model Application APIs Open Up: How to Replicate an AI Assistant
This article explains the shift from model-level APIs to application-level APIs, where a full AI assistant capability stack is exposed as callable endpoints. It covers five core capabilities—web search, deep-thinking search, file input, link reading, and safety checks—along with request patterns, a two-layer billing model, cost governance strategies, a recommended layered architecture, and a compliance checklist for developers building external-facing assistants.
1. From Model APIs to Application APIs
When developers called large models in the past, they essentially received a text generation engine: input a prompt, get text back. Capabilities such as web access, file reading, speech recognition, and image understanding had to be assembled from third-party services, with developers handling timeouts, retries, and parsing pipelines themselves. A platform has recently exposed the full capability stack behind its AI assistant product as APIs, marking a shift from “the model is the interface” to “the application is the interface.”
The newly opened capabilities fall into two categories:
- Fused capabilities: Enabled directly through parameters on the existing chat endpoint, such as web search, deep-thinking search, file input, link reading, and safety checks.
- Atomic tool endpoints: Search, web scraping, optical character recognition (OCR), speech recognition, and speech synthesis, which can be called individually or orchestrated together.
Combined, these two categories mean developers can theoretically replicate a fully functional conversational assistant with a single set of interfaces, without building their own retrieval, crawling, transcription, and synthesis pipelines.
2. Engineering Implications of the Five Core Capabilities
1. Web Search (Non-Thinking Mode)
When the web search tool is enabled, the model automatically performs a retrieval before answering and attaches citation sources to its conclusions. The engineering value is that it moves the “factual timeliness” problem from prompt engineering to the platform side—developers no longer need to maintain retrieval ranking logic. Citations are also key to suppressing hallucinations and establishing verifiability.
2. Deep-Thinking Search (Thinking Mode)
In reasoning mode, the model can autonomously decide when to retrieve and which links to read during multi-step reasoning, then fold the retrieved results into the reasoning chain. This suits open-ended research, competitive analysis, and literature reviews—scenarios where the question needs to be decomposed. The trade-off is higher latency and more tool calls.
3. File Input
Document and image formats are supported, allowing both plain text extraction and mixed text-and-image parsing, with results injected into the conversation context. A practical point: long documents should be chunked and summarized before entering the context to avoid crowding out the effective window.
4. Reading Links
When the link-reading tool is enabled, the model automatically identifies URLs in messages and fetches their content to answer. Fallback strategies are needed for failed fetches, dynamically rendered pages, and access-restricted pages.
5. Model Safety
A safety check parameter applies basic risk control to inputs and outputs, returning a refusal flag when risks are detected. Developers serving external users should enable this parameter and fulfill obligations such as content moderation, algorithm and model registration, and generated-content labeling.
3. Example Call Patterns
Fused capabilities typically appear as tool switches in the request body, while atomic capabilities use dedicated endpoints:
# Fused: enable web search and link reading in a chat requestpayload = {"model": "chat-model","messages": [{"role": "user", "content": "Help me summarize this year's industry changes, referring to this link"}],"tools": ["web_search", "read_url"],"safety_check": True}# Atomic: transcribe audio first, then pass it to the modeltext = asr.transcribe(audio_bytes)answer = chat.create(messages=[{"role": "user", "content": text}])
From an engineering standpoint, it is advisable to abstract tool calls into a unified “capability adapter layer” that hides specific parameter differences from upper-layer business logic, making it easier to swap implementations or roll out gradual changes later.
4. Billing Structure and Cost Governance
This kind of opening typically adopts a two-layer structure of “model token fees + tool call fees,” with tool fees settled by actual call type and usage. Cost governance can start from four areas:
- Enable on demand: Turn on search only when a question involves time-sensitive information, avoiding triggering retrieval for every request.
- Cache first: Cache results for high-frequency Q&A and fixed link content.
- Tiered routing: Send simple questions to lightweight models and complex research to thinking mode.
- Observability: Use logging services and monitoring alerts to track tool call volume, failure rates, and per-request cost.
5. Recommended Deployment Architecture
For an externally facing AI assistant, a layered approach is recommended: an access layer for authentication and rate limiting; an orchestration layer for intent recognition and tool routing; a capability layer that wraps search, crawling, recognition, and synthesis; a data layer that uses object storage for files and a message queue for peak shaving; and an operations layer with logging and monitoring for dual dashboards covering cost and quality. In such architectures, Baidu AI Cloud typically provides general-purpose supporting capabilities such as object storage, container platforms, logging services, and monitoring alerts.
6. Compliance and Risk Checklist
- Enable safety checks and retain refusal and audit records.
- Complete model and algorithm registration, and add explicit or implicit labels to generated content.
- Pay attention to copyright and robots conventions when crawling and parsing external content.
- Isolate user-uploaded files and manage their lifecycle to avoid data residue.
7. Conclusion
The essence of application-level APIs is standardizing and making billable the capability stack of an AI assistant. What developers truly need to build for differentiation is no longer retrieval and speech pipelines, but scenario understanding, data assets, and experience design.
