How to Replicate a Full-Featured AI Assistant at Low Cost with All-in-One LLM Application APIs
This article explains how all-in-one LLM application APIs bundle web search, web page reading, file and image parsing, and speech capabilities as server-side built-in tools. It covers the four main tool categories, the pricing structure that combines token-based model fees with per-call tool fees, a sample Python integration, and five engineering practices for production use.
Introduction: From Raw Models to All-in-One APIs
Over the past one to two years, LLM APIs have changed noticeably. Early platforms offered only raw models: you sent in text, and the model returned text. If developers wanted an application to search the web, read web pages, understand uploaded files, or support voice interaction, they had to integrate third-party search services, crawlers, OCR engines, and speech recognition and synthesis services. They also had to write complex Function Calling logic to orchestrate these tools and insert their results into the model’s context. This raised development costs. Latency, stability, and data format differences across multiple external services also directly affected the final user experience.
Recently, leading model providers have begun packaging capabilities they had already validated in their own consumer-facing apps as server-side built-in tools. Developers now only need to add one or two parameter declarations to an existing chat request. The server then handles search, web page retrieval, file parsing, and speech transcription, and inserts the results into the context. The client does not need any glue code for tool dispatch. According to the official description, developers can almost fully replicate a feature-complete AI assistant app this way. This article reviews the capabilities, billing methods, and integration practices of these all-in-one APIs.
1. What an All-in-One API Includes
Based on the rollout patterns across platforms, these built-in tools fall into four broad categories.
The first category is web information retrieval, which includes search and web page fetching. The search endpoint takes a query and returns a structured list of results. The fetch endpoint extracts the main text content from a given URL into clean text that the model can read. These two endpoints are often the first to launch, and they form the foundation of a web-connected AI assistant.
The second category is built-in tools for chat. Unlike standalone search endpoints, these tools are embedded directly in the chat API. After a developer declares them, the model decides on its own when to search, what to search for, and whether to open links in the search results. The server handles this entire process. This category also includes a deep thinking mode. In this mode, the model runs a longer reasoning chain before answering and then combines it with search results to reach a conclusion. This mode suits complex analytical questions.
The third category is file and multimodal input. Users can upload documents, images, and other files. The server automatically parses documents and runs OCR, then injects the content into the context. As a result, features such as “upload a PDF and have the AI summarize it” or “photograph a page and have the AI recognize the text” no longer require developers to build their own parsing pipelines.
The fourth category is speech capabilities, covering speech input (audio transcription to text) and speech output (text read aloud). Transcribing one hour of audio can cost on the order of a few tenths of a yuan. This is low enough to use at scale in ordinary applications. Content safety moderation is also often offered alongside these features to help applications meet compliance requirements.
2. Billing: Tokens for Models, Per-Call Fees for Tools
Understanding the cost structure of these APIs is important. It has two layers.
Model usage is still billed by token, and the price does not depend on whether tools are enabled. Many platforms also use time-based pricing. Prices are higher during weekday peak hours and can drop to as low as half price during off-peak hours, such as nights and weekends. For latency-tolerant offline tasks, such as batch content processing, scheduling work during off-peak hours is a simple and effective way to reduce costs.
The newly added tool capabilities are billed separately per call. At typical industry rates, search and web page fetching cost on the order of several yuan per thousand calls. Speech transcription is billed by duration. Speech recognition and speech synthesis often include discounts during promotional periods. One engineering detail is easy to overlook: a single user question can trigger multiple rounds of server-side searches and page reads, and each tool execution is billed. When designing a product, set an upper limit on the number of tool calls per request, and monitor the usage fields returned by the server so that costs do not spiral out of control.
3. Integration: Running Web-Connected Chat in a Few Lines of Code
The integration process has three steps.
Step 1: Create an API key in the platform’s developer console. Keep it safe, and inject it through an environment variable instead of hardcoding it in your code repository.
Step 2: Choose a compatible API protocol. Mainstream platforms generally support two common industry protocol styles. Set the model name to the platform’s specified model identifier. Existing projects can usually switch with virtually no migration cost.
Step 3: Declare the built-in tools you want to enable in the tools parameter of the request. The following is an illustrative Python example. The endpoint and names are generic, so refer to the relevant API documentation for your platform’s exact details:
import osfrom openai import OpenAIclient = OpenAI(api_key=os.environ["API_KEY"],base_url="https://api.example.com")resp = client.chat.completions.create(model="chat-flash",messages=[{"role": "system", "content": "Today is Saturday. Please answer concisely in English."},{"role": "user", "content": "What's the weather like in Shanghai today? Is it a good day to go out?"},],tools=[{"type": "web_search"},{"type": "read_url"},],)msg = resp.choices[0].messageprint(msg.content)
The code contains no tool dispatch loop. The server decides autonomously which keywords to search for, which web pages to read, and when to stop, based on the user’s question. Responses typically include a trace of the tool calls, such as how many searches ran and which URLs were visited. Developers should log this information, since it helps with debugging and serves as the basis for cost accounting.
4. Five Practices for Production Deployment
First, make time and context explicit in your prompts. Web-based Q&A depends heavily on time anchors such as “today” and “recently.” Inject the current date, location, and other context into the system message so the model does not search with the wrong time range.
Second, control reasoning depth. Deep thinking mode produces higher quality answers, but it adds latency and cost. For simple questions, disable it explicitly or provide a toggle so users can choose between speed and quality.
Third, plan for timeouts and fallbacks. Server-side orchestration involves search and page fetching, so overall latency is naturally higher than for pure text generation. Set reasonable client-side timeouts, and fall back to a plain model answer when tools are unavailable. This keeps the core path working.
Fourth, prioritize security and compliance. Restrict the format and size of uploaded files. Connect speech and text inputs and outputs to content safety moderation. Publicly released applications should not skip this layer.
Fifth, build observability. Log each request’s tool call count, token usage, and latency in a structured format, and pair these logs with monitoring and alerts. This is the only way to protect both user experience and cost under high traffic.
Conclusion
Opening up all-in-one application APIs effectively compresses a search, parsing, speech, and orchestration pipeline that once took a team several weeks to build into a handful of request parameters. For independent developers and small teams, this lowers the barrier to building a full AI assistant app more than ever before. For enterprises, it means they can shift effort from assembling infrastructure to business logic and user experience. We recommend starting with the smallest scenario, web-connected chat. After the pipeline works, add file and speech capabilities step by step, and use real traffic to find the right balance between cost and experience.
