Large Model API Suite: A Technical Guide to Rebuilding a Complete Chat Application
This article examines a major shift in how developers consume large language models: application-level capabilities are being moved down into API parameters. It breaks down the typical capability set—including thinking mode, web search, file input, link reading, OCR, ASR, TTS, and safety checks—explains what happens server-side during a request, and shows illustrative calls across common API formats. It then covers engineering practices such as scenario-based tool routing, citation handling, context budgeting, cost observability, and compliance, along with common pitfalls and how to avoid them. The goal is to help developers decide how to restructure their own application architecture rather than rebuild every supporting component themselves.
1. Introduction: From Model APIs to Application-Capability APIs
Over the past two years, the main way developers integrated large models was to assemble prompts in their own code, manage multi-turn context, and implement retrieval and tool calling themselves. This approach is flexible, but it involves a great deal of repetitive work: nearly every team ends up rewriting web retrieval, page fetching, document parsing, speech transcription and synthesis, and output moderation.
A clear recent change in the industry is that a cloud vendor has exposed the full set of capabilities that previously existed only inside its own chat application, turning them into parameter switches on a general-purpose API. Developers can enable capabilities such as deep thinking, web search, file input, and web page reading simply by turning on the corresponding parameters in an existing request. Lower-level voice and vision capabilities (OCR, ASR, TTS) are also offered as standalone endpoints that can be called individually or combined. Tool calling and context assembly are handled server-side.
This article does not evaluate any specific product. Instead, it abstracts the change into a general technical question: when a model service pushes application-layer capabilities down into interface-layer parameters, how should developers restructure their application architecture?
2. Capability Breakdown: What the API Suite Includes
2.1 Conversation-Enhancement Capabilities (Parameter Switches)
- Thinking mode: The model performs multi-step reasoning before answering, which suits math, coding, and complex planning tasks.
- Web search: Once a search-tool parameter is enabled, the model automatically issues web or image searches based on the question and answers using the retrieved results with citations. In thinking mode, it can decide on its own when to go online and which pages to read during multi-step reasoning.
- File input: Supports uploading formats such as PDF, Office documents, and images, which are then extracted as plain text or parsed as mixed text and images and added to the context.
- Link reading: Once a link-reading tool parameter is enabled, the model automatically detects URLs in messages, fetches the main content, and answers in context.
2.2 Standalone Low-Level Capabilities (Independent Endpoints)
OCR (image text recognition), ASR (speech to text), and TTS (text to speech) are provided as independent endpoints. They can be called on their own or orchestrated into a pipeline, for example: voice question → ASR → model reasoning → TTS → spoken response.
2.3 Safety Verification
Once a safety-check parameter is enabled, the server performs basic risk review of model inputs and outputs and returns a refusal flag when a risk is detected. For developers offering services to the public, this type of parameter is not optional but a compliance prerequisite.
3. Architecture View: What Happens Server-Side During a Request
Chaining the capabilities above together, the server-side processing path looks roughly like this:
User request→ Upfront input safety check→ Intent and tool routing (whether search / link reading / file parsing is needed)→ Context assembly (conversation history + file parsing results + retrieved snippets + citations)→ Model inference (optional thinking mode, multi-step loop)→ Output safety review→ Return answer + citations + risk flag
The key engineering implication is: context assembly has moved from the client to the server. This has three direct consequences.
First, client code becomes significantly thinner. The retrievers, parsers, and fetchers that had to be maintained in-house can be retired.
Second, controllability decreases. Developers have weaker direct control over recalled content, truncation strategy, and citation ordering, so they need to add “observability” on the application side: log which tools were triggered, what was recalled, and what was ultimately cited.
Third, failure modes change. The problem shifts from “my retrieval returned nothing” to “a server-side tool call timed out or was rate-limited,” which requires new retry and fallback designs.
4. Interface Formats and Sample Calls
Such capabilities are typically offered across multiple mainstream interface formats (message-based, response-based, and chat-completion-based) to accommodate legacy systems with different migration costs. An illustrative call looks like this (pseudocode; refer to the official documentation for parameter names):
resp = client.chat.completions.create(model="<your-model-name>",messages=[{"role": "user", "content": "Summarize the core risks in this annual report"}],tools=[{"type": "web_search"}], # Enable web searchextra_body={"thinking": {"type": "enabled"}, # Enable thinking mode"safety_check": True # Enable input/output review},)print(resp.choices[0].message.content)print(resp.choices[0].message.annotations) # Citation sources
File input generally follows a two-step “upload first, then reference” flow:
f = client.files.create(file=open("report.pdf", "rb"))resp = client.chat.completions.create(model="<your-model-name>",messages=[{"role": "user", "content": f"Draw a conclusion based on {f.id}"}],)
Voice and vision paths are orchestrated with independent endpoints:
text = asr.transcribe(audio_bytes) # Speech to textanswer = llm.chat(text) # Model reasoningspeech = tts.synthesize(answer) # Text to speech
5. Engineering Practice Essentials
1. Grade tool switches by scenario. Not every question needs web access. A lightweight router is recommended: route time-sensitive questions and fact-checking to search; route private documents to file input; route given links to link reading; and enable only thinking mode for pure reasoning tasks. Enabling everything by default significantly increases latency and cost.
2. Always return and display citations. Answers from web search and link reading should retain a source list. This is both a credibility issue and the basis for later accountability and correction.
3. Manage the context budget explicitly. Parsed files and web page bodies are both long, so set a per-turn injection limit and a history-trimming strategy to avoid crowding out the effective window.
4. Never omit safety parameters. If the application serves the public, enable input and output review and handle refusal flags; also fulfill obligations such as content safety review, registration related to generative models, and labeling of generated content as required by regulation. It is advisable to provide a friendly fallback for refusals at the UI layer rather than throwing the raw flag at users.
5. Make cost observable. Thinking mode and multi-round web access amplify token and tool-call volume, so budget and alert on “average cost per task” rather than “unit price,” and connect logging services and a monitoring and alerting system.
6. Reuse the ideas in the official open-source demo on the frontend. A common industry practice is to open-source a lightweight frontend example alongside the API, with support for importing conversation history. Developers can use it to quickly build an interface close to the official application experience, then replace it with their own business components.
6. Common Pitfalls and How to Avoid Them
- Treating server-side tools as deterministic capabilities: Retrieval results are unstable, so the business logic must allow for a “not found” branch.
- Ignoring the latency of multi-step reasoning: Response time grows several times over in thinking mode, so streaming output and progress indicators are needed.
- Variations in file parsing quality: Scanned documents and complex tables parse with limited accuracy, so OCR and layout restoration may be needed first.
- Conflict between compliance and experience: Overly strict review can wrongly block legitimate questions, so an appeal and allowlist mechanism should be established.
7. Conclusion
Pushing capabilities down into parameters signals that model services are becoming “application infrastructure.” The real requirement for developers is to shift their energy from repeatedly reinventing the wheel to scenario routing, observability, cost control, and compliance governance. When using general-purpose large model services from platforms such as Baidu AI Cloud, it is likewise advisable to first select capabilities using the architectural layering method in this article, then gradually enable tool switches, avoiding the latency and cost overruns that come from enabling everything at once.
