LLM Application API: Open Capabilities for Building Your Own AI Assistant

    This article explains the shift from raw model APIs to application-level capability APIs, allowing developers to assemble a full conversational AI assistant by enabling tools on demand instead of building everything from scratch. It breaks down five core capabilities—web search, deep-thinking search, file input, URL reading, and safety checks—along with parameterized API usage, a two-layer billing model, a reusable layered architecture, and common pitfalls to avoid.

    1. The Trend: From “Model API” to “Application Capability API”

    Over the past two years, developers primarily integrated large language models through a plain text generation endpoint: send a prompt, receive a completion. Every surrounding capability—web access, file reading, image understanding, speech—had to be assembled by the developers themselves. This led to three typical pain points:

    1. Fragmented capabilities: Search, crawling, document parsing, speech transcription, and synthesis often come from different vendors, each with its own API protocol, authentication method, and error codes.
    2. Complex context assembly: How to truncate retrieved web snippets, how to annotate citations, and how to merge them with multi-turn history lacks a unified standard, so results depend heavily on prompt engineering.
    3. Unclear compliance responsibility: Applications serving the public must handle content moderation, generated content labeling, and algorithm/model registration—obligations developers often overlook.

    Recently, the industry has seen a practice of pushing “application-layer capabilities” down to the API layer: capabilities such as web retrieval, autonomous retrieval during deep reasoning, file parsing, and link reading are packaged as toggleable parameters or tools, with additional standalone tool endpoints for search, web crawling, optical character recognition (OCR), speech recognition, and speech synthesis that can be called individually or in combination. The essential change is this: developers shift from “building the wheel themselves” to “checking off capabilities on demand”, and a fully functional conversational application can be replicated in a very short time.

    2. Engineering Breakdown of Five Core Capabilities

    1. Web Search: Adding Timeliness to the Model

    In non-thinking mode, once the web search tool is enabled, the model decides on its own whether to launch a web or image search based on the user’s question and attaches citation sources in the answer. Two engineering points matter: first, the trigger decision is made by the model, so developers should no longer hardcode “whether to go online” with keywords; second, citations must be traceable—source annotations in the answer are key to building user trust, and the frontend should present them fully rather than collapsing or hiding them.

    2. Deep-Thinking Search: Autonomous Retrieval During Multi-Step Reasoning

    In thinking mode, the model can repeatedly launch searches and read links within a multi-step reasoning chain, then revise conclusions based on new evidence. This suits research, price comparison, and tasks requiring cross-verification. The cost is increased latency and call volume, so timeouts, maximum step counts, and fallback strategies are essential.

    3. File Input: Bringing Unstructured Data into Context

    Common formats such as documents and images are supported, allowing both plain text extraction and mixed text-image parsing, with results merged into the conversation context. Practical advice: separate parsing from reasoning—first persist the original text along with locators like page numbers/coordinates, then slice and feed content into the model as needed, which makes traceback and reprocessing easier.

    Once the link-reading tool is enabled, the model can automatically recognize URLs in messages, fetch the main content, and answer in context. Note that dynamically rendered pages, login walls, and anti-crawling restrictions apply, so engineering should keep a fallback message that clearly states when fetching fails.

    5. Model Safety: Two-Way Risk Control on Input and Output

    A safety check parameter enables basic risk review of both input and output, returning a refusal flag on a hit. Developers offering services to external users must enable it and simultaneously fulfill obligations such as content moderation, model registration, and generated content labeling.

    3. Parameterized Call Example (Pseudocode)

    1. resp = client.chat.completions.create(
    2. model="deepseek-flash",
    3. messages=[{"role": "user", "content": "Help me summarize the core risks in this annual report"}],
    4. tools=["deepseek_web_search", "deepseek_read_url"],
    5. file_ids=["file_xxx"],
    6. thinking={"type": "enabled", "max_steps": 5},
    7. safety_check=True,
    8. )
    9. print(resp.choices[0].message.content, resp.usage)

    Key points: tools are enabled via a declarative list; thinking mode and retrieval can be stacked; safety check is an independent switch. In the response body, besides the main content, the usage fields should also be parsed for cost accounting.

    4. Billing Model: Token Fees + Tool Call Fees

    Extended capabilities typically adopt a two-layer structure of “model token fees + tool call fees”, with tool fees settled by actual call count or data volume. Therefore cost governance must be built in upfront:

    • Set a per-session call limit for retrieval tools;
    • Apply size and page limits for long document parsing;
    • Use a cache layer to absorb high-frequency repeated queries;
    • Build usage dashboards and alerts by user and by feature.

    A reusable layered structure: the access layer handles authentication and rate limiting; the orchestration layer handles tool toggles, thinking steps, and fallback; the capability layer connects tools for search, crawling, recognition, and synthesis; the data layer uses object storage for original files and logging/monitoring/alerting systems to trace the call chain; the compliance layer handles moderation and labeling uniformly. If running on a container platform, the orchestration layer can be made a stateless service for horizontal scaling, while heavy tasks like parsing and speech can be placed in an asynchronous queue for peak shaving.

    6. Common Pitfalls and How to Avoid Them

    1. Enabling all tools blindly: latency and cost both rise; configure a capability matrix per scenario.
    2. Ignoring citation presentation: users cannot verify sources, and trust declines.
    3. No fallback: tool timeouts make the whole system unavailable; a “direct answer without retrieval” path is needed.
    4. Missing compliance: no safety check or generated content labeling for external services creates risk.

    7. Conclusion

    Making application capabilities available through APIs means the competitive focus shifts from “whether you can call the model” to “whether you can orchestrate capabilities into a reliable product”. A developer’s real moat lies in scenario understanding, context engineering, and cost and safety governance—not the API itself.