Server-side tool calling through the Open WebUI API

Scripts that call Open WebUI can have the server run search, knowledge, MCP and workspace tools and return one finished answer. This page covers what to confirm, how permissions apply and what the build needs.

On this page

When a script should let the Open WebUI server run tools for it

Server-side tool calling fits a team that wants an internal job, report or service to return a finished answer, where that answer depends on web search, internal knowledge or an MCP server, and where no person is sitting in a chat window to prompt the model step by step. A nightly summary of open incidents, a draft reply assembled from policy documents, or a service that answers a question from a ticketing system are typical cases. In these cases the script sends one request, the Open WebUI server decides which tools to run, runs them, and returns the final answer. The script should not call the search engine, knowledge base or MCP server itself when the server is already configured to do so for the same workflow.

That convenience is the reason to slow down. The tools run under a identity on the server, and the answer inherits whatever that identity can read. Before building, confirm which user or API key the request authenticates as, which knowledge bases and tool servers that identity can reach, and whether the permissions match what the requesting team is allowed to see. Confirm also how the server records tool invocations, because a finished answer alone does not show which sources or systems were touched. Check how the Open WebUI API key and role settings described in the Open WebUI features documentation apply to your deployment before assuming a service account is restricted.

The API call is the smallest part of the work. The larger items are verifying answers, handling failures and operating the service over time. Plan test cases with known correct answers, decide what the script does when a tool times out or returns partial results, and decide who reviews output that is sent to customers or regulators. Operations include rotating keys, watching for changes to tool configuration and keeping the server version current. Any request that the server can run unattended should also be checked for prompt injection through documents or web pages it reads. Ask your implementation partner to document the exact endpoints and parameters for your version, since this page does not state them.

How a scripted request reaches tools under a user's permissions

The request starts in the calling script, which authenticates to the Open WebUI API with an API key tied to a user. The server then resolves the model and the tools the request may use, and checks the user's group and resource permissions before each tool runs. Web search, knowledge, MCP and workspace tools execute on the server, and only the finished answer returns to the script. Confirm that the key's user holds access to every tool and knowledge base the script expects to reach.

Trust boundary sits between the script and the server, where permissions gate each tool.

Which tool sources to enable for a scripted call

This table compares web search, knowledge bases, MCP servers and workspace tools by what each reaches, what data it can expose, what decides access and which batch or service jobs suit it. Read each row as a question to answer for your own deployment before you enable the source for a script. The main takeaway is that a tool source is only as narrow as the permissions and server settings behind it, so confirm those in your Open WebUI version first.

Tool sourceWhat it reachesData it can exposeWhen it fits a scripted job
Web searchExternal search providers configured on the server, reached through the server rather than the callerQueries sent to the external provider and the returned page content; results can enter the model contextBatch jobs that need current public information and where outbound queries are approved by security
Knowledge basesCollections the calling user can read, including files and vector-indexed contentDocument text retrieved into the answer; anything the user's knowledge permissions allowService jobs answering questions from an approved document set, with a service account scoped to that set
MCP serversTool endpoints registered on the server, which may reach internal systemsWhatever each MCP server returns, often including records from line-of-business systemsJobs that need one specific system; confirm each server's own authentication and logging
Workspace toolsPython tools installed in the workspace, running with server accessDepends on each tool's code, valves and the credentials it holds on the serverNarrow jobs with reviewed code; treat every installed tool as code that runs on your server
Permission sourceWho the API key or token maps to, and which groups and resource grants applyOnly resources that identity can read, if access control is set as intendedDedicated service accounts with least-privilege groups for each script
Version behaviorTool-calling handling and settings can change between releases such as v0.12.0 and v0.12.3Defaults for enabled tools and tool exposure may differ by releaseBefore go-live, test each source on the exact version you run and record the result

Why the caller's identity decides what the server can reach

A server-side tool call runs with the permissions of the account behind the API key, not with the permissions of the script author or the application that calls it. When a script sends a request to the Open WebUI API and the model decides to search the web, query a knowledge base, or call an MCP or workspace tool, the server checks what that account can see and do. If the account is a shared service account with broad rights, every script that uses its key inherits those rights. In practice, an over-privileged service account turns each script into an administrator with a text interface, and a prompt injected through a document or web page can ask the model to use those rights on the attacker's behalf.

