Building Applications with LLM Open Capability APIs: A Practical Guide
This guide explains how LLM APIs have evolved from simple text completion endpoints into composable capability interfaces, and how to build applications on top of them. It covers five core capabilities—web search, deep thinking search, file input, link reading, and model safety—along with a recommended four-layer architecture, orchestration pseudocode, engineering practices for context budgeting and cost control, and a compliance and security checklist for production services.
1. From Model Invocation to Capability Exposure: How the API Surface Has Changed
In the past, integrating an LLM meant sending a prompt to a text completion endpoint and using whatever the model returned. As applications grew more complex, a single completion endpoint could no longer support composite needs such as retrieval, file understanding, and multi-step reasoning. Major platforms now split model capabilities into a set of composable, orchestrable APIs and tools—what is often described as an all-in-one capability suite.
This shift has three direct engineering implications:
- API layering: message-based APIs for multi-turn conversations, response-based APIs for stateful session orchestration, and chat completion APIs that stay compatible with traditional text completion habits. Their semantics differ, so the choice depends on whether you need the server to persist session state.
- Capabilities as tools: web search and link fetching are no longer opaque model-internal behaviors. They are declared explicitly as “tools,” and the model decides on its own when to call them.
- Multimodal input: context is no longer limited to plain text. Files and images are parsed and merged into the context as referenceable material.
Understanding these three points is the prerequisite for every engineering decision that follows.
2. Understanding Five Core Capabilities
2.1 Web Search
With the retrieval tool enabled in non-thinking mode, the model initiates web or image searches based on the intent of the question and attaches source citations to its answer. The engineering value is that it turns the “knowledge cutoff” problem into a “retrieval quality” problem, which makes retrieval recall quality and citation traceability more worth investing in than the model itself.
2.2 Deep Thinking Search
In thinking mode, the model can repeatedly issue searches, read candidate links, and revise intermediate conclusions within a multi-step reasoning chain. It suits questions that require multi-hop information, such as fact cross-verification, competitive research, and technical selection comparisons. The cost is higher latency and more calls, so it must be paired with budget control.
2.3 File Input
Documents, spreadsheets, images, and other formats can be uploaded, then merged into the context after plain-text extraction or mixed text-and-image parsing. The key to adoption is parsing quality: documents with complex layouts are prone to scrambled paragraphs and lost table structure. It is advisable to chunk and structurally annotate parsing results before feeding them into a retrieval-augmented pipeline.
2.4 Link Reading
With the link reading tool enabled, the model can recognize URLs in messages, fetch their content, and answer in combination with the context. This requires the application layer to maintain a URL allowlist, fetching timeouts, and content length truncation to avoid the security and stability risks of malicious URLs.
2.5 Model Safety
With the safety check parameter enabled, the platform provides baseline risk control that reviews inputs and outputs and returns a refusal flag when a risk is detected. If you offer a service externally, this parameter should be on by default, while the application owner still bears obligations such as content moderation, algorithm and model registration, and generated content labeling.
3. Typical Architecture and Orchestration
A four-layer structure is recommended: an access layer for unified authentication and rate limiting; an orchestration layer for tool declaration, context assembly, and fallback; a capability layer that wraps retrieval, parsing, and fetching; and a governance layer for logging, monitoring, and auditing.
# Illustrative pseudocode: tool declaration and call orchestrationtools = [{"name": "web_search", "description": "Search the web and return citations"},{"name": "read_url", "description": "Fetch the main content of a given URL"},]def chat(user_msg, files=None, thinking=False):context = build_context(user_msg, files) # parse files, chunk, and mergeresp = client.create(model=MODEL,messages=context,tools=tools if need_search(user_msg) else None,safety_check=True, # required for external services)if resp.tool_calls:for call in resp.tool_calls:result = dispatch(call) # route to the capability layercontext.append(tool_result(call, result))resp = client.create(model=MODEL, messages=context, safety_check=True)return resp
4. Engineering Implementation Practices
- Context budget: parsed file results often far exceed the context window, so summarize first and retrieve over the summary, merging only the matched fragments into the context.
- Cost control: set a maximum step count and timeout for deep thinking search, and fall back to regular search or answer from the existing context once the timeout is reached.
- Citation trustworthiness: citations in answers should be traceable to specific source fragments so users can verify them.
- Observability: record tool call counts, retrieval hit rates, refusal rates, and latency distributions, and define alerting thresholds.
- Idempotency and retries: fetching and retrieval should be designed to be idempotent to avoid retries amplifying load on external dependencies.
5. Compliance and Security Checklist
When offering an application service externally, enable safety checks by default, establish your own moderation fallback pipeline, complete any required model and algorithm registration, add explicit or implicit labels to generated content, and retain input and output audit logs to meet traceability requirements. Rate limiting, URL allowlists, and blocking sensitive file types help reduce the risk of abuse.
6. Conclusion
The significance of open capability APIs is that they turn retrieval, parsing, reasoning, and safety from model-internal black boxes into orchestrable engineering components. A developer’s real competitive edge lies not in how many tools they call, but in the completeness of their context organization, fallback strategies, and governance system. Built on a general-purpose cloud platform’s container, object storage, message queue, logging, and monitoring and alerting capabilities, stable, compliant, and scalable intelligent applications can be constructed.
