Otari can run three tools during Chat Completions, Messages, and Responses:
otari_code_execution, a sandboxed code sessionotari_web_search, a search backendotari_web_fetch, a bounded public-web fetcher
Code execution needs a sandbox: a sandbox_url for the default protocol
provider, or a hosted sandbox_provider such as e2b, which needs none. Search
needs a search tool (see Search tools), a
workspace's organization search key, or a
deprecated legacy setting: web_search_provider with its key, or web_search_url.
Fetch runs in the gateway.
One request may declare any of them together, and MCP servers beside them: see
Combining tools.
Inspect the tools available on a running deployment:
curl http://localhost:8000/api/v1/tools \
-H "Authorization: Bearer $OTARI_API_KEY"Unavailable but recognized tools remain in the response with
"available": false and a reason:
not_configured: nothing is set up to run the tool. For web search, an organization search key counts for an API key on that organization.workspace_disabled: the API key's workspace does not allow it (a workspace admin turns it on under Tools in the dashboard).insufficient_funds: the tool would run on the deployment's account and the API key's organization has no funds paid in (see Pricing a gateway-run tool). A web search on the organization's own search key is not affected, unless the pages it reads are fetched on the deployment's account.
A master key or a dashboard session belongs to no single workspace, so its answer reflects the deployment alone.
Web search and web fetch also carry direct_available: whether
POST /api/v1/search or POST /api/v1/fetch, naming no tool, would run for the
caller. That is a separate question from available, which is about declaring
the tool in a model request. A direct call also needs the API key to hold the
web:search or web:fetch scope, and the key's tool list
to allow the tool the call runs on. Pricing and budgets still apply to the call
itself, so an admitted call can still be refused for those. Code execution has no direct endpoint here,
so its direct_available is null.
An otari_* type is executed by Otari. A provider-native web-search type is
forwarded to the provider unless interception, the
workspace's pin or the request's Otari-Web-Search header says otherwise.
Anthropic's web-fetch type is forwarded unless the workspace's pin or the
request's Otari-Web-Fetch header says otherwise.
A provider-native code-execution type is decided by the request's
executor. Each is decided for every attempt on its
own, so a fallback can run Otari's tool where the first model ran its own.
Function tools remain the caller's responsibility.
Some clients can declare only provider-native search types: web_search,
web_search_<date>, and web_search_preview. By default such a declaration is
forwarded to the provider. Set web_search_intercept: true to run every one of
them on Otari's configured backend instead. Interception is off by default.
Without interception, a request can choose for itself with the
Otari-Web-Search header:
autois decided per attempt: the provider's own search on an attempt whose model runs the keyword natively, Otari's on an attempt whose model does not. Only Anthropic's dated keyword (web_search_<date>) on/api/v1/messagesagainst an Anthropic model, and OpenAI'sweb_search/web_search_previewon/api/v1/responsesagainst an OpenAI model, count as native. DeepSeek runs both on its compatible APIs: the dated keyword on/api/v1/messageswith any of its models, andweb_searchon/api/v1/responseswithdeepseek-v4-proonly, sincedeepseek-flashignores it there and answers without searching. On Messages, a dated keyword Otari runs is still answered withserver_tool_use/web_search_tool_resultblocks. A request its first model answers natively opens and pays for no Otari search.otarialways runs it on Otari's backend.provideralways forwards it and never runs Otari's search, so on a fallback to a model that cannot run the keyword itself, that attempt fails like any other. Useautoto keep the provider's search and run Otari's only on a fallback that needs it.
An attempt that runs Otari's search follows the rules for a gateway-run search
below. One that cannot be served that way (the workspace has search off, or no
price under require_pricing) is skipped and recorded as Skipped: in the
activity log, and the request fails only when no model is left.
A workspace web-access policy may pin
search_executor to one of the same three values. The pin wins over the
header, and a header that disagrees with it is refused with a 403, as for the
code-execution executor.
The header and the pin can add a claim but never remove one: with
web_search_intercept on, every search runs on Otari's backend whatever they
say, and a provider header is refused with a 403.
Whenever Otari runs the search, the rules for a gateway-run search apply: the
workspace's web-search policy and tool pricing. All of this
requires something to search with, the in-loop default: a search
instance, or the legacy web_search_provider or web_search_url; without one,
the declaration is forwarded unchanged. A function named web_search is never
claimed.
Anthropic's fetch keyword (web_fetch_<date>) is forwarded to the provider by
default, so a request that falls back to a model with no fetch of its own sends
it a tool nobody runs. The Otari-Web-Fetch header takes it over the same way
Otari-Web-Search does for search, with the same three values:
autois decided per attempt: Anthropic's own fetch on an attempt to an Anthropic model on/api/v1/messages, the only place the keyword is native, and Otari's on any other. On Messages the result still comes back asserver_tool_use/web_fetch_tool_resultblocks. A fallback that cannot be served by Otari's fetch is skipped, as for search.otarialways runs it on Otari.provideralways forwards it and never runs Otari's fetch, so on a fallback to a model that cannot run the keyword itself, that attempt fails like any other. Useautoto keep Anthropic's fetch and run Otari's only on a fallback that needs it.
There is no deployment-wide toggle like web_search_intercept for fetch; a
workspace web-access policy
may pin fetch_executor instead, which wins over the header the way
search_executor does for search. A claimed declaration is an Otari fetch: it needs
web_fetch_enabled (without it the keyword is forwarded unchanged), follows the
workspace policy and pricing, and honors the declaration's max_uses,
allowed_domains and blocked_domains. The URL in the returned blocks omits
its query string and fragment, as the tool result does. When such a turn is
echoed back on a later request, Otari drops its own fetch blocks before calling
the model, as it does for search.
A declaration may carry max_uses to cap how many searches Otari runs for that
request. The cap is honored on every endpoint (/api/v1/messages,
/api/v1/chat/completions, /api/v1/responses) and on every declaration
shape, including otari_web_search. A failed search does not count against it.
max_uses: 0 refuses every search: the search is never offered. A negative or
non-integer value (including 1.5 and 5.0) is rejected with a 400.
Once the cap is used up, later rounds no longer offer the search: a
tool_choice loses it, and the model is told the search has reached its limit for
the request. Other tools stay on offer. When none is left, neither one of Otari's
nor one of your own, the next round is the last one, as described in Combining
tools: it tells the model to answer, and a search the model asks
for anyway is left out of the answer.
A search the model asks for past the cap within one round (three at once with two
left, say) is refused, and the model is told so. An Anthropic-native declaration
is answered in its own vocabulary, a web_search_tool_result carrying
error_code: max_uses_exceeded. Otherwise the model gets the same [tool error]
string a failed tool produces, and a Chat Completions client sees the search in
otari_tool_calls as failed, with the tag call_limit. Even without
max_uses, requests remain bounded by max_tool_iterations and the
call limit Search and Fetch share.
GET /api/v1/tool-settings answers any signed-in identity, so a member is told how
the built-in tools behave on their requests. A caller who does not operate the
deployment is answered without web_search_url, sandbox_url and
guardrails_url, which name the deployment's own infrastructure. Only a
deployment operator can change a setting.
Gateway-run tools are priced per successful call. Each search or fetch tool,
builtin_fetch included, is priced at its own price, stored under its name or
under its old <provider>:<instance> model key, and only that price prices its
calls. Three rows price the rest:
otari:code_execution
otari:web_search
otari:web_fetch
otari:code_executionprices code execution. A run in an environment with a price of its own,otari:code_execution:<image>, is priced at that one instead, in the tool loop and on a direct run alike.otari:web_searchandotari:web_fetchprice the calls on a workspace's organization search or fetch key.otari:web_searchalso prices a search on the legacy settings.
Where the prices are set and read:
- The dashboard's Web search and Code execution pricing pages, in the deployment view, set these rates; the Web search page also sets each search or fetch tool's own, in dollars per call.
- The pricing API stores the value in
input_price_per_million, so one cent per call is10000. GET /api/v1/search-tools(?kind=fetchfor the fetch tools) gives each tool'sprice_per_call(the dollars a call settles at on the deployment's own account when its provider reports no cost) andprice_source, the row it comes from:own(the tool's own row),config(that row while the tool'sconfig.ymlentry setsprice_per_call, which each start writes again),old_key(its old<provider>:<instance>row), ornone(with a nullprice_per_call).- An override the operator set for one organization prices that organization's calls instead.
- An organization's owner or admin may override
otari:web_searchandotari:web_fetchon/api/v1/organizations/me/pricing, for the calls on the organization's own keys. Overridingotari:code_execution, an environment'sotari:code_execution:<image>, or a price of kindsearchorfetchis refused with403, since those calls run on the deployment's account.
With require_pricing: true, a gateway-run tool whose calls no row would price
is refused before the model call, with a 402 and the code pricing_required.
The check looks for the rows settlement prices the calls with, described below:
a search or fetch on an instance passes on its own row alone, and a call the
deployment pays for does not pass on an organization's own override. A provider
that reports its cost still needs a row, and a zero rate counts as one. The
refusal names the row to set: the tool's own for a search or fetch tool, and the
tool's otari: row otherwise. A failed tool invocation is recorded but not
charged. Charges settle on the final usage
row alongside model tokens.
Each call is also held against the caller's budgets and spend ceilings at its rate before it runs, on top of the hold the model call took:
- A call that would take the request past a limit is not run. The model is told
it was refused (
[tool error] budget_exceeded, with the tagbudget_exceededin Chat Completions'otari_tool_calls); it is recorded as a failed call, not charged, and the request goes on. - A call priced only by the cost its provider reports, with no rate, holds nothing. A call held at its rate that reports more is charged what it reported, which can take the request past a limit by the difference.
- The pages a search reads to enrich its results are one hold, taken once the
search returns, at the rate their fetch is billed at (the fetch instance's
own, or
otari:web_fetchon an organization fetch key). When it does not fit, no page is read, the results show their snippets, and the search itself is billed as usual. - A hold stays until the request settles, as the model call's does.
- A model priced at zero is served to a user with no dollars left, but its tool calls are held like any other request's, so a priced call that does not fit is refused.
The usage row's pricing breakdown has one line per tool and label, and the dashboard's request detail shows each line with its label. The label says what served the calls:
<provider>:<instance>for a search or fetch instance, andbuiltin:builtin_fetchfor the built-in fetcher;org:<provider>for a workspace's organization search or fetch key;otari:<tool>for everything else: code execution, MCP tools, and web search on the legacy settings.
A call on a search or fetch instance is priced at, in order:
- the cost its provider reported, when it reports one;
- the instance's own search or fetch row (its
price_per_call, or a price row of kindsearchorfetchkeyed by the instance's name,builtin_fetchfor the built-in fetcher); - the
<provider>:<instance>model-kind row it was priced under before tools had a kind of their own (read until a later release, with a startup warning).
An instance with none of these is unpriced, as a model with no price is. A
tool's own row and a model's never share a key, so a search provider named like
a model provider, such as DeepSeek, cannot price its models. The otari:<tool>
rows stay model-kind rows. An organization key's calls take the otari: row
only. The line's unit_rate is its cost over its calls.
Whose account runs a call decides whose prices count, as it does for a model call. A call on the deployment's account takes only the deployment's price, or an override the deployment operator set: code execution, a search or fetch on an instance or the built-in fetcher, and a search on the legacy settings. A call on an organization search or fetch key is priced at the deployment's price by default, and the organization's own override replaces it.
Where the deployment charges organizations for what its account runs (see
Deployment-paid credentials),
those tool calls are charged to the organization's funds whoever pays for the
model call: a request on the organization's own model key that searches on the
deployment's search tool is charged for the searches, and one on a hosted model
that searches on the organization's own key is charged for the model alone. A
request that may run a tool on the deployment's account is refused with 402
(insufficient_funds) before the model is called when the organization has no
funds paid in, and so is a direct search on one of the deployment's tools. The
detail names the tool, which tells it apart from the refusal of a model the
deployment pays for, and GET /api/v1/tools lists the tool as unavailable with
the same reason. A direct search, fetch or code run that reached its provider on
the deployment's account is recorded as deployment-paid on its usage row, as a
model call on a deployment-paid credential is. A call from a workspace with no
organization is admitted with nothing to charge, so its usage row is not marked
deployment-paid.
Every fetch is labeled by the instance that served it, builtin:builtin_fetch
when web_fetch_default_tool names none, and so is every in-loop search on a
search instance. A search on the legacy settings is labeled otari:web_search:
web_search_url searches on any-search's SearXNG adapter, and
web_search_provider on the adapter of the provider it names. Searches a
model's provider runs itself carry the provider's label, as the next section
says.
The pages a search reads to enrich its results are fetches on the fetch
instance that read them, builtin_fetch included:
- Each page that comes back is a
web_fetchcall under that instance's label, on aweb_fetch_callsline of its own, at the cost the provider reported or else the instance's rate. The instance's account pays for it whoever's account ran the search. - Exa reports what a page costs; Tabstack and the built-in fetcher report nothing, so their pages cost the instance's rate, up to one page per result.
- A page that cannot be read is neither billed nor counted.
- Pages read on an organization fetch key are
labeled
org:<provider>and priced underotari:web_fetch. - With
require_pricingon, a search whose pages would be read through a fetch instance with no price is refused with402before it runs, the detail naming that instance's row. web_search_extract: falseturns the reading of pages off.
A model's own search tool, such as Anthropic's web_search_<date> forwarded to
an Anthropic model on /v1/messages, web_search forwarded to an OpenAI
model on /v1/responses, or google_search forwarded to a Gemini model on
/v1/chat/completions, is run and billed by the provider, per search. Otari
reads the count the provider reports (Anthropic's
usage.server_tool_use.web_search_requests, OpenAI's
usage.tool_usage.web_search.num_requests, or else one per web_search_call
item the response lists, and Gemini's grounding queries) and adds those searches
to the row as web_search calls labeled <provider>:web_search, so the row and
the budget carry what the provider will charge. Gemini 2.5 and earlier bill a
grounded prompt once however many queries it ran, so a call there counts as one
search; Gemini 3 bills each query. They are priced at, in order:
- the operator's
<provider>:web_searchrow, such asopenai:web_search; - the
web_searchprice the model's own rate carries, per 1,000 searches, which the catalog gives a model whose provider searches (Anthropic's and OpenAI's are $10 per 1,000, Gemini 3's $14 and Gemini 2.5's $35) and aratesblock can set (Every price in its unit); the model's price applies its rules, a tier multiplier included (Overrides and multipliers); - with
default_pricingon, the provider's list price; - otherwise no cost; the searches stay on the row.
An organization's override prices them as it prices the call's tokens, so a
search on the organization's own provider key takes its override. Searches
across the rounds of a gateway tool loop are added up. A search Otari runs in
the model's place, under interception or the
Otari-Web-Search header, is billed once, under the label of what served it in
Otari, and never also as <provider>:web_search.
Direct POST /api/v1/search prices a search on a tool at that tool's own search
price, then at its old <provider>:<search-tool-name> row, or under
otari:web_search when a workspace's
organization search key served it. A provider's
reported cost, when it reports one, comes first. How that rate is reserved and
settled, and how require_pricing refuses a missing one with a
402 pricing_required, is in
Each endpoint in its unit.
The deployment pays for a search on one of its tools, so only its own price, or
an override the deployment operator set, prices it; a search an organization key
served takes the organization's own override.
Otari consumes its own tool calls, sends results back to the model, and returns the final answer.
Responses and Messages can expose native server-tool result blocks when their
wire format expects them. Chat Completions has no such blocks, so Otari reports
the calls it ran in a field of its own, otari_tool_calls, at the top level of
the response and of each streamed chunk: a search with its query and the sources
it found, a fetch with the URL it read, a code execution with its code, output
and exit status, an MCP call with its server, tool and the text it returned, and
a failure with what may be shown about it. See Gateway tool calls on Chat
Completions. Calls for
tools the client must execute are preserved.
A call to one of Otari's tools that the model was still writing when it ran out
of output tokens is neither run nor returned. The response ends with the provider's
stop reason, such as length or max_tokens, and holds no call the client cannot run.
A call to one of Otari's tools whose arguments are not a JSON object (cut off
mid-stream, or a list, a string or null) is not run either, and spends none of
the request's tool allowance: the model reads [tool error] invalid_input: ... as
its result and can try again, and Otari logs a warning naming the tool, never the
arguments. Empty arguments still mean no arguments. An otari_tool_calls entry
for the call is failed with "tag": "invalid_input", and a native Messages
block carries error_code: invalid_tool_input.
The dashboard Playground's own completion route is the one exception: its stream
also reports every gateway-run call and its result in an otari_tool_activity
field, on a chunk of its own before and after each call, so the page can show
them.
For gateway-run MCP activity in Messages streams, see Messages streaming activity.
One request may declare any mix of otari_web_search, otari_web_fetch,
otari_code_execution and MCP servers (mcp_servers or mcp_server_ids), on
Chat Completions, Messages and Responses, streamed or not. The model is offered
all of them at once and may call any of them in the same tool loop, for example
searching, fetching a page and then running code on what it found. Each call
runs on the tool it names, and each tool keeps the rules it has alone:
- Its workspace policy and its pricing apply. A declared tool its policy refuses is never dropped while the others run: an attempt that needs it is refused as it would be alone, and Who runs a tool says what that means on a fallback chain.
- A
max_usescaps only its own tool: once search reaches its cap, later rounds no longer offer it, while code and MCP calls keep running. - Each built-in comes back in the same native result blocks or items as it does alone (What clients receive), and so does MCP activity.
- Usage counts each tool's calls under the tool's own name.
The tools share one loop, so its limit is shared too: max_tool_iterations
bounds the rounds of the whole request, and so does a workspace code policy's
max_iterations when the request runs code on Otari's sandbox. The last round
max_tool_iterations allows offers none of Otari's tools and tells the model to
answer from the results it already has, so a model that keeps searching ends with
an answer rather than a failed request (MCP says the same of its loop).
A round the request's budget cannot hold ends the loop the same way, earlier
(Budget enforcement), and so does
the round after every one of Otari's tools in the request has used up its
max_uses when the request has no tools of its own. In each case, if the model
calls only Otari's tools in that round, Otari does not run them: the round ends as
the answer (MCP says how).
A tool_choice that forces a tool (required, or one tool by name, such as
code_execution for Otari's sandbox) applies to the first round only. Once that
round has run the tool, the model is free to answer, so forcing the sandbox no
longer makes it run on every round. A later round may still call the sandbox or
another tool if the model chooses to.
A tool declared in a provider's own words is still decided per attempt, so on a fallback chain one attempt may run the provider's own code execution beside Otari's search, and another run both on Otari, in the same loop.
What one tool returns reaches the model before its next call, so a fetched page or a search result can steer what the model asks of the sandbox or an MCP server. Declare together only tools you would let untrusted web content drive.
A built-in tool's name belongs to the built-in in a request where Otari runs it,
on any of the request's attempts. When a connected MCP server exposes a tool of
the same name (web_search, web_fetch or code_execution), the request is
refused with a 400 naming the tool, before any model is called or a sandbox is
opened. Leave that tool out of the server's allowed_tools, or declare only one
of the two. In a request where Otari runs no built-in of that name, the server's
tool of that name runs as usual.
Start the bundled sandbox:
docker compose --profile code-exec upRequest it with:
{
"model": "anthropic:claude-sonnet-4-6",
"messages": [{"role": "user", "content": "Compute 23 factorial."}],
"tools": [{"type": "otari_code_execution"}]
}The model calls the tool with a language and the code. language takes only
the languages the deployment's sandbox runs, which the tool's definition lists,
and so does GET /api/v1/tools. Every provider runs python, in every
sandbox environment: Otari takes a protocol backend's
code_execution kind to run Python, as the bundled sandbox does, on E2B it
runs the sandbox's default Python context, and on boxd the machine's own
python3. A call naming another language, or
none, is refused before anything runs, with an error that names the languages
to call the tool again with. Like a call with no code, it counts as a failed
call and is not billed. The tool's description also asks the model, when asked
to run code in another language, to tell the user it cannot run as is, and to
say so when it rewrote that code in Python and ran the rewrite. Models differ in
how well they follow this: some report a rewrite's output as the original
program's anyway.
The sandbox speaks the code-execution protocol,
which is what sandbox_url points at. A deployment that would rather not run
one sets sandbox_provider: e2b instead and Otari runs the code on
E2B itself, with no backend of its own and no sandbox_url;
or sets sandbox_provider: boxd to run each sandbox on an isolated
boxd cloud machine. Everything below is the same whichever it
is. A runnable example lives under demo/code-exec/.
E2B needs an API key. Store it on the Tools page under Code execution, or with
PUT /api/v1/tool-settings/sandbox/credential, and it is used for the next
sandbox on every replica within 30 seconds, so rotating or replacing a revoked
key needs no redeploy. A stored key wins over E2B_API_KEY, which serves when
none is stored; clearing the stored key falls back to it. The key is held
encrypted with OTARI_SECRET_KEY and never shown again, only its last four
characters. With no key in either place the gateway still starts, logs an
error, and refuses each code-execution call until one is set.
boxd works the same way with its own key: store it on the Tools page, or set
BOXD_API_KEY, and BOXD_REGION (fra or nyc) to choose where machines run.
Install the SDK with uv sync --extra boxd. Each sandbox is a new machine
created isolated, so it reaches the internet but not your organization's private
network, and gets no boxd credentials inside. Machines are the size your boxd
organization makes by default. A machine runs Ubuntu's Python 3 with the
standard library. The code can install what it needs (pip install works, and
what it prints comes back with the result), or a
snapshot can carry it. Variables and imports persist
from one call to the next, and files live in
/home/boxd/workspace, the directory the code runs in. A call returns at most
the first 1 MiB of its stdout and of its stderr, and says on stderr when it cut
one. A machine is deleted
when its request ends, or held on a deletion timer when the request asked to
keep its container, so one nothing resumes is deleted rather than left running.
POST /api/v1/code/execute runs code the caller sends, as
direct search runs a query, for a client whose step needs the
sandbox but no model, such as rerunning a script to check its output:
{"code": "print(1 + 1)", "container": "auto"}The code is Python, and reaches the sandbox exactly as sent. The run is admitted as an
otari_code_execution call is: the workspace policy
can turn it off, and its exec_timeout_s and pinned image apply. environment
names the sandbox environment to run in. It is priced
at the environment's own price, else otari:code_execution, and held against
the caller's budgets. Every run
that reached the sandbox is billed, including code that failed, unlike a model's
failed call in the tool loop: here the caller asked for the run and reads its
exit status itself. file_ids puts uploads from the Files API in the
working directory, and each file the code writes comes back in files with a
file_id to download. container works as on the completion routes (below),
with the id in Otari-Container-Id. The request, the response and the errors
are in the API reference.
An environment is the image a sandbox runs, so a caller can choose one for what
it contains and how big it is. The deployment's sandbox_session_image is the
default, and sandbox_allowed_session_images lists the others
(Sandbox environments). On e2b, each
is the name or id of a template in the provider's account, and the sandbox is
created from it. On boxd, each is the name of a snapshot in your boxd
organization, for example a machine with your packages installed, and each
sandbox is a new machine restored from it. A snapshot carries its machine's
disk and memory, so take it from an isolated machine that holds nothing you
would not hand to the code a model writes.
GET /api/v1/code/environments lists the environments the caller's workspace
may run code in, for any API key, as GET /api/v1/models lists models: each
one's name, a label and description, its price_per_run for the caller's
organization (null when unpriced), and whether it is the default. A workspace
whose policy is off lists none, and one that pins an image lists that one alone.
A deployment that names no image lists none either: its runs go to the backend's
own default. A master key or a dashboard session belongs to no single
workspace, so it gets the deployment's whole list at the deployment's prices.
skip and limit (at most 1000, default 100) page the list.
A direct run names one in environment. One the deployment does not offer is a
400, and one other than the workspace's pin a 403. A held sandbox keeps the
environment it was created in: resuming it while naming another is a 400, as
is naming any on a sandbox held from before environments were recorded, and a
resume that names none runs, and is priced, in the one it has.
Within one request, every code call the model makes shares one sandbox, so a
run can build on the last one's variables and files. Across requests, nothing is
held unless you ask: a request sends container: "auto" to say it wants a
sandbox that outlives it, and the response comes back naming the one it got.
Send that name on the next request and you get the same sandbox, with the
workspace as the last run left it. A request that asks for nothing holds
nothing.
This is the same contract as Anthropic's container and OpenAI's
code_interpreter container:
- On Messages, send
"container": "auto"at the top level. The response carries Anthropic'scontainerobject,{"id": "otari_cntr_…", "expires_at": "…"}, on the final message and on themessage_startevent. Send the id back as the same top-level field. - On Responses, send OpenAI's own
"container": {"type": "auto"}on thecode_interpretertool entry. Everycode_interpreter_callitem carries the id ascontainer_id; send it back as"container": "otari_cntr_…"on that entry. - On every dialect, the response headers
Otari-Container-IdandOtari-Container-Expires-Atname it, and theotari_code_executiontool entry takes acontainerstring,"auto"or an id.
sandbox_container_idle_ttl_sec (600 by default) is how long a held sandbox
lives, not whether one is held. Setting it to 0 refuses to hold one at all, so
an operator can take the capability away whatever a request asks for.
A resumed sandbox has the workspace the last run left, so files a run produced
are still there under their names, and a request's uploads are seeded on top.
The idle clock restarts on every use; a second, hard clock
(sandbox_container_max_lifetime_sec, 3600 by default) starts at the first
lease and never restarts, so one conversation cannot hold a sandbox open on the
provider indefinitely.
An id that is unknown, expired, another tenant's, or from a different sandbox
provider is refused with a 400 whose detail reads Container '…' has expired or does not exist. (the phrasing provider SDK clients treat as "drop the id and
start over"). A container id is bound to the user and workspace that leased it,
and the refusal is the same in all four cases.
A sandbox runs one request at a time. Naming a container another of your own requests is still using is a 409: the id is good and a retry works.
A response carries a container only when the sandbox really will still be there.
A protocol backend that declines the idle timeout Otari asks for is told to
destroy the session at the end of the request, and the response names no container rather than one that is already gone.
container is only the gateway's where the gateway runs the code. When the
provider serves the code execution (see
Code-execution executor):
- The provider's own
containerfield is forwarded untouched, so an id they minted still resumes their container. autois refused rather than forwarded.- An
otari_cntr_…id Otari minted pins execution to Otari's sandbox under executorauto, so a client can keep a container across turns without tracking which executor served each.Otari-Code-Execution: providerand a workspace policy pinned to the provider still win, and the id is then refused. - The provider's own id is never forwarded on the deployment's provider key
(the one a hosted provider serves a model on), because every organization
shares that account. Such a request is refused with a 400, and a routing
policy passes over that candidate for one on a key of your own. Asking the
provider for a new container (OpenAI's
{"type": "auto"}) still passes.
container: "auto" is best-effort: a deployment that holds nothing (TTL set to
0) serves the request and reports no container. An id is a requirement, so the
same deployment refuses it.
A container keeps what earlier runs staged into it, so re-entering one reads
those files. An API key therefore needs files:read as well as code:execute
to send an id back, and is refused with a 403 naming the scope. A key without
it is served normally and reports no container, because one it could never
re-enter is worth nothing to it.
The provider's own timer does the reclaiming: the gateway tells it the idle timeout when the request ends, and a periodic sweep only drops the rows that named a sandbox nobody can resume any more.
A request written for a provider's own sandbox keeps its provider's vocabulary:
Anthropic's {"type": "code_execution_20250825"} on /api/v1/messages, OpenAI's
{"type": "code_interpreter"} on /api/v1/responses, or the bare
{"type": "code_execution"}. The executor decides who runs the code such a
declaration asks for:
| Executor | Who runs the code |
|---|---|
auto (default) |
Decided per attempt: the provider, when the model that attempt goes to runs that tool natively in that wire format; otherwise Otari's sandbox. A request naming a container Otari minted runs here, since the sandbox it names is here (see Reusing a sandbox across requests). |
otari |
Always Otari's sandbox. |
provider |
Always the provider; the declaration is forwarded untouched and Otari's sandbox is never used. On a fallback to a model that cannot run it, that attempt fails like any other. Use auto to keep the provider's tool and use the sandbox only on a fallback that needs it. |
Under auto, an Anthropic Messages request carrying code_execution_20250825
runs natively against an Anthropic model, and the same request against an open
model runs on the sandbox, with the same server_tool_use and
code_execution_tool_result blocks coming back.
Fallbacks are decided the same way, one attempt at a time. A routing policy or
catalog ID that falls back from Claude to Claude on Vertex or Bedrock sends
Anthropic its own tool, and only if Anthropic fails before any output does the
fallback run the code on the sandbox; a request Anthropic answers never opens
or pays for one. A fallback that cannot run on the sandbox (code execution off
for the workspace, no sandbox price under require_pricing, or a container id
from another provider) is skipped rather than refusing the whole request, and
the request is refused only when no attempt can run. A
request that also declares otari_code_execution decides every attempt alike
instead, running the code on the sandbox unless every model runs it natively.
An anthropic-beta header, a context_management field (which configures
one of those betas), and a safeguards field (Claude Code's auto-mode tool
checks) are dropped rather than refused against a model its provider serves
with no Messages API of its own (any non-Claude model on Bedrock, say, or a
Bedrock Claude request that sets output_format). Claude Code judges the tool
calls itself there.
On Responses a claimed code_interpreter is answered with a
code_interpreter_call item per run, in the order the calls ran among the
gateway's other native items (a web_search_call, say). Chat Completions has no
native shape, so a claimed declaration there resolves inside the tool loop and
only the final message is returned.
Gemini runs code natively on both Chat Completions and Messages, so under auto
a Gemini model keeps the bare code_execution form on either format, and
Anthropic's code_execution_<date> on Messages. Otari rewrites the declaration
into Gemini's own {"code_execution": {}} for each attempt that goes to Gemini
(a fallback to another provider still receives it as written). A request may
also send {"code_execution": {}} itself; Otari reads it as the bare form, so a
workspace pin or a fallback with no native code execution decides it the same
way. On Messages the run comes back as the same server_tool_use and
code_execution_tool_result blocks Anthropic returns. On Chat Completions,
which has no native shape, it comes back on the assistant message as
extra_content.google.code_execution: a list of executable_code,
code_execution_result and code_execution_output items in the order Gemini
produced them. For every other provider nothing runs natively on Chat
Completions, and the bare form is no other provider's, so under auto those run
on the sandbox.
The executor also decides where an attached file goes. Code running on Otari's sandbox is given the file from Otari's own store, and code running in the provider's container is given a short-lived copy at that provider, because such a container reads only files that provider holds. Either way the file reaches the code rather than only the model, and an attempt that falls back to the other place is given the file there. See Files and code execution.
Three layers choose the executor. The workspace pin wins over both of the others; the header wins over the deployment default:
- The deployment default,
code_execution_executor(OTARI_CODE_EXECUTION_EXECUTOR), editable on the Tools page. Unset meansauto. - A workspace policy may pin
executor. A pin is a decision the request cannot argue with: a header that disagrees is refused with 403. - The
Otari-Code-Executionheader (auto,otariorprovider) chooses per request where the workspace has not pinned. A value outside that vocabulary is a 400.
With no sandbox (no sandbox_url for the protocol provider, and no hosted
sandbox_provider such as e2b) there is nothing to bring the code to, so a
provider
declaration is always forwarded and no policy is read for it. Asking for otari
without a sandbox is a 400. The explicit otari_code_execution type is always
run by Otari, whatever the executor says. When a claimed declaration runs on the
sandbox, an otari_code_execution entry beside it is folded in rather than
refused; when the declaration stays with the provider, the two together are
still refused, because one request cannot address two sandboxes.
A gateway-run execution is described back in the caller's vocabulary with ids
Otari reserves (otari_srvtoolu_…, otari_ci_…, otari_cntr_…). When a client
echoes such a turn on its next request, a Messages pair is folded into a text
block, and a Responses item into an assistant message, so the model keeps the
code and its output; a provider's own items carry the provider's ids and pass through
untouched. Uploaded files the request references are seeded into the sandbox and
files the code produces come back as stored files, announced in Anthropic's
code_execution_output entries by their file_id, and on Responses as an
image output naming the URL Otari serves each produced image from (under
public_base_url where it is set, otherwise under the address the request
arrived on; any other produced file is listed and downloadable by id). A file the provider's own sandbox produced is copied
into Otari's store under the provider's own ID. See
Files and code execution. A container id
the provider issued addresses the provider's container, not the sandbox; to keep
Otari's sandbox across turns, see
Reusing a sandbox across requests.
A workspace policy can disable code execution or narrow the deployment limits:
enabledmax_iterationsexec_timeout_sdefault_purpose_hint- allowed tool kinds
- an allowed sandbox image
executor, the one field that is a choice rather than a narrowing (see above)
Manage it under
/api/v1/workspaces/{workspace_id}/code-execution-policy. The dashboard's Code
execution page sets enabled and executor; every other field is set through the API. A policy
cannot enable a missing deployment backend or exceed the deployment limits.
Workspace-selected images must come from
sandbox_allowed_session_images or the deployment's own session image, as
environments a direct run names must.
The authenticating API key determines the workspace. A workspace with no policy
gets what code_execution_workspace_default says: true, deployment defaults
apply; false, code execution is off until a workspace owner or admin turns it
on, and the request is refused as if a disabled policy were stored. It defaults
to true. The Playground's tools menu and the policy endpoint's default_enabled
field read the same setting. The refusal's message names the dashboard's Tools >
Code execution page, whose tool row says whether the selected workspace's
requests may declare the tool.
Fetch is disabled by default because it permits model-directed outbound requests.
Enable it at deployment time with web_fetch_enabled: true in config.yml or
OTARI_WEB_FETCH_ENABLED=true in the environment. When disabled,
otari_web_fetch remains discoverable with "available": false, requests
declaring it are rejected without affecting other tools or ordinary completion
requests, and POST /api/v1/fetch answers 400. The switch
covers the managed fetch tool and direct fetch only; search result enrichment
follows web_search_extract.
Declare Fetch on any completion API with {"type": "otari_web_fetch"}. The
model-facing function accepts exactly one field:
{"url": "https://example.com/article"}Otari retrieves one public HTTP or HTTPS URL, validates every redirect, and
extracts HTML, textual formats (including Markdown, JSON, XML, and JavaScript),
or text-bearing PDF content. From an HTML page it keeps the content as light
Markdown and leaves out the page's navigation, banners, footers and sidebars: the
page's <main> or <article> elements where it marks them, its text without those
landmarks otherwise. Private, loopback, link-local, and otherwise unsafe
destinations are rejected. This is the built-in fetcher, builtin_fetch, which
serves the tool unless web_fetch_default_tool names a fetch instance of a
fetch provider. Anthropic's own fetch keyword is passed through
unchanged unless the request asks Otari to run it.
The tool result contains the display-safe source URL, the content type (left out when a fetch provider does not report one), an optional requested URL when redirects changed the destination, extracted content, and a warning that fetched content is untrusted. URL query strings and fragments are omitted from the displayed metadata. The complete result is limited to 50 KiB of valid UTF-8; the downloaded body is limited to 5 MiB and PDF extraction is also bounded by page, time, memory, and intermediate-output limits.
Search and Fetch share a limit of web_search_max_calls attempted calls per
request, 10 unless the operator sets another, across model turns and routing
attempts. Invalid, blocked, and failed calls consume that allowance; enriching a
search's results does not. Once the limit is reached, later rounds no longer
offer Search or Fetch, as for a used-up
max_uses: the model is told they
reached their limit, and when no other tool is left the next round is the last
one. A call past the limit within one round gets
[tool error] web search call limit reached for this request (or web fetch),
which the model can recover from, and a Chat Completions client sees the call in
otari_tool_calls as failed with the tag call_limit.
Successful Fetch calls are billed as Pricing a gateway-run
tool says: at the price of the fetch instance that
served them, or at otari:web_fetch on an organization's fetch key. Ordinary
Fetch failures return sanitized tool errors, are counted as errors, and are not
billed.
Declaring Fetch authorizes the model to make arbitrary public GET requests within the workspace domain policy. Fetched content can contain prompt injection. For example, a malicious page may instruct the model to encode conversation or tool data into a later Fetch URL on an attacker-controlled domain. Disable Fetch or restrict allowed domains when that residual egress risk is unacceptable.
A fetch instance, under fetch_tools (see Search tools),
names a provider for otari_web_fetch, for POST /api/v1/fetch
and for enriching search results. A fetch provider's cost tier is set only by
the tool's configuration where the provider reports no cost, as
Search providers says for a search provider's.
web_fetch_default_tool names the instance the fetch tool runs on, and the one
that enriches search results, so setting it moves enrichment too. A workspace
whose organization has a fetch key runs both on
that key instead. A search instance whose fetch_tool names a fetch instance
the gateway serves is enriched by that instance whatever the key or the default
say; when the name matches none, or any-fetch no longer serves its provider,
enrichment falls back to the key, then the default, then the built-in fetcher.
POST /api/v1/search-tools/{name}/test with a url tries an instance.
On a fetch instance, the provider fetches the page and follows its redirects on its own side:
- Otari checks the requested URL before the call, and the URL the provider
reports finding the page at after it. Its host must pass the domain policy,
and may not be
localhostor a non-public IP address in any of its forms. - Other hostnames are the provider's to resolve; Otari does not check where they lead, as the built-in fetcher does.
- DeepSeek, Exa, Tabstack and You.com answer with the URL as asked even after
a redirect (
reports_final_urlis false in the provider catalog), so a redirect they follow escapes the domain policy. Where a workspace's domain lists must hold on every hop, keep the fetch tool, and enrichment, onbuiltin_fetch. - When enriching a search's results, the same checks apply under the search's own domain rules.
- A provider's failure reaches the model as
[tool error] <provider> fetch failed (<tag>), with the HTTP status when there is one, and never with the provider's own message.
Each provider's limits are in the any-fetch README.
- DeepSeek (
deepseek) needs an API key, read from the instance'sapi_key, such as${DEEPSEEK_API_KEY}, the key DeepSeek's models take too. Name the instance apart from a DeepSeek search tool, such asdeepseek-fetch, since names are unique acrosssearch_toolsandfetch_tools. It reports no cost, so a fetch is billed at the instance's own rate (itsprice_per_call, or afetchprice set on the dashboard's Web search page or through the API); a price for one of DeepSeek's models never prices it. DeepSeek's pricing, read 2026-10-19, is $0.75 per 1,000 successful fetches, with at most 25 fetches a second per account, apart from searches, and a limit per domain; its free period covers only calls through DeepSeek's own Harness, Claude Code or Codex, not Otari's. A page it cannot turn into markdown, a missing one or a PDF included, fails the fetch. - Exa (
exa) needs an API key, read from the instance'sapi_key, and reports what each fetch costs (costDollars.total). - Firecrawl (
firecrawl) needs an API key, read from the instance'sapi_key, such as${FIRECRAWL_API_KEY}, the key a Firecrawl search tool takes too. Name the instance apart from a Firecrawl search tool, such asfirecrawl-fetch, since names are unique acrosssearch_toolsandfetch_tools. It reports Firecrawl credits, not dollars, so a fetch is billed at the instance's own rate (itsprice_per_call, or afetchprice set on the dashboard's Web search page or through the API). Firecrawl's pricing and billing pages, read 2026-11-25, put a page at 1 Firecrawl credit, and a Firecrawl credit on the published plans costs from $0.0006 (Scale, billed yearly) to $0.005 (the Hobby plan's extra credits). A PDF adds 1 Firecrawl credit per page parsed, so Otari sendsparsers: [{type: pdf, maxPages: 100}, image]unless the instance's or an organization key'soptionssetparsers: a fetch then parses at most the first 100 pages of a PDF, the page limit Otari's own fetch applies, and costs at most 101 Firecrawl credits.parsersis operator-only, so a workspace or a request cannot replace it. Price an instance whose options raise the cap with that in mind. Firecrawl answers with the URL it found the page at after redirects, so the domain policy holds on the page a redirect led to. A page Firecrawl cannot read, such as a zero-byte file or a private address, fails the fetch, and a site's error page comes back as its text. Firecrawl may spend up to 60 seconds on a page unless the instance'soptionsset itstimeout(milliseconds), so give the instance atimeoutto match. - Tabstack (
tabstack) needs an API key, read from the instance'sapi_key, such as${TABSTACK_API_KEY}. It reports no cost, so a fetch is billed at the instance's own rate (itsprice_per_call, or afetchprice set through the API). Tabstack's pricing, read 2026-10-13, is 10 credits a page, and a credit costs $0.0001 to $0.0003 depending on the plan and on whether the plan's monthly credits are used up, so $0.001 to $0.003 a page. Tabstack documents up to 15 seconds a page at its defaulteffortand up to 60 ateffort: max, so give the instance atimeoutto match. - You.com (
youdotcom) needs an API key, read from the instance'sapi_key, such as${YDC_API_KEY}, the key a You.com search tool takes too. Name the instance apart from a You.com search tool, such asyoudotcom-fetch, since names are unique acrosssearch_toolsandfetch_tools. It reports no cost, so a fetch is billed at the instance's own rate (itsprice_per_call, or afetchprice set on the dashboard's Web search page or through the API). You.com's pricing, read 2026-11-11, is $0.90 per 1,000 URLs. Itsparse_effortis the cost tier:lite, which Otari sends unless the instance'soptionssay otherwise, adds nothing, whilestandardadds $0.50 per 1,000 PDF pages, so a 350-page PDF costs $0.0009 underliteand $0.1759 understandard. Only the instance's configuration sets it, since You.com reports no cost; price an instance set tostandardfor the PDFs it will read. You.com may spend up to 30 seconds on a page unless the instance'soptionsset itstimeout(2 to 100), so give the instance atimeoutabove that. A page You.com cannot extract, such as a zero-byte file or a private address, fails the fetch, and a site's error page comes back as its text.
The in-loop tool searches with the deployment's in-loop default:
web_search_default_tool when it names a search instance, else the legacy
settings below while they are set, else the only search instance when there is
exactly one (see Search tools).
web_search_default_tool: none turns it off. A workspace's
organization search key comes before all of them.
On a search instance, the search runs on the instance's
provider, key, options and timeout, and asks for the
request's result count, which the instance's own max_results and the
workspace's max_results may lower. With neither, only the provider's own
maximum caps it: Exa returns up to 100. The declaration's provider_options are checked
against the provider, as on direct search: a key it does not
take, or takes only from the deployment, is refused with a 400 before the model is
called, while a workspace's such key is left out with a warning. A provider's
failure reaches the model as
[tool error] <provider> search failed (<tag>), with the HTTP status when there
is one, and never with the provider's own message; a Chat Completions client sees
the same fields in otari_tool_calls. Results are numbered across a request's
searches, so a second search's first result follows the first search's last, and
each shows its date as an ISO date, or date and time when the provider gives one.
A result that comes without page text is enriched through the fetch instance the
search instance names in fetch_tool, else the organization's
fetch key, else web_fetch_default_tool, else the
built-in fetcher, for the first 20 such results of a search; the rest show their
snippets. Each page read is billed as a fetch on what read it, and the pages of
one search are held against the caller's budgets together before any is read
(see Pricing a gateway-run tool). The built-in
fetcher's page replaces the result's snippet, as
on the legacy settings below. A fetch instance is asked for
at most the 1,500 characters a result shows, within the fetch instance's
timeout, and its page follows the snippet rather than replacing it, because a
provider such as Tabstack answers a site's error page as the page's text. A page
that cannot be fetched, or that the domain checks refuse, leaves the result its
snippet.
On the legacy settings, which are deprecated, Otari reaches a licensed search
API directly: web_search_provider set to tavily or brave and
web_search_provider_api_key to that provider's key. A search tool on that
provider replaces them; see the upgrade note
From 0.47.
web_search_url, which is deprecated (see
The legacy SearXNG settings),
points at a SearXNG instance, such as the bundled one
(try it), which any-search's SearXNG
adapter asks to search the engines in web_search_engines, else duckduckgo,
mojeek, qwant and wikipedia; SearXNG skips a name it has no engine for,
and when it knows none of the names it searches its own default engines, so a
misspelled engine can send the query to engines the list leaves out. A
configured provider wins over it.
When content extraction is enabled, Otari retrieves each result through its bounded public-web client. It validates and pins the resolved address before connecting, validates every redirect, rejects HTTPS-to-HTTP downgrades, follows at most five redirects, and applies one five-second network deadline across DNS, connection setup, redirects, and body streaming. The decoded response body is limited to 5 MiB.
Otari extracts HTML, textual formats (including Markdown, JSON, XML, and
JavaScript), and text-bearing PDFs. HTML and PDF parsing runs in a supervised
single-worker process with fixed time, memory, queue, page, and intermediate
output limits. Unsafe, unreachable, unsupported, empty, timed-out, or
unextractable results fall back to the search provider's snippet. Page text
the provider already returned, such as Tavily's with include_raw_content, is
used and not fetched again.
Each complete web_search tool result is limited to 50 KiB of valid UTF-8,
including any truncation notice. The 1,500-character per-result content limit
applies before this overall result limit.
Result-page retrieval ignores environment proxies by default. To use an
operator-controlled proxy that blocks unsafe destination addresses, set
web_retrieval_trust_env_proxy: true in the gateway configuration or
OTARI_WEB_RETRIEVAL_TRUST_ENV_PROXY=true. Retrieval then honors HTTP_PROXY,
HTTPS_PROXY, and the ALL_PROXY fallback (including lowercase forms), with
NO_PROXY exclusions. Only HTTP(S) proxy URLs are supported. Proxy settings
are read when the retrieval client is created.
This opt-in delegates connection-time address safety to the proxy, which must
block internal and other unsafe addresses after resolving each destination.
A general forwarding proxy does not provide this protection automatically.
Otari still applies local DNS/address checks, domain policy, redirect checks,
and response limits, so destination DNS must also work on the gateway.
Requests without an applicable proxy, including NO_PROXY matches, remain
IP-pinned. A failed proxy request never falls back to a direct connection.
This deployment-only setting cannot be enabled by a tool request or workspace.
A workspace web-access policy can:
- disable
otari_web_search,otari_web_fetch, andPOST /api/v1/search - lower
max_results, forotari_web_searchandPOST /api/v1/search; unset, the tool's ownmax_resultsbounds it, or else the provider's own maximum - narrow allowed domains or add blocked domains for Search results and Fetch destinations, including redirects
- provide a default purpose hint
- supply provider options
- pin
search_executorandfetch_executor, who runs a provider's own search and fetch keywords (see Web-search interception and Anthropic's web fetch); like the code-executionexecutor, these are choices rather than narrowings
Manage it under /api/v1/workspaces/{workspace_id}/web-search. The dashboard's
Tools > Web search page sets enabled, the two executors, max_results, the
domain lists, and the provider options, with a field for each option of the
provider the workspace's searches run on; the purpose hint is set through the
API. Each tool's row says whether the selected workspace's requests may
declare it, and why not when they may not. A request that declares a web tool
in a workspace with enabled off is refused with a 403 web_access_disabled
whose message names this page. A Search with nothing to run on, neither the
deployment's own search nor an organization key, is refused with a 400 that
says so, whatever enabled is.
max_results, the purpose hint, and provider options apply only to Search.
Workspace values can narrow deployment policy but cannot enable a missing
backend, enable deployment-disabled Fetch, or relax an operator limit. Fetch
remains available subject to deployment and workspace policy when no Search
backend is configured.
On direct search, the policy's switch and its max_results apply; its domain
lists, purpose hint and provider options do not.
A workspace with no policy gets what web_search_workspace_default says: true,
nothing is narrowed; false, web access (all three doors above) is
off until a workspace owner or admin turns it on, and a request is refused as if
a disabled policy were stored, whatever search key the organization holds. The
Playground's tools menu and the policy endpoint's default_enabled field read
the same setting. It defaults to true.
An organization can bring its own provider keys, so its workspaces' searches and
fetches are paid by its own accounts and count against its own quotas, rather
than the deployment's. A search key alone leaves the pages a search reads to
enrich its results on the deployment's fetch instance and account (see
Pricing a gateway-run tool). A fetch key moves
them to the organization's, except where the search runs on a search instance
whose fetch_tool names a fetch instance: that instance reads them, on the
deployment's account. web_search_extract: false reads none. Each key has a
kind, fixed when it is added:
- a
searchkey serves model-initiated search and a direct search that names no tool. Its provider is oneGET /api/v1/search-tools/providerslists. Asearxngkey names its own instance inapi_base, since a key never takes the deployment'sweb_search_url; - a
fetchkey serves the fetch tool and the enrichment of search hits. Its provider is oneGET /api/v1/search-tools/providers?kind=fetchlists.
Organization owners and admins manage the keys on the dashboard's
organization Providers > Web search page, or under
/api/v1/organizations/me/web-search-keys: add, rename or replace a key,
archive it, and make one key of each kind the organization's default or stop it
being the default (POST or DELETE on /{key_id}/default). Only the
last four characters of a key are ever shown. A key brings the organization's
own account or its own server, never the deployment's: it carries an API key for
any provider with an address of its own, even one whose API key is optional. A
key may also carry its own api_base and provider options, which are checked
against the provider when the key is written. An api_base
must use https when the key carries an API key, and must reach public addresses
only, whatever OTARI_PROVIDER_ALLOW_PRIVATE_HOSTS says, since an organization
rather than the operator chose it. Calls to it are held to the same rule: each
one connects to the address that was checked, follows no redirect, and bypasses
any environment proxy, as calls to a workspace's own model endpoint do. Moving
a key that holds a secret to another api_base needs the secret in the same
request (api_key, and any masked options entry), since the next call sends
it there. An organization's model provider keys follow the same rule, with
client_args in place of options.
A key's calls never fall back to the deployment's own key or endpoint for its
provider.
Each workspace uses one key of each kind:
- the key of that kind the workspace pinned as its own, if any;
- otherwise the organization's default of that kind;
- otherwise none: the workspace uses the deployment's instance.
So a key the organization adds serves no workspace until the organization makes
it the default or a workspace pins it. A key the workspace turned off, an
archived key, or one this deployment cannot decrypt is passed over. A
workspace's owners and admins pin or turn off keys under
/api/v1/workspaces/{workspace_id}/web-search-keys, which any member of the
workspace can read to see which keys it uses and, as search_provider and
fetch_provider, the providers its searches and fetches run on;
deployment_search_tool and deployment_fetch_tool name the deployment's own
tools it uses when no key serves it. On the dashboard, Tools > Web search lists,
for each kind, the deployment's default tool and the organization's keys, and
marks the one the workspace uses; its owners and admins choose a key there to
pin it, or choose the organization's default or the deployment's tool to remove
the pin, and any other member sees the list read-only.
A workspace with a usable search key serves an explicit otari_web_search
declaration even where the deployment has no search of its own, and the
workspace's web-access policy still applies. GET /api/v1/tools, for an API
key, and the Playground's tools menu count that key when they work out whether
web search is available. A provider-native search declaration or the Otari-Web-Search header is
handed to Otari only where the deployment can search, since that is decided
before the workspace's policy is read. Elsewhere such a declaration goes to the
model's provider.
A key's calls are labeled org:<provider> and priced under otari:web_search
or otari:web_fetch, at the cost the provider reported when it reports one (see
Pricing a gateway-run tool).
For evaluation, the bundled SearXNG backend needs no key. Start it:
docker compose --profile web-search upWhile OTARI_WEB_SEARCH_URL is unset, Docker Compose points the deprecated
web_search_url at it. With the variable empty, declare a searxng search tool
instead, as
The legacy SearXNG settings
shows. Then declare the tool on a request:
{
"model": "anthropic:claude-sonnet-4-6",
"messages": [{"role": "user", "content": "Find the latest Python release."}],
"tools": [{"type": "otari_web_search"}]
}Public SearXNG engines may rate-limit automated traffic, so prefer a licensed
provider for production. A runnable example lives under demo/web-search/.
POST /api/v1/search lets the caller submit a query directly
instead of waiting for a model to request one. Configure its named providers
through search_tools or the Search tools API.
A search tool named in web_search_default_tool serves model-initiated search
and unnamed direct searches, so the two can share one backend. They remain
distinct surfaces with separate pricing keys.
A direct search that names no tool runs on the workspace's usable
organization search key, if it has one, in place of
the deployment's default tool. The request is still checked against the key's
allowed_tools, rate-limited and timed out as that tool and logged under its
name, or, with no default tool to pick, as web_search on the key's provider
with a 30 second timeout. The search is priced under otari:web_search. A search that names a tool, in the path or in
search_tool_name, runs on that tool with its own key.
A deployment with no search tool falls back to the search backend the legacy
settings describe (web_search_provider with its key, else web_search_url),
as the in-loop tool does. A direct search serves it as a tool named after its
provider, such as tavily, on the deployment's account: priced under
otari:web_search, charged to the organization's funds, and granted in
allowed_tools by that name. Tavily keeps returning page text, as it does in
the loop. Adding any search tool ends the fallback; one named after the same
provider replaces it without callers changing what they name.
GET /api/v1/search-tools/catalog lists the tools a direct search may name,
with each one's configured rate for the caller's organization (what a call is
charged when its provider reports no cost; null when no rate row prices it)
and which is the default,
and any API key may read it, as it reads GET /api/v1/models. An API key sees
only the tools its allowed_tools grants, and nothing when its workspace has
web access off. It never returns a tool's key, endpoint or options.
The request, the response and the errors are in the API reference.
A search instance serves direct search and, as the in-loop default,
the in-loop tool, labeled <provider>:<search-tool-name> on both and priced as
Pricing a gateway-run tool says.
Some providers charge each search or fetch at one of a few prices, chosen by an
option: the provider's cost tiers, such as Perplexity's search_type. Where the
provider does not report what a call cost, only the tool's configuration sets
that option, in a tool's options or in an
organization key's: a request that sets it is
refused with a 400, and a workspace's provider_options that set it are left
out with a warning. So a tool's calls run at the tier its price was set for, and
an organization key's at the tier its owners and admins chose for their own
account. To offer more than one tier, configure one tool for each, at its own
price. GET /api/v1/search-tools/providers marks such an option cost_tier, and
operator_only while it is set only this way; ?kind=fetch lists the fetch
providers'.
A deployment-paid tool on a provider that reports no cost also allowlists the
native options a tenant may set. A request's unlisted option is refused with a
400, and a workspace's is left out with a warning. A provider or option not yet
reviewed for its cost is therefore refused rather than forwarded. Shared
parameters keep their own rules. Calls on an organization key do not use this
allowlist, since the organization pays for them; their operator_only and cost
tier rules still apply.
A request chooses how many results a search returns, and on a tool that reads a
page for each result, as under Firecrawl's scrapeOptions, that count is what
the call costs. The max_results in a tool's own options is the most a
search on it returns, on a direct call and in the loop: a request or a workspace
can lower the count, never raise it, and a direct call that names no count gets
that many. Set it on a tool whose options read pages, and set the tool's rate
for that many; the startup log names a tool that sets Firecrawl's
scrapeOptions or You.com's extraction and no max_results. To offer a
search with page text beside one without, configure
one tool for each, at its own price. The max_results in an organization key's
options caps the searches on that key the same way. A provider's own count
option, such as Exa's numResults, sets the count of a direct call that names
none and no ceiling.
A tool whose own max_results is not a whole number of at least 1 does not
run, in the way the next paragraph says of a cost tier, and the startup log
says so. A value config.yml reads from ${VAR} is text, so write the number
itself.
A tool whose cost tier has a value the provider does not take, such as
Perplexity's search_type: Fast, does not run, and the startup log says so: a
search on it answers 400 Search tool '<name>' is not configured correctly., the in-loop
tool does not take it as its default, its connection test is refused, and a
fetch tool is left out, as if nothing named it. The dashboard and the API
refuse such a value when a tool is saved.
-
Brave (
brave) needs an API key, read from the tool'sapi_key, such as${BRAVE_API_KEY}. Brave takes the query in the request URL, which Otari keeps out of its logs. It reports no cost, so a search is billed at the tool's own rate (itsprice_per_call, or asearchprice set on the dashboard's Web search page or through the API). Brave's pricing, read 2026-11-14, is $5 per 1,000 successful requests, with $5 of free credit a month. A search returns at most 20 results, and its hits carry a snippet but no page text. In the tool'soptions,result_filter: webkeeps the answer to web results, andtext_decorations: falsekeeps HTML out of the snippets. -
DeepSeek (
deepseek) needs an API key, read from the tool'sapi_key, such as${DEEPSEEK_API_KEY}, the key DeepSeek's models take too. It reports no cost, so a search is billed at the tool's own rate (itsprice_per_call, or asearchprice set on the dashboard's Web search page or through the API); a price for one of DeepSeek's models never prices it. A key restricted to some models runs it whenallowed_tools, its own or its user's, names it;deepseek:*inallowed_modelsgrants DeepSeek's models alone. Name it apart from a DeepSeek fetch instance, such asdeepseekanddeepseek-fetch. DeepSeek's pricing, read 2026-10-19, is $0.75 per 1,000 successful searches, whatever the number of results, with at most 100 searches a second per account, apart from fetches; its free period covers only calls through DeepSeek's own Harness, Claude Code or Codex, not Otari's. DeepSeek does not charge a search that returns no results, but Otari bills it at the tool's rate like any other successful search. A query may be up to 128 characters, 111 with atime_range. A search returns at most 50 results, and its hits carry a snippet; page text only with theneed_contentoption. -
Exa (
exa) needs an API key, read from the tool'sapi_key, such as${EXA_API_KEY}, and reports what each search costs (costDollars.total), which is what the search is billed at. Exa's pricing, read 2026-10-13, is per search, covering up to 10 results, and every result past 10 adds to it, so a workspace'smax_resultsceiling also bounds what one search can cost. A search with no results reported a cost of 0 when the adapter was written. -
Firecrawl (
firecrawl) needs an API key, read from the tool'sapi_key, such as${FIRECRAWL_API_KEY}. It reports Firecrawl credits, not dollars, so a search is billed at the tool's own rate (itsprice_per_call, or asearchprice set on the dashboard's Web search page or through the API). Firecrawl's pricing and billing pages, read 2026-11-25, put a search at 2 Firecrawl credits per 10 results, rounded up per 10, and a Firecrawl credit on the published plans costs from $0.0006 (Scale, billed yearly) to $0.005 (the Hobby plan's extra credits), so a search for 10 results costs $0.0012 to $0.01. Every 10 results past the first 10 add 2 Firecrawl credits, so the tool's ownmax_results, or a workspace's lower ceiling, bounds the base charge of one search.scrapeOptions, which returns each result's page as text, adds 1 Firecrawl credit per page scraped, plus the scrape options' own, so a scraped search for 10 web pages costs 12 Firecrawl credits. A PDF adds 1 Firecrawl credit per page parsed, so Otari addsparsers: [{type: pdf, maxPages: 100}, image]to ascrapeOptionsthat sets noparsers. Each of the JSON, question, highlights, audio and video formats,redactPIIandcheckPromptInjectionadds 4 more per page, and these add up (the billing page, read 2026-11-30).scrapeOptionsis operator-only, so only a tool's or an organization key's options set it; a workspace or a request cannot override it. Price a tool that sets it for the most a request can ask of it: each result that is a PDF is parsed for as many pages as the tool'sparsersallow, so a search for 100 results under the 100-page ceiling can cost about 10,000 Firecrawl credits, and one on a tool whosemax_resultsis 10 about 1,000. A lowermaxPagesin the tool'sscrapeOptionslowers that further. A search returns 10 results unless asked for more, and at most 100, and its hits carry query-relevant highlights as the snippet, which Otari cuts before a model or a direct search sees them;highlights: falsereturns each site's shorter description. Its hits carry no date, and page text only underscrapeOptions. Firecrawl may spend up to 60 seconds on a search unless the tool'soptionsset itstimeout(milliseconds), so give the tool atimeoutto match. -
Keenable (
keenable) takes an API key but needs none. Without one, a tool searches Keenable's free endpoint, which allows 1,000 searches an hour and 10 a second per IP address, shared with everything else calling from the gateway's address; past that, a search fails withpublic_rate_limit_hourlyorpublic_rate_limit_per_second(HTTP 429). Some sites Keenable serves only with a key, which a keyless search restricted to one fails withpublic_domain_requires_api_key. With a key in the tool'sapi_key, such as${KEENABLE_API_KEY}, no hourly limit applies; anapi_keythat comes out empty, such as that variable left blank, stops the gateway at start, so leaveapi_keyout to search keyless. An organization key on Keenable always carries an API key, so an organization's searches run on its own account, never on the keyless allowance the gateway's address shares. Keenable logs every search, keyed or not, with its query, the caller's IP address and the app name each call sends, and its terms let it use what it receives to improve and train its products; its zero data retention plan covers keyed calls from an organization that has it, never keyless ones (see its data privacy page). Each call names the appany-search; setX-Keenable-Titlein the tool'soptionsto name your deployment, which only the tool's configuration or an organization key's options can set. Otari does not read the cost a keyed answer reports, so a search is billed at the tool's own rate (itsprice_per_call, or asearchprice set on the dashboard's Web search page or through the API); a keyless tool can be priced at 0. Keenable's pricing, read 2026-11-24: keyless searches are free; with a key, 100,000 a month are free, then $4 per 1,000, inproandrealtimemode alike. A search returns at most 50 results, and its hits carry a snippet but no page text. Snippets run to a few thousand characters, which Otari cuts before a model or a direct search sees them;snippet_max_lengthin the tool'soptionsasks for less. Atime_rangekeeps only the pages Keenable knows a publish date for. -
Mojeek (
mojeek) needs an API key, read from the tool'sapi_key, such as${MOJEEK_API_KEY}. Mojeek takes the key and the query in the request URL, which Otari keeps out of its logs. It reports no cost, so a search is billed at the tool's own rate (itsprice_per_call, or asearchprice set through the API). Mojeek's pricing, read 2026-10-13, is per search, in pounds before taxes: £2 per 1,000 on the Startup plan, £3 on Business, Enterprise by arrangement; set the rate in dollars at what your plan costs you. A search returns at most 10 results, the Startup plan's limit, whatever the plan, and its hits carry a snippet but no page text. -
Perplexity (
perplexity) needs an API key, read from the tool'sapi_key, such as${PERPLEXITY_API_KEY}, the key Perplexity's models take too. It reports no cost, so a search is billed at the tool's own rate (itsprice_per_call, or asearchprice set on the dashboard's Web search page or through the API); a price for one of Perplexity's models never prices it. Don't name the tool after one of them, such assonar: until a later release, a tool's price is also read underperplexity:<tool name>, which would be that model's. Perplexity's pricing, read 2026-11-09, is per search, whatever the number of results or the page text asked for, at one of two cost tiers chosen bysearch_type: $5 per 1,000 forweb, the default, and $1 per 1,000 forfast. To offer both, configure two tools:search_tools: perplexity: {provider: perplexity, api_key: "${PERPLEXITY_API_KEY}", price_per_call: 0.005} perplexity-fast: {provider: perplexity, api_key: "${PERPLEXITY_API_KEY}", price_per_call: 0.001, options: {search_type: fast}}
A search returns at most 20 results, and its hits carry page text, the passages Perplexity takes from each page (
max_tokens_per_pagesizes them), and no snippet, so the in-loop tool reads no page for them. Perplexity's own filters, such assearch_domain_filter,countryandsearch_recency_filter, apply when a call passes them inprovider_options; on direct search, the request's top-levelsearch_domain_filterandcountryare applied by Otari as for every provider but Exa. Perplexity refuses atime_rangeor asearch_recency_filtertogether with a publication date filter. -
SearchApi (
searchapi) needs an API key, read from the tool'sapi_key, such as${SEARCHAPI_API_KEY}. SearchApi returns Google's results; it takes the key in a header and the query in the request URL, which Otari keeps out of its logs. It reports no cost, so a search is billed at the tool's own rate (itsprice_per_call, or asearchprice set on the dashboard's Web search page or through the API). SearchApi's pricing, read 2026-11-23, is a monthly plan with a number of searches: from $40 for 10,000 ($4 per 1,000) down to $1 per 1,000 on the largest; only answers with a 200 are billed, and a plan's searches are rate limited to 20% of the plan an hour. A search returns at most 10 results, one page of Google's, and its hits carry a snippet but no page text. Setglandhlin the tool'soptions, such asgl: usandhl: en, to pin the country and the interface language, the one Google renders the page and the result dates in; SearchApi's defaults are those two.hldoes not limit which pages come back: for pages in a language, setlr, such aslr: lang_de. -
Serply (
serply) needs an API key, read from the tool'sapi_key, such as${SERPLY_API_KEY}. Serply returns Google's results; it takes the key in a header and the query in the request URL, which Otari keeps out of its logs. Setglin the tool'soptions, such asgl: us: without it, the region a search runs from can change between calls, and the results and the language of their dates with it. It reports no cost, so a search is billed at the tool's own rate (itsprice_per_call, or asearchprice set on the dashboard's Web search page or through the API). Serply's pricing, read 2026-10-15, is prepaid credits, one per search not served from its cache, from $2.00 per 1,000 (2,500 for $5) down to $0.75 per 1,000 in the largest packs; a new account gets 2,500 credits for its first 30 days. A search returns at most 10 results, and its hits carry a snippet but no page text. -
SpecStream (
specstream) needs an API key, read from the tool'sapi_key, such as${SPECSTREAM_API_KEY}, and reports what each search costs (price_usd), which is what the search is billed at. SpecStream's pricing, read 2026-11-12, is per search at one of two cost tiers chosen byspeed: withdefault, $5 per 1,000 searches of up to 10 results, and withfast, $1 per 1,000; each started block of 10 results more adds to it, so a workspace'smax_resultsceiling also bounds what one search can cost, and a search with no results costs nothing. Since it reports its cost, a call may setspeedinprovider_options. Otari asks for 10 results unless the call setsmax_results, at most 100. Hits carry a snippet, and page text only with thepassagesoption; atime_rangebecomes SpecStream'safter:operator in the query. -
Synthetic (
synthetic) needs an API key, read from the tool'sapi_key, such as${SYNTHETIC_API_KEY}. It reports no cost, so a search is billed at the tool's own rate (itsprice_per_call, or asearchprice set on the dashboard's Web search page or through the API). Synthetic's pricing, read 2026-11-05, includes the search API in every subscription (Go at $9 a month, Standard at $30, Big at $90) and names no price per search; a key whose account has no subscription is refused. Set the rate at what a search costs you, or 0. It takes no result count and no recency filter: Otari keeps at most 10 results and, for atime_range, drops the hits dated before it. Its hits carry page text but no snippet. -
Tavily (
tavily) needs an API key, read from the tool'sapi_key, such as${TAVILY_API_KEY}. It reports credits, not dollars, so a search is billed at the tool's own rate (itsprice_per_call, or asearchprice set on the dashboard's Web search page or through the API). Tavily's pricing, read 2026-11-16, is $0.008 a credit pay-as-you-go, $0.005 to $0.0075 on a monthly plan.search_depthis its cost tier:basic(its default),fastandultra-fastcost 1 credit a search,advanced2, so configure one tool per depth you offer, each at its own price. A search returns at most 20 results, with a snippet; setinclude_raw_content: truein the tool'soptionsfor each page's full text, which spares the in-loop tool reading the pages itself. -
You.com (
youdotcom) needs an API key, read from the tool'sapi_key, such as${YDC_API_KEY}. It reports no cost, so a search is billed at the tool's own rate (itsprice_per_call, or asearchprice set on the dashboard's Web search page or through the API). You.com's pricing, read 2026-11-09, is $5 per 1,000 searches, up to 100 results each, highlights included.extraction: {extraction_mode: full_page}, which returns each page as text, adds $1 per 1,000 pages You.com crawls live rather than serves from its cache, so a full-page search for 10 results costs from $0.005 to $0.015.extractionchanges the per-page cost, so a deployment-paid tool takes it only from the tool's own options, not from a workspace or a request. On an organization key they may set it, since the organization pays. Set a deployment-paid tool's rate for the extraction its options choose and the most results a request can ask of it: underfull_pagea search for 100 results can cost $0.105, and one on a tool whosemax_resultsis 10 at most $0.015. A search returns at most 100 results, 50 under highlights, the default, and its hits carry the highlights as a snippet and page text only underfull_page. Highlights share 8,192 tokens across a search's results, so a search for few results returns long snippets, which Otari cuts before a model or a direct search sees them;extraction: {extraction_mode: highlights, highlights: {total_max_tokens: 1024}}asks for less. -
SearXNG (
searxng) is self-hosted and reports no cost, so a search is billed at the tool's rate. The tool'sapi_baseis the instance's root URL, and the instance must listjsonundersearch.formats, or every search fails withforbidden, SearXNG's 403. Searches use GET, SearXNG's default;method: postsends them as form data, which keeps the query out of the instance's access log. Only the operator setsmethodandengines, the engines to search, since an engine that fails is suspended for every caller of the instance. A search that leaves no usable hit while an engine failed fails withengines_unresponsive. Hits carry SearXNG's snippet and date, and no page text.
POST /api/v1/fetch reads one page the caller names, as POST /api/v1/search
runs a query, so a client that runs its own agent loop reads pages through the
gateway without a completion for each. It runs on the deployment's fetch tool,
web_fetch_default_tool else builtin_fetch, or on the tool named in the path
or in fetch_tool_name, builtin_fetch included. While
web_fetch_enabled is off, a call is refused with 400, as
otari_web_fetch is.
A direct fetch that names no tool runs on the workspace's usable
organization fetch key, if it has one, in place of
the deployment's tool, and is priced under otari:web_fetch; a fetch that names
a tool runs on that tool with its own key. Either way the request is checked
against the key's allowed_tools, rate-limited and timed out as that tool and
logged under its name, and priced as
Pricing a gateway-run tool says: the provider's
reported cost, else the tool's own fetch price, builtin_fetch's included.
The workspace's web access policy applies in full: its switch, and its allowed
and blocked domain lists, which bind the URL asked for and, on builtin_fetch,
every redirect. A provider tool is held to the URL it reports finding the page
at, as Fetch providers says.
| Situation | Response |
|---|---|
| A URL the domain lists disallow | 403, before anything is held |
Not a public http or https URL, or a URL naming a private address |
400, before anything is held |
| A host the built-in fetcher cannot resolve, or that resolves to a private address | 502 (a provider tool resolves hosts on its own network, unchecked) |
The request, the response and the errors are in the API reference.
Each note applies when upgrading from the release it names to a later one.
A request that declares otari_web_fetch without otari_web_search draws on
web_search_max_calls, as every other request does, and a call past it gets a
[tool error] the model can recover from. It had a fixed limit of 10 calls,
and an eleventh failed the whole request with 422, or ended a stream with an
error event. Its fetches are labeled, priced and checked by require_pricing
as before.
Brave and Tavily run on any-search's adapters wherever Otari searches with them:
web_search_provider and its key, an organization key, and a search tool on
brave or tavily, which is new. For a deployment or an organization that
already searches with either:
- In the loop, a failed search is a
[tool error]the model can recover from, rather than a502for the whole request, and the call limit isweb_search_max_calls, with a[tool error]past it, rather than a fixed 10 and a422. web_search_provider: tavilykeeps asking Tavily for each page's full text. So do the organization Tavily keys that exist at the upgrade, which addsinclude_raw_content: trueto their options. A Tavily key or search tool added later gets snippets only, Tavily's own default, unless its options setinclude_raw_content.- Hits without page text, Brave's always and Tavily's without
include_raw_content, have their pages read through the fetch tool and billed as fetches, as for any search tool (see Pricing a gateway-run tool). Withrequire_pricingon, a search whose pages would be read through an unpriced fetch tool is refused with402, so price that tool,builtin_fetchunlessweb_fetch_default_toolor an organization fetch key names another; the startup log names it while it has no price.web_search_extract: falsereads no pages. This holds forweb_search_provider: tavilytoo: Tavily returns page text for nearly every hit, but the check runs before the search, so the fetch tool needs a price, which can be0. - An organization key's in-loop searches are labeled
org:braveororg:tavily, where they were labeledotari:web_search, and are still priced underotari:web_search. A key may carry its ownapi_baseand its provider's options, checked when it is written. provider_optionsare checked against the provider's options, where the older backend forwarded a few (Brave'stime_rangeandcountry; Tavily'ssearch_depth,topic,time_rangeandinclude_answer) and dropped the rest silently. A workspace's option the provider does not take is left out with a warning; the same option in a request'sotari_web_searchdeclaration is refused with400.time_rangetakesday,week,monthoryear. Brave'scountryis sent as written, so Brave answers a full country name such asGermanywith an error.- Tavily's
search_depthis a cost tier (advancedcosts twicebasic), so only a search tool's or an organization key's options set it: a request that sets it is refused with400, and a workspace's is left out with a warning. - On direct search,
include_rawandprovider_optionsare taken, and the request'scountryreaches neither provider; pass it inprovider_options, such as{"country": "DE"}for Brave. A result'sdateis in ISO 8601 form with its zone, such as2026-11-12T22:37:39+00:00. web_search_providerandweb_search_provider_api_keyare deprecated, and the startup log says what replaces them: a search tool named after the provider, with the key (andinclude_raw_content: truefor Tavily) and a price, named inweb_search_default_tool. A coming breaking release refuses to start while they are set.
With sandbox_provider: e2b, a sandbox_session_image, or an image a workspace
pinned, used to be logged as ignored, and every sandbox was E2B's default. Each
is now the name or id of the E2B template the sandbox is created from, so one
that names a container image, such as mzdotai/otari-sandbox-container:latest,
fails every run with a 502. Before upgrading, clear it or set it to a template
in your E2B account, and do the same with sandbox_allowed_session_images and
any workspace policy's image.
An organization owner's or admin's override of otari:code_execution on
/api/v1/organizations/me/pricing is refused with 403, as a price of kind
search or fetch already is. Such an override has priced no sandbox run since
0.33, because code execution runs on the deployment's account. It does price an
MCP tool named code_execution, which is priced under the same key: an
override already stored keeps pricing such a tool's calls until it is deleted,
and without one they take the deployment's price. An override already stored
stays: the organization can delete it, not change it, and the operator can
replace or delete it. The operator sets the price with the master key.
The pages a search reads to enrich its results are billed as fetches on the
fetch instance that read them (see
Pricing a gateway-run tool). That instance needs
a price, as the fetch tool does, or every search it enriches answers 402
under require_pricing. builtin_fetch has one on every upgraded database,
and the startup warning names an instance that lacks one whether or not the
fetch tool is enabled.
otari:web_search and otari:web_fetch no longer price the model's calls on a
tool with no price of its own: they price calls on an organization's own key,
and searches on the legacy settings. The upgrade gives each search and fetch
tool stored in the database, and builtin_fetch, that had no price of its own
the otari:web_search or otari:web_fetch price in force as its own, so its
calls cost what they did. builtin_fetch with neither gets a price of 0. Three
cases are left to you:
- A tool declared in
config.ymlgets no price: give it aprice_per_call. Until then the startup log names it, and withrequire_pricingon a request that would run it is refused with402. - An override you set on
otari:web_searchorotari:web_fetchfor one organization no longer reaches the deployment's tools: set it on each tool. - An
otari:price dated after the upgrade does not reach the tools either: set it on each tool.
A tool added after the upgrade with no price is unpriced. On the search API, a
stored tool the upgrade priced is billed that price: a search that answered
402 is served, and with require_pricing off one that settled at zero is
charged.
A workspace with no pin and no usable default used to fall to the organization's
oldest key, and now uses the deployment's instance. The upgrade keeps every
workspace on the key it used: where an organization has keys of a kind and no
default, its oldest key becomes the default, and a workspace that turned the
default off gets the key it used pinned. One case changes, since the upgrade
cannot see whether a key decrypts: where the key a workspace relies on after it
(its pin, or its organization's default, including an oldest key the upgrade
makes the default) cannot be decrypted here, a workspace that used the next key
now uses the deployment's instance. Check the keys' usable field before
upgrading.
An organization's own override of otari:code_execution or otari:web_search
no longer prices code execution or a search on the legacy settings, since both
run on the deployment's account: set the price the deployment charges with the
master key. Where the deployment charges organizations for what its account
runs, those calls are now charged to the organization's funds even when the
model call was on the organization's own key, so such a request with no funds
paid in is refused with 402.
An organization had one default per provider and now has one per kind. Where it
had both a Tavily and a Brave default, the Tavily one stays the default. A
workspace that had turned the Tavily default off, and had neither pinned a key
nor turned the Brave default off, gets the Brave key pinned, so it keeps
searching with Brave. One case changes: where this deployment cannot decrypt the
Tavily default, the workspaces that searched with the Brave default in its place
now search with the organization's oldest usable key. Check the keys' usable
field before upgrading.
Direct searches were exempt from require_pricing, so where it is on, a search
on a tool with no price of its own now answers 402. Give each search tool a
price, and otari:web_search one if workspaces search on an organization search
key. In config.yml:
search_tools:
exa-search:
provider: exa
api_key: ${EXA_API_KEY}
price_per_call: 0.005or with the master key:
curl http://localhost:8000/api/v1/pricing \
-H "Authorization: Bearer $OTARI_MASTER_KEY" \
-H "Content-Type: application/json" \
-d '{"kind": "search", "model_key": "exa-search", "input_price_per_million": 5000, "output_price_per_million": 0}'Set the rate at about what one search costs: it is what a search holds against
the caller's budget before it runs, and it is billed when the provider reports
no charge of its own. A provider's reported charge still comes first. A zero
rate is valid too and bills as before, but holds nothing. A row written as
exa:exa-search before tools had a kind still counts. The dashboard's Web
search page sets a tool's rate too, except one written from
price_per_call, which the configuration file restores on every start.
require_pricing: false serves unpriced searches again, and unpriced models with
them. And whether require_pricing is on or not, an organization's own pricing
override no longer prices a search on one of the deployment's tools.
A deployment with sandbox_url set that forwarded
code_interpreter, code_execution_<date> or code_execution to a provider
with no native tool for the model now runs it on the sandbox and bills it as a
sandbox tool call. Set code_execution_executor: provider to keep forwarding.
The adapters, and the web-search-brave and web-search-tavily compose
profiles that ran them, were removed in 0.5. On the process that holds
the key, set web_search_provider and web_search_provider_api_key and unset
web_search_url. A web_search_url still pointing at an adapter keeps the deployment looking configured while every search fails, so change both
together.