Open WebUI's role-based access control combines user roles, groups and per-resource permissions, as described in the Open WebUI features documentation. Your design should decide which groups can use which models, knowledge bases and tools, and then grant the API service account membership in only the groups its script needs. Keep admin roles out of that account. Confirm in your own version whether an API key carries the permissions of its owner in full, whether keys can be scoped more narrowly, and whether tool permissions are checked separately from knowledge base access, because the documentation you rely on should match the release you run.

Test the design with a low-privilege account before go-live. For each knowledge base and each tool the script can reach, make a request with that account and confirm that content outside its groups is refused and that the tool does not run for users who lack access. Repeat the test after every upgrade, group change or new tool, since a permission that was narrow last quarter may have widened. Record the results as evidence, because an access review will ask who could reach which source through the API and how you know.

How to set up a scripted caller with its own scope

This sequence gives a script its own identity, group permissions, API key and tool sources. Two test requests, one allowed and one denied, prove the scope holds, and the logs show every call is traceable to that identity.

  1. Create a dedicated non-admin service user

    In the identity provider or local account store you use, create one user for this script, named for the job it performs. Do not reuse an administrator account or a person's account. Give the account an owner and no admin role, so any action it takes can be attributed to the job. Check: sign in as that user in a private browser window and confirm that no admin settings or admin panels appear.

  2. Group the caller with needed resources

    Place the service user in a dedicated group, then grant that group access only to the specific knowledge bases and tools the job needs, using Open WebUI's group and per-resource permissions. Leave every other resource unshared with the group. Check: as the service user, list the knowledge bases and tools visible in the interface and compare them with a written allowlist. Any extra item means the grant is too broad and should be removed before you continue.

  3. Issue an API key for the service user

    Sign in as the service user and create an API key from its account settings. The Open WebUI features documentation describes API keys for your version. Record the key in your secrets manager with the job name and owner, and keep it out of source code and shared scripts. Check: the key is stored in the secrets manager, and a request sent with no key or a wrong key is rejected before any work runs.

  4. Enable only the tool sources the job requires

    Turn on only the web search, knowledge, MCP and workspace tool sources that the script actually calls. Confirm in the documentation for your version how each source is enabled for API calls, because behavior can differ between releases. Check: list the enabled sources in the admin settings and match them against the job's written tool list. Disable every source that does not appear on that list.

  5. Send a request that should succeed

    From the script's host, send one request that asks a question the service user is allowed to answer through a permitted knowledge base or tool. Pass the API key in the Authorization header and keep the prompt and expected result in a test file. Write down the expected result before you send the request. Check: the response returns a finished answer with a success status, and its content matches the expected result.

  6. Send a request that should be denied

    Send a second request that asks for a knowledge base, tool or workspace resource outside the service user's group, such as one owned by an administrator. Use a clearly labeled test resource that contains a unique marker string so any leak is easy to spot. Check: the call is refused or returns no content from the restricted resource, and the marker string appears nowhere in the response. If the marker appears, stop and correct the grant before any production use.

  7. Log the calls and confirm the output

    Find both test calls in the server logs or audit trail and confirm they show the service user's identity, timestamps and the tools that ran. Check your deployment's logging configuration to see which fields are recorded, since that depends on how logging is set up. Check: the successful call shows the service user and the expected tool activity, the denied call is recorded as an access failure, and the saved output matches your expected result. Keep these results with the job's record.

Security risks when the server acts for a script

When a script calls Open WebUI and the server runs tools on the script's behalf, the server's network reach, stored keys and tool permissions become the attack surface. The cards below name six risks that follow from that design and the control that limits each one. Work through them before the first automated call reaches production.

Over-broad keys and service accounts

An API key inherits the permissions of the user or service account that created it. If that account can reach every knowledge base, model and workspace tool, a single leaked key exposes all of them. Map each script to its own account in a narrow group, grant only the models, knowledge collections and tools its job needs, and confirm in the admin settings that the group cannot see resources outside that set. Review the role model before the script is connected to live data.

Open WebUI features

Prompt injection reaching tools

Web pages and uploaded documents can contain instructions that a model follows as if the user had written them. When that model can call search, knowledge or MCP tools, injected text can steer which tools run and with what arguments. Treat every retrieved page or file as untrusted input, restrict which tools a scripted call may use, and test the script with hostile sample content. The detail and layered controls are covered in the agentic risks topic.

Outbound requests from search and MCP tools

Web search and MCP tools make requests from the Open WebUI server, not from the caller's laptop. That server may reach internal admin panels, metadata endpoints or databases that the script's author never intended to expose. Restrict outbound traffic at the network layer to the destinations the tools need, and confirm which hosts each MCP server can contact. Ask your team to document the egress rules alongside the tool list.

