Building LLM Chat Apps: How Application Capability APIs Are Reshaping Development

    This article explains the shift from raw model APIs to application capability APIs that bundle ready-made features like web search, document parsing, link reading, and voice into a single interface. It breaks down the core capability modules, outlines a layered architecture and calling approach, and covers two-part billing, cost estimation, and compliance obligations—giving developers a practical reference for selection and self-development.

    1. From “Model APIs” to “Application Capability APIs”

    For a long time, the main thing large models exposed was a “bare model” interface: developers sent a prompt and the model returned text. Turning that into a genuinely usable product meant building and maintaining web retrieval, document parsing, web scraping, voice interaction, and more. That engineering effort often dwarfed the work of connecting to the model itself.

    A clear trend has recently emerged: vendors are integrating the “finished capabilities” that previously lived only inside their official apps into open APIs. Instead of implementing everything from scratch, developers can enable a parameter or attach a tool in the request and call the capability directly. This shifts the center of gravity in chat-app development from “building your own wheels” to “composing ready-made capabilities,” dramatically lowering the barrier to replicating a fully featured AI assistant.

    This article is not about any single vendor. Instead, it abstracts the common structure of these “application capability APIs” to help you with selection and self-development.

    2. Breaking Down the Core Modules of Capability APIs

    A production-grade chat application is typically supported by several kinds of capabilities. Understanding what each one solves helps you decide what to build yourself and what to call directly.

    1. Web Search (Non-Thinking Mode)

    When search is enabled for ordinary Q&A, the model can automatically launch web or image retrieval based on the user’s question and use the results as context, citing sources in its answer. The core pain point it solves is knowledge freshness: a model’s training data has a cutoff, and web retrieval lets answers cover the latest information, while cited sources improve credibility and traceability.

    2. Deep Thinking + Retrieval (Thinking Mode)

    Unlike simple search, retrieval in thinking mode happens during multi-step reasoning. The model autonomously decides within its reasoning chain when to go online, what to retrieve, and whether to read a specific link further, then aggregates the intermediate results into a final answer. It suits complex problem decomposition and research tasks that require cross-verification. The trade-off is higher latency and greater token and tool-call consumption, so it is typically enabled on demand.

    3. File Input and Parsing

    Support for uploading and parsing PDFs, office documents, images, and other formats usually comes in two forms:

    • Plain text extraction: pulls the text content from a document, suitable for text-only documents;
    • Layout-aware parsing: preserves layout structure, tables, and the positional relationships of images, suitable for complex layouts or documents with charts.

    The parsing result is injected into the conversation context, and the model can then answer based on the document. This makes “upload a contract/paper/report and ask questions” an out-of-the-box capability.

    When a user message contains a web link, the system automatically identifies and fetches the page content, then answers in context. The difference from web search is that search is the model proactively finding material, while link reading is targeted fetching of an address the user explicitly provides. It fits needs like “summarize this article for me” or “compare these two pages.”

    5. Standalone Tool Interfaces

    Beyond packaging capabilities into the chat interface, mature solutions usually also expose the underlying capabilities as standalone tools, commonly including:

    • Search (returns structured retrieval results)
    • Web scraping (returns page body content)
    • OCR (text recognition from images/scans)
    • Speech recognition (ASR, speech to text)
    • Speech synthesis (TTS, text to speech)

    The value of standalone interfaces is that they can be called individually or freely combined: you can use only OCR for receipt recognition, or chain ASR + chat + TTS into a voice assistant, without adopting the entire bundle.

    6. Model Safety Checks

    When serving external users, safety is a hard constraint. A safety-check parameter runs basic risk screening on the model’s input and output and returns a refusal flag when risky content is detected. This is both a product-quality issue and a compliance obligation.

    3. A Practical Calling and Architecture Approach

    The following illustrative pseudocode shows the typical way to “enable capabilities.” Note that this is a generic example; actual parameter names and field structures should follow the official documentation of the platform you choose.

    1. # Pseudocode: build a chat request with web search and link reading enabled
    2. request = {
    3. "model": "your-chat-model",
    4. "messages": [
    5. {"role": "user", "content": "Summarize the article at https://example.com and add the latest developments"}
    6. ],
    7. "tools": [
    8. {"type": "web_search"}, # enable web search
    9. {"type": "read_url"}, # enable link reading
    10. ],
    11. "safety_check": True, # enable safety check
    12. }
    13. response = client.chat(request)

    At the architecture level, organize the system into the following layers:

    1. Access layer: centralize authentication, rate limiting, retries, and timeouts, and hide differences between underlying interfaces;
    2. Capability orchestration layer: decide which tools to enable based on user intent (no web needed for plain Q&A; enable thinking + retrieval for research), avoiding the cost spikes that come from enabling everything blindly;
    3. Context management layer: handle the concatenation and trimming of parsing results, retrieval citations, and message history to control token usage;
    4. Security and audit layer: two-way screening of input and output, log retention, and masking of sensitive information;
    5. Observability layer: record the count, latency, and cost of each tool call for later optimization.

    This layering keeps changes concentrated in the access layer when you switch underlying vendors, leaving business logic largely unaffected and reducing vendor lock-in risk.

    4. Billing Models: Don’t Just Watch Tokens

    Billing for these capability APIs is usually two-part: on top of the model’s token cost, extended capabilities like web search, file parsing, and voice are charged separately based on the type and volume of tools actually called.

    So keep the following in mind when estimating costs:

    • Thinking mode + multi-round retrieval amplifies both token consumption and tool-call counts, and a single query can cost several times more than a plain one;
    • File parsing is billed by document size, so large documents call for preprocessing and chunking strategies;
    • Voice capabilities are usually billed by duration or character count, and real-time voice scenarios require evaluating concurrency costs.

    It’s advisable to run cost load tests with real traffic samples before launch and to set a “enable capabilities per scenario” policy in the orchestration layer rather than maxing out every request.

    5. Compliance Obligations Can’t Be Skipped

    Opening a chat application to external users means you take on content-safety responsibility. Common obligations include:

    • Enabling safety checks to screen input and output;
    • Performing content moderation, with mechanisms for handling and appealing violating content;
    • Completing any model registration or filing required by applicable regulations;
    • Labeling AI-generated content so users know it comes from AI.

    None of these are optional. No matter which vendor’s capabilities you use, compliance is a prerequisite for launch as long as you offer a service to the public.

    6. Summary and Selection Advice

    The emergence of capability APIs turns “replicating a complete AI assistant” from an engineering project into a matter of parameter configuration. For developers, the real competitive edge is no longer whether you can connect to a model, but:

    • Whether you can precisely orchestrate capabilities by scenario, balancing experience and cost;
    • Whether you can make context management, security auditing, and observability solid;
    • Whether you can design a portable layered architecture that avoids being locked to a single vendor.

    When deploying, you can also leverage general-purpose cloud capabilities from platforms such as Baidu AI Cloud (object storage, logging services, monitoring and alerting, content moderation, and similar categories) to handle file storage, call logs, and risk control, letting you focus your effort on business differentiation. For selection, evaluate capability completeness, billing transparency, compliance support, and documentation quality together, then validate real-world results with a small-scale prototype before deciding whether to scale up.