Building LLM Applications with Built-in Tools: From Chat Completions to Integrated Capabilities

    As large language model APIs evolve beyond basic chat completions, more providers are baking capabilities like web search, file parsing, and speech processing directly into their APIs. This article breaks down the common capability modules, shows how to integrate them using a tools declaration pattern, explains how pricing typically works, and offers architectural guidance for teams deciding between built-in capabilities and self-built services.

    Building LLM Applications with Built-in Tools: From Chat Completions to Integrated Capabilities

    Why “Add-on Capabilities” Are Becoming Standard in LLM Services

    Early LLM APIs typically offered only the most basic chat completion capability. Developers who wanted their applications to perform web searches, fetch page content, process files, or recognize speech had to integrate multiple third-party tools themselves, then stitch the results into the model’s context through prompt engineering or Function Calling. This approach has three well-known problems:

    1. High integration cost: each external tool requires its own authentication, invocation, and error-handling logic;
    2. Inconsistent quality: different tools return data in varying formats, with uneven freshness and accuracy, and stitching them into the conversation context can introduce noise;
    3. Heavy maintenance burden: whenever a third-party tool changes its interface, the application usually has to be updated in step.

    Recently, several LLM providers have started building these “add-on capabilities” directly into their chat APIs. Developers simply declare the tool types they need in the request parameters, and the service side automatically performs the search, fetching, and parsing, then feeds the results into the model’s reasoning process. This “conversation as a service” model essentially pushes engineering complexity that used to live in the application layer down into the model service layer — an important direction in the evolution of LLM application architecture.

    Breaking Down the Capability Set: What a Full-Stack API Usually Includes

    Based on common industry practice, a complete set of chat enhancement capabilities generally falls into the following categories:

    1. Web retrieval capabilities

    This includes two sub-capabilities: real-time web search and web page content fetching. Web search generates search queries from the user’s question, calls a search engine, and returns result summaries. Web fetching extracts the main body of a specified URL in a structured way, filtering out ads, navigation bars, and other irrelevant elements so that only the article text is passed to the model. These capabilities address the fact that LLM training data always lags behind the present, enabling the model to answer “today” and “latest” types of questions.

    2. Deep reasoning combined with retrieval

    Some services combine web retrieval with the model’s chain-of-thought reasoning into a so-called “deep search” mode: the model first plans what information it needs to retrieve, then invokes search tools step by step, and finally synthesizes a conclusion from multiple rounds of retrieval. This mode is better suited to complex factual questions or multi-hop reasoning than a single search, but it comes with higher latency and invocation costs, so developers need to weigh the trade-offs for their use case.

    3. File and multimodal input capabilities

    This covers document upload and parsing, image recognition (OCR), and similar features. Document parsing typically supports common office document formats; the service side automatically extracts and segments the text, then injects the key content into the context. OCR is used to recognize text in images, with common scenarios including screenshot-based Q&A and receipt recognition.

    4. Speech interaction capabilities

    Automatic speech recognition (ASR) converts the user’s voice input into text, while text-to-speech (TTS) converts the model’s text replies into speech output. Together, these give conversational applications a voice-assistant interaction model, which is useful in cars, smart hardware, and other scenarios where typing is impractical.

    5. Content moderation capabilities

    Moderation on both the user input and model output sides is a must-consider item before any enterprise application goes live. The common approach is to insert a moderation node into the request pipeline to block or flag sensitive content, keeping policy-violating material out of production.

    Integration Approach: The General Engineering Pattern

    From an engineering standpoint, integrating these capabilities usually follows this pattern:

    Step 1: Create credentials. Apply for an API key on the provider’s developer platform for request authentication. Store the key in environment variables or a secrets management service — never hard-code it into your repository.

    Step 2: Choose a protocol-compatible approach. Most providers are compatible with the industry-standard chat completion API specification, so developers can reuse their existing SDKs and keep migration costs low.

    Step 3: Declare the tools you need in the request. Typically this is done by adding a tools field to the request body, listing the capability types to enable (for example, web search and URL fetching). The service side automatically invokes these capabilities during inference and returns the results alongside the tool call records. Here is a sample:

    1. import os
    2. from openai import OpenAI
    3. client = OpenAI(
    4. api_key=os.environ["API_KEY"],
    5. base_url="https://api.example-provider.com"
    6. )
    7. resp = client.chat.completions.create(
    8. model="example-model-name",
    9. messages=[
    10. {"role": "user", "content": "What's the weather like today? Is it a good day to go out? Keep it brief."}
    11. ],
    12. tools=[
    13. {"type": "web_search"},
    14. {"type": "read_url"}
    15. ]
    16. )
    17. print(resp.choices[0].message.content)

    Step 4: Parse the tool call chain in the response. The service side usually attaches a tool call record to the response, showing which tools were triggered and which keywords or URLs were retrieved. This is useful for debugging, auditing, and evaluating effectiveness.

    Cost Structure: Model Calls and Tool Calls Are Priced Separately

    Based on common industry pricing models, these add-on capabilities are typically billed as “model invocation fees + tool invocation fees”:

    • Model calls are billed by the number of input and output tokens, often with different price tiers for peak and off-peak hours;
    • Tools such as web search and URL fetching are billed per call;
    • ASR and TTS are billed by duration (for example, per hour);
    • Some capabilities may be discounted during a promotional period, but long-term rates should always be verified against the provider’s current published pricing.

    When designing product pricing and cost budgets, keep in mind that tool calls are triggered on demand — charges only occur when the model decides it needs to search or fetch a page. Actual costs therefore depend heavily on the query complexity of your use case. It’s advisable to estimate the average cost per session through small-scale traffic testing before launch.

    Architectural Considerations

    For teams planning conversational AI applications, here are the key dimensions to evaluate when deciding whether to adopt built-in capabilities:

    1. Development efficiency first: if your team lacks dedicated search engine or document parsing expertise, using server-side built-in capabilities can significantly shorten time to market;
    2. Strict data compliance requirements: verify that the storage and retention policies along the tool call chain comply with your organization’s data security standards;
    3. Cost-sensitive scenarios: compare the long-term cost of running your own lightweight search and web fetching services against the pay-per-call model, and choose the more economical option;
    4. Multi-model compatibility: if your application might switch underlying model providers in the future, design an abstraction layer around tool calls to avoid deep coupling with a single provider’s parameter formats.

    Conclusion

    Integrating web retrieval, file parsing, speech interaction, and similar capabilities into the chat API as built-in features — rather than as standalone tools — is a significant trend in the service-oriented and platform-oriented evolution of LLM applications. This model lowers the integration barrier for developers, but it also means tighter coupling with the underlying provider in terms of both functionality and cost structure. For enterprise applications, the recommendation is to enjoy the productivity gains while investing in architectural abstraction and establishing sensible cost monitoring, striking a balance between feature completeness and long-term maintainability.