Leaked keys in scripts and logs

Scripts often hold API keys in source files, shell history or CI variables, and those values can appear in application logs or error output. A leaked key lets anyone call the server with the owner's permissions until it is revoked. Store keys in a secrets manager, keep them out of version control and log output, and rotate them on a schedule your security team sets. Confirm that a revoked key stops working on your deployed version.

Unreviewed tools with server access

Tools and functions run with the server's access to files, networks and environment variables. A community or internally written tool that a script can call has the same reach as the server itself. Keep an approved list of tools that scripted calls may use, and require a code review and a test instance before a tool is enabled for an API group. The review steps are described in the community tools review topic.

Missing audit trails for automated calls

When a script triggers a search, a knowledge lookup or a tool run, the action can look like an ordinary user request in the logs, with no record of which script or pipeline started it. Without that record, an incident responder cannot tie a data access to a key or a job. Give each script a distinct identity, record which tools each call used, and send server logs to a system your security team reviews. Confirm what the logs contain before you rely on them for an investigation.

What the deployment shape changes for scripted workloads

A single Open WebUI replica on one virtual machine or container is the simplest shape for scripted tool calling. One process handles the API calls, the tool execution and the database, so there is no shared state to coordinate. The Open WebUI scaling guide accepts SQLite for single-replica deployments, evaluation and small teams, but only when the database file sits on locally attached SSD or NVMe storage rather than network storage. A script that makes many concurrent requests will still compete with interactive users for the same worker threads, memory and database connections.

  • Database file location: Confirm the SQLite file is on local SSD or NVMe, not an NFS or network-attached volume, before a batch job writes to it.
  • Shared capacity: Batch calls and chat users draw from the same process, so a long job can slow interactive sessions on the same host.
  • Restart impact: A crash or restart during a multi-hour run ends every in-flight call, so the script needs resumable checkpoints.
  • Token behavior: Without Redis, signing out does not revoke tokens, and they stay valid until they expire, by default after 4 weeks. Rotate or revoke service API keys deliberately.
  • Ceiling: A single replica is the easiest to reason about, but it has no failover when the host is down.

Before you rely on this shape, check the database location and test one full batch run against a copy of your real workload.

What to confirm before building on the API

Server-side tool calling depends on details that change between Open WebUI releases and deployments. The items below are the ones to pin down with the vendor or in a test instance before you write integration code or set a rollout date.

Endpoints and request format

Confirm the exact endpoints, request body fields and response shape for the release you plan to run, because tool-calling interfaces change between versions. Ask the vendor which routes are stable and which are experimental. Build a small test client against a non-production instance and record the request and response you receive, so your scripts are pinned to a verified contract.

Latest release checked
v0.12.3
Open WebUI features

Per-request tool source selection

Check whether your script can choose which tool sources run on each request, such as web search, knowledge bases, MCP servers or workspace tools, or whether tools are enabled at the model or user level. Test with a user who lacks access to a given knowledge base and confirm the call is refused rather than silently answered from other sources.

Tool results and citations

Confirm how the finished answer reports which tools ran, what they returned and which sources were cited. Your application may need those citations for audit or user display, so check whether they arrive in the response body, in a separate field or only in the chat history. Run a query that uses a knowledge base and verify that the citation identifiers match the documents your user can open.

Rate limits and timeouts

Tool-heavy calls can take far longer than a plain chat completion because the server may search, read files and call external services before it answers. Ask the vendor whether there are request rate limits, server-side timeouts and retry behavior, and measure end-to-end latency with your slowest tool enabled. Set client timeouts from those measurements, not from defaults.

License terms for your user count

Confirm which license governs your deployment before rollout. The Open WebUI License forbids altering or removing branding in deployments above a set number of users in a rolling 30-day period unless an enterprise license or written contributor permission applies. If your scripted integration brings more users onto the instance, the branding obligation may start to apply, so review the terms against your expected headcount first.

Branding threshold
50 users
Open WebUI License

MCP server authentication

Ask how Open WebUI authenticates to each MCP server: shared service credentials, per-user tokens passed through from the caller, or OAuth flows. Per-user delegation keeps the user's permissions intact, while a shared credential means every caller inherits the same access. Test with two accounts of different privilege and confirm that the MCP server sees the identity you expect.

Questions buyers ask about server-side tool calling

What does a server-side tool calling integration cost, and what drives the price?

