LLM Application API Opened Up: How to Replicate an AI Assistant
This article examines the shift from model-only APIs to application-capability APIs, where web search, deep reasoning search, file input, link reading, and safety controls are exposed as API options and standalone tools. It breaks down the five core capabilities, outlines a reference request pipeline, explains the three-part cost model beyond token fees, and provides a compliance and launch checklist for developers building assistant-style applications.
1. Background: From Model APIs to Application Capability APIs
Over the past two years, calling a large language model has mostly meant a single pattern: text in, text out. The model only generated content, while capabilities such as going online, reading files, opening links, and speaking had to be assembled from scratch by developers. The industry has recently shown a clear architectural shift: a cloud vendor has exposed the peripheral capabilities of its AI assistant product as APIs, integrating web retrieval, deep reasoning retrieval, file input, and link reading into the existing model interface, and additionally offering standalone tool interfaces for search, web page fetching, OCR, speech recognition, and speech synthesis. The vendor even claims that developers can replicate a complete assistant application 1:1.
The real value of this for developers is not “another model release” but a shift in capability boundaries: retrieval-augmented pipelines, document parsing pipelines, and multimodal input pipelines that previously required three to five teams and weeks of work are now compressed into a few parameter switches and tool orchestration. Setting aside specific product attributes, this article treats the topic as a general technical question: once a model vendor exposes application-layer capabilities as APIs, how should developers design architecture, control cost, and meet compliance requirements?
2. A Technical Breakdown of the Five Core Capabilities
2.1 Web Search (Non-Thinking Mode)
When the general retrieval tool parameter is enabled, the model first decides whether external information is needed before reasoning. If it is, the model automatically issues a web or image search and attaches citation sources to the generated result. Engineering-wise, this is equivalent to four steps: intent detection, query rewriting, retrieval recall, and citation alignment. Developers should note that citations must align at the sentence level with the generated text; otherwise, the problem of “having citations that do not support the answer” amplifies hallucination.
2.2 Deep Thinking Search (Thinking Mode)
With reasoning mode enabled, the model embeds retrieval into a multi-step reasoning loop: it decomposes the question, retrieves, reads, identifies information gaps, and retrieves again until it converges. This is essentially the productization of a ReAct-style “thought-action-observation” loop. The key to implementation is setting a maximum iteration count and a timeout budget so that long-tail questions do not drag down response time.
2.3 File Input
Supported formats include PDF, Office documents, and images, with two levels of parsing: plain text extraction and layout-aware parsing that keeps text and images in place. The former suits text-intensive materials such as contracts and reports; the latter preserves layout and chart positions, making it suitable for financial reports and manuals. The engineering recommendation is to chunk and build summary indexes for large files first, then inject context on demand, rather than filling the context window all at once.
2.4 Link Reading
When the link-reading tool is enabled, the model automatically detects URLs in the message, fetches the main content, and performs structured cleaning (removing ads and navigation while preserving heading and paragraph hierarchy) before answering with context. The key risk here is prompt injection: web content may hide text such as “ignore previous instructions,” so instruction isolation and content labeling must be applied after fetching.
2.5 Model Safety
Basic input and output risk-control switches are provided, returning a refusal flag when risk is detected. For developers offering services to the public, this is a mandatory item, not an optional one; they must also fulfill legal obligations such as content moderation, large model registration and filing, and generated content labeling.
3. Reference Architecture: The Full Path of a Single Request
User request├─ Input safety check (input risk control)├─ Parameter orchestration layer: thinking mode / retrieval tools / link reading / file parsing├─ Model inference (entering a multi-step retrieval loop when needed)├─ Tool calls: search, fetch, OCR, ASR, TTS├─ Output risk control + citation alignment check└─ Generated content labeling → return
Illustrative call code (pseudocode, expressing orchestration logic only):
resp = client.chat.completions.create(model="<model-name>",messages=[{"role": "user", "content": question}],tools=[{"type": "web_search"}], # Web retrievalextra_body={"read_url": True}, # Link readingsafety_check=True, # Input and output risk control)print(resp.choices[0].message.content, resp.citations)
4. Cost Model: Tool Fees Beyond Tokens
The vendor states clearly that when extended capabilities are used, tool invocation fees apply by tool type and actual usage, in addition to model token fees. Developers should maintain a three-dimensional cost ledger:
- Token cost: rises significantly with thinking mode and multi-round retrieval, requiring context compression;
- Tool invocation cost: search count, fetched pages, OCR pages, and voice duration are priced separately;
- Hidden cost: retries, timeouts, and cache hit rate.
Optimization measures include result caching (short-term reuse of identical queries), retrieval count limits, tiered model routing (simple questions go to lightweight models), and batch offline document parsing.
5. Compliance and Launch Checklist
- Safety checks must be enabled for public-facing services;
- Establish a content safety review mechanism with human fallback;
- Fulfill large model registration requirements and explicit/implicit labeling of generated content;
- Assess copyright and robots compliance for fetched content;
- Retain full-chain logs for auditing and traceback.
6. Conclusion
Exposing application capabilities as APIs downgrades “building an AI assistant” from an engineering project to a configuration project. Developers’ core competitiveness is shifting from “can it be built” to “is the orchestration rigorous, is the cost controllable, and is compliance closed-loop.”
