Application-Level API Access: How Anyone Can Replicate an AI Assistant

    This article explains the shift from model-level APIs to application-level APIs, where built-in tools such as web search, deep research search, file input, link reading, and speech recognition and synthesis are exposed either as parameterized tools or as standalone tool endpoints. It breaks down what each capability solves, provides a minimal assistant backend example with configuration-based tool switches, outlines the two-part cost model of token fees plus tool fees with three cost-control strategies, recommends a layered architecture with strong observability, and lists security and compliance requirements. Developers will learn how integrating multiple third-party services can be reduced to a single parameterized model call, while responsibilities such as content moderation and regulatory filing still remain with them.

    1. Background: From Model APIs to Application-Level APIs

    Over the past two years, large model APIs have largely stayed at the “text completion” level: developers receive a black-box function that takes an input token sequence and returns an output token sequence. To ship a usable AI assistant product, you still had to wrap the model in an “application shell” and integrate search, parsing, speech, and moderation capabilities one by one.

    The capabilities opened by this platform essentially push that “application shell” down to the server side. Web search, deep thinking search, file input, link reading, speech recognition, and speech synthesis are now offered in two forms:

    • Parameterized tools: enable the corresponding tool flag in the chat request, and the server decides when to call it and how to splice the result back into the context;
    • Standalone tool interfaces: search, web crawling, OCR, speech recognition, and speech synthesis can be called individually or combined freely.

    The direct benefit for developers is that a minimum viable product that previously required three to five third-party services and over a thousand lines of glue code can now be compressed into a single parameterized model call.

    2. Capability Breakdown: What Each of the Five Capabilities Solves

    2.1 Web Search (Non-Thinking Mode)

    With the web search tool enabled, the model automatically initiates retrieval when it recognizes that a question needs external facts, and attaches citation sources in the answer. It addresses the model’s knowledge cutoff and the timeliness of facts, with typical scenarios being market quotes, sports events, policies, and product specification lookups. One engineering note: citation sources must be genuinely returned and visible in the frontend, otherwise users cannot verify them.

    2.2 Deep Thinking Search (Thinking Mode)

    In reasoning mode, the model breaks a question into several sub-questions, autonomously initiates retrieval and reads links between multiple reasoning steps, then continues reasoning based on new evidence. It suits complex questions that require cross-validation, at the cost of significantly higher latency and token consumption. Whether to enable it should be decided by question complexity, not turned on globally by default.

    2.3 File Input

    Document and image formats are supported, allowing both plain text extraction and mixed text-image parsing, with the parsing result entering the conversation context. This replaces the first half of the self-built pipeline of “upload - parse - chunk - vectorize - retrieve.” Note the context window limit: overly long documents still need to be segmented and summarized on the application side.

    With the link reading tool enabled, the model automatically identifies URLs in messages, fetches the main content, and answers in context. It frees high-frequency needs like “tell me what this page says” from manual copy-paste by the user.

    2.5 Model Safety

    Basic inbound and outbound risk-control parameters are provided, returning a refusal flag when a risk is hit. Developers offering services to the public should enable this parameter and fulfill their own obligations for content moderation, algorithm and model filing, and generated content labeling - this responsibility cannot be transferred by calling a parameter.

    3. Reference Implementation: A Minimum Viable Assistant Backend

    The sample code below shows the basic form of parameterized tool calls (fields are illustrative; refer to the official documentation for actual details):

    1. resp = client.chat.completions.create(
    2. model="deepseek-flash",
    3. messages=[{"role": "user", "content": "Summarize this page for me: https://example.com/a"}],
    4. tools=[{"type": "web_search"}, {"type": "read_url"}],
    5. extra_body={"safety_check": True},
    6. )
    7. print(resp.choices[0].message.content)

    Engineering practice suggests making tool switches configuration items, delivered per scenario:

    1. modes:
    2. quick_answer: {thinking: false, tools: [web_search]}
    3. deep_research: {thinking: true, tools: [web_search, read_url]}
    4. doc_qa: {thinking: false, tools: [file_parse]}
    5. voice_chat: {thinking: false, tools: [asr, tts]}

    4. Cost Model: Tool Fees on Top of Token Fees

    Expanded capabilities bring two-part billing: model token fees plus tool call fees, with the latter settled by the actual tools called and usage. This means cost no longer grows linearly “by word count,” but is strongly correlated with the number of retrievals, pages crawled, and speech duration.

    Three cost-control strategies:

    1. Tiered routing: first use a small-parameter model or rules to judge whether web access is needed, and only escalate to deep thinking search when necessary;
    2. Cache first: build result caches for high-frequency repeated queries, and skip tool calls on a cache hit;
    3. Budget guardrails: set per-session tool call limits and timeouts on the application side to avoid runaway bills amplified by multi-step reasoning.

    5. Architecture Recommendations: Keep Complexity Where It Belongs

    The recommended layering is: the access layer handles authentication and rate limiting; the orchestration layer handles mode selection, tool switches, and context assembly; the capability layer calls the model and standalone tool interfaces; the data layer uses object storage for raw files, caches for retrieval results, and logging and monitoring services for observability.

    Observability is especially critical. Once a multi-step retrieval chain fails, it is hard to trace back from the final answer which step went wrong, so you must log the input parameters, latency, return summary, and token consumption of each tool call, and configure alert thresholds.

    6. Security and Compliance Checklist

    • Public-facing services must enable safety checks and retain refusal and appeal paths;
    • Complete the filing and registration related to generative AI services, and label output content per the relevant specifications;
    • Review crawled content for source and copyright to avoid directly republishing protected text;
    • When file parsing and speech data involve personal information, provide clear notice and minimize retention;
    • Build prompt injection defenses: web and document content is untrusted input and must be isolated from system instructions.

    7. Conclusion

    The significance of this round of opening is not the addition of a few interfaces, but lowering the barrier to “building an AI product” from engineering integration to parameter configuration. What developers save is not code volume, but the time to build retrieval, parsing, and speech pipelines from scratch. Only when the wheels are cheap enough will innovation density truly rise. On platforms such as Baidu AI Cloud, similar capabilities are generally offered in the form of general toolchains and managed services, and developers can combine them as needed based on their own scenarios.