The cost depends on how many tools the integration exposes, how many identity and permission models it must respect, and how much of the work is new code versus configuration. DeployOpen does not publish a price list, so a quote follows from a written scope. Ask for the quote to split the work into design, build of the API client and tool wiring, permission testing, documentation and handover, and to state separately any ongoing support. The largest swing factors are usually the number of backend systems behind each tool and the depth of the access checks you require. Ask for assumptions in writing, including how many environments are covered and who performs the retest after fixes.

How long does a first working integration take?

Timing depends mostly on how quickly the client settles the identity model and tool list, and on how many systems each tool must reach. No duration is given here because none has been confirmed for this scope. Request a timeline in the written scope that lists milestones: a staging instance with single sign-on working, one read-only tool proven end to end with the user's own permissions, then the remaining tools in batches. Ask the provider to name which milestones depend on your team's responses, such as access approvals or sample data, so delays are visible early.

What must our team provide before the work starts?

Four inputs decide whether the work moves smoothly. First, the identity model: how users sign in, which groups map to Open WebUI roles, and which API keys or tokens scripts will use. Second, a prioritized tool list naming each web search, knowledge, MCP or workspace tool and the system it reaches. Third, test data and test accounts with known permissions, so access results can be verified. Fourth, a staging Open WebUI instance that matches production in version and configuration. Ask for this list in writing at the start so each item has an owner and a date.

Can our internal team build this without an outside partner?

Yes, a capable internal team can build it, provided it has engineers who know the Open WebUI API, can run a staging instance and can write tests for permission boundaries. The harder parts are rarely the HTTP calls. They are deciding that a script acting for a user must never exceed that user's rights, and proving it under failure cases such as expired tokens and revoked groups. Compare your team's time against the work list in a quote, and consider a partner for the security review and permission tests if no one on the team has done that work before.

What recurs after launch, and who owns it?

Several items recur. API keys need scheduled rotation and a record of which script holds which key. Open WebUI upgrades change the API and tool behavior, so each upgrade needs regression tests against the tool calls. Tools added over time need review before they reach users, because each one runs with server access. Logs of tool calls should be checked for unexpected actions. Ask the provider to state which of these tasks are included in the fixed-scope delivery, which become a retainer, and which stay with your team.

How do we request a fixed-scope quote?

Send a written brief that names the Open WebUI version and deployment type, the identity provider, the list of tools with the systems each reaches, the user groups and the environments required. Ask for deliverables, acceptance tests, assumptions, client dependencies and exclusions to be listed in the scope. Request a separate line for post-launch support and for any retest after findings. DeployOpen agrees scope, deliverables and timelines in writing before work starts, so a clear brief produces a quote you can compare directly with internal estimates.

Does the integration need extra security review before go-live?

Yes, because server-side tools run with server access and act on behalf of users. Review should cover how each script authenticates, whether tool calls enforce the signed-in user's permissions, how secrets are stored, and what the logs record. Ask whether the scope includes a security test of the tool calls and a retest after fixes. Compliance teams may also want evidence of these controls. DeployOpen prepares systems and evidence for compliance assessments, but independent auditors issue any audit report or certification.

How DeployOpen scopes and delivers scripted tool calling

DeployOpen plans, builds, tests and hands over scripted tool calling through the Open WebUI API inside infrastructure you control. The work starts with a written scope that names which server-side tools scripts may call, which user identities they run under, and what evidence your security and platform teams will receive.

How we scope

  • Inventory the tools scripts need, such as web search, knowledge retrieval, MCP servers and workspace tools, and mark each one as in or out of scope.
  • Map every script to a named service identity and confirm that its calls inherit the permissions of the user it acts for.
  • Agree in writing which Open WebUI version, database and identity setup the integration will target before build work starts.

How we build

  • Write API client code that authenticates with API keys, handles errors and logs each request without storing prompt content you have not approved.
  • Configure tool access and group permissions in Open WebUI so that scripted calls match the access model your users already have.
  • Test allowed and denied paths with non-production accounts, including attempts to reach tools or knowledge a user is not permitted to see.

How we hand over

  • Deliver a written runbook covering API keys, rotation, endpoints used, tool configuration and the logs that show each tool call.
  • Document the permission matrix, showing which roles and service identities can reach each server-side tool.
  • Walk your engineers through the setup and leave the test scripts so they can rerun the checks after upgrades.

How we support

  • Support is available as a retainer for upgrades, regression testing of scripted calls and changes to tool configuration.
  • Retesting after each Open WebUI upgrade confirms that tool permissions and API behavior still match the documented design.
  • Ask any proposal to name the support hours, response expectations and who approves changes to tool access.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.