LLM Application API: How to Replicate an AI Assistant with Parameterized Tool Calls

    This article explains the shift from model inference APIs to application-level capability APIs, where retrieval, crawling, parsing, speech, and safety controls are enabled through request parameters. It covers five core capabilities, a layered reference architecture with sample pseudo-code, the dual-track cost model and governance practices, and compliance recommendations for developers building assistant-style applications.

    1. Background: From Model APIs to Application Capability APIs

    Over the past two years, the mainstream way to build assistant-style applications has been to assemble a pipeline yourself: call a large model inference endpoint to get text, attach external search, document parsing, and speech services, then write your own orchestration logic to stitch the results back into the context. The problem with this pipeline is not whether it works, but that every stage demands repeated investment: search results need cleaning, citations need labeling, documents need chunking, audio needs transcoding, and content moderation needs a self-built keyword library. The energy that should go into the product itself gets diluted by a large amount of “plumbing work.”

    A clear signal has recently emerged in the industry: a cloud vendor has exposed the complete capability set that was previously packaged inside its own assistant product to the application interface layer, in the form of parameterized switches. Developers no longer need to source and adapt third-party capabilities one by one; they only need to enable the corresponding parameters in the request, and the model side will automatically handle retrieval, crawling, parsing, and synthesis. The vendor has even provided a demo application and sample code that closely mirror the web product, claiming that developers can replicate the full assistant almost one to one.

    The technical implication here is far greater than “a few more endpoints.” It signals that the layering of large model platforms is converging: model inference at the bottom, tool capabilities in the middle (retrieval, crawling, optical character recognition, speech recognition and synthesis), and application orchestration on top. Which layer a developer chooses to engage at determines their return on investment.

    2. Engineering Read of Five Core Capabilities

    2.1 Web Search: Moving Knowledge Freshness to Runtime

    With the web search tool enabled in non-thinking mode, the model automatically decides whether to launch a web or image search based on the question, and attaches citation sources in the answer. The genuinely valuable engineering points are the “automatic decision” and “traceable citations”: the former reduces latency and cost from unnecessary retrieval, and the latter is the minimum guarantee of content credibility. When designing a product, developers should treat citation sources as first-class citizens in rendering rather than folding them into a corner, since this directly affects user trust and compliance record-keeping.

    2.2 Deep Thinking Search: Autonomous Retrieval Within Multi-Step Reasoning

    In thinking mode, the model embeds retrieval into the reasoning loop: it first decomposes the question, identifies information gaps, then searches and reads links, merges the new evidence into the next reasoning step, and continues until the evidence is sufficient. This is fundamentally different from the naive “retrieve once, then generate” approach — the latter almost inevitably fails in scenarios requiring multi-hop reasoning (for example, when several premises must be verified in sequence). The cost is higher latency and more tool calls, so budget caps and timeout policies must be set for thinking mode.

    2.3 File Input: The Standard Move for Bringing Unstructured Data into Context

    Common formats such as PDF, office documents, and images are supported, with both plain text extraction and layout-aware parsing that handles text and images together. What is most easily underestimated here is “layout semantics”: tables, charts, headers, and footers are extremely prone to misalignment in multi-column layouts, and the value of mixed text-and-image parsing is precisely that it preserves positional relationships, letting the model understand “which conclusion this chart belongs to.” The engineering recommendation is to retain parsing confidence and page anchors to make traceback and verification easier.

    2.4 Read URL: Turning a URL into Part of the Context

    With the link-reading tool enabled, the model recognizes URLs in the message, crawls the main content, and answers in combination with the context. Practical pitfalls concentrate on dynamically rendered pages, login walls, extremely long body text, and noisy templates. A reasonable approach is to pair this with body-extraction quality assessment and a length truncation strategy, and to require in the prompt that the model explicitly state when crawling fails rather than fabricating content.

    2.5 Model Safety: Making Risk Control a Switchable Capability

    The platform provides basic input and output risk-control parameters that return a refusal flag when a risk is hit. It should be emphasized that this is only a baseline capability; developers offering services to the public must still fulfill their own obligations for content moderation, model registration, and labeling of AI-generated content. Safety is not a switch, but a process.

    3. Reference Architecture and a Call Example

    A robust layered design looks like this: the access layer handles authentication and rate limiting; the orchestration layer handles intent recognition, tool-switch decisions, and budget control; the capability layer calls tools such as search, crawling, parsing, and speech; the data layer uses object storage to keep original files, plus logging services and monitoring alerts for observability; the governance layer handles risk control, auditing, and cost attribution in a unified way.

    Parameterized invocation can be expressed with the following pseudo-code (illustrative only; it does not represent any specific API):

    1. resp = client.messages.create(
    2. model="chat-model",
    3. messages=[{"role": "user", "content": "Compare the revenue structure of these two annual reports"}],
    4. tools=[
    5. {"type": "web_search"}, # web / deep retrieval
    6. {"type": "read_url"}, # URL body crawling
    7. {"type": "file_parse", "mode": "layout"}, # layout-aware parsing
    8. ],
    9. reasoning={"mode": "think", "search_budget": 3}, # thinking mode and retrieval budget
    10. safety={"input_check": True, "output_check": True},
    11. )

    Three key engineering constraints apply. First, tool calls need idempotency and deduplication to avoid crawling the same link repeatedly. Second, all external content must be treated as untrusted input to guard against prompt injection. Third, log the latency and billing of each tool call separately; otherwise cost cannot be attributed.

    4. Cost Structure and Governance

    This kind of opening typically uses dual-track billing of “model token fees plus tool call fees”: retrieval is billed per call, crawling by volume, parsing per page or per document, and speech by the second or by character. Governance measures include setting tool budgets and degradation order for different business lines (for example, local cache first, then retrieval, and deep thinking last); building result caches for high-frequency questions; persisting parsing results for reuse to avoid being billed repeatedly for the same file; and setting a per-request unit cost threshold in monitoring alerts.

    5. Compliance and Adoption Recommendations

    When offering services to the public, be sure to enable safety checks and retain refusal and audit records, while completing content labeling and any required registration or filing. It is advisable to proceed at a pace of “read-only tools first, write tools later” and “internal canary release first, public opening later,” and to set source whitelists and rate limits for retrieval and crawling. Overall, turning application capabilities into interfaces pushes developers’ focus back from “building plumbing” to “building experience and scenarios,” which is where the real benefit of this round of opening lies.