Integrated tools in the Sabiá API
The tools the Sabiá already uses in the chat (web search, code execution and Data Ocean) are now available in the API. You activate the ones you need on each request.
In the Sabiá chat, the model already searches the web, runs code and queries Brazil’s official data while it answers. Now those same tools are available in the API: you activate them on your own request and they run inside Maritaca’s infrastructure, without you having to build or maintain any of them.
The difference from function calling matters. With function calling, the model hands the work back to your code to run. With integrated tools, the work happens inside Maritaca: the model decides which tools to use, calls them in several steps and returns only the final answer. In the chat, this already happened behind the scenes. In the API, you choose which tools to turn on and get the result ready to use in your application.
The three tools
There are three tools, activated independently. Each one covers a different kind of need.
| Tool | API flag | Models | What it does |
|---|---|---|---|
| Web search | web_search | All Sabiá models | Searches the web and reads page content to answer with up-to-date information and the proper source. |
| Code execution | code_execution | Only sabia-4-thinking | Runs Python and Bash in a sandbox to compute, analyze data and generate files, such as charts and documents. |
| Data Ocean | data_ocean | Only sabia-4-thinking | Queries dozens of official Brazilian databases, from population and companies to health, climate, public safety and the economy, always with real numbers and sources. |
Availability varies by tool: web search works on all Sabiá models, while code execution and Data Ocean are available only on sabia-4-thinking. They all come turned off by default and are activated per request.
How it works
The flow is agentic and runs entirely on the server. You don’t need to orchestrate anything: the model handles the intermediate calls and returns just the result. There are three steps:
- Your request: you call the API and turn on the tools you want, or several at once.
- The work on the server: the Sabiá decides which tools to use and runs them in several steps, internally. The reasoning and the intermediate calls stay internal.
- The response: the API returns only the final answer, already with the sources cited and any files that were generated.
How to activate
You turn on the flags in the call itself, always with stream: false. With the OpenAI library, they go in extra_body. In the example below, the question combines the two: Data Ocean for the official data and web search for what is most recent.
You can combine as many tools as you want (just add code_execution for the third) and even use them alongside your own functions. Each response also reports how many executions occurred, in the usage.tool_execution_details field. The documentation has the full examples, the Responses API and the return formats, at docs.maritaca.ai.
Turning on data_ocean already enables web search and code execution automatically, since Data Ocean answers tend to cross official data with search and calculation.
What you can ask
A few examples of requests that each tool handles on its own, without you needing to fetch the data first or run anything on your side:
“What’s the current dollar exchange rate and what explains today’s move? Cite the sources.”
“Analyze this sales spreadsheet and generate a chart with the month-by-month trend.”
“Compare the average income and the number of companies in the three largest cities in the interior of São Paulo.”
Pricing
Executions are billed per use, on top of the normal token cost. The actual amounts consumed come in usage.tool_execution_details in every response. Since data_ocean turns on web search and code execution together, a request with data_ocean can be billed for all three tools: Data Ocean, web search and code execution.
| Tool | Unit | Price |
|---|---|---|
| Web search | per search | R$ 0.0165 |
| Page read | per page read | R$ 0.066 |
| Data Ocean | per GB processed | R$ 0.10 |
| Code execution | per minute | R$ 0.016 |
Availability
The integrated tools are already available via the API. Web search works on all Sabiá models; code execution and Data Ocean are available only on sabia-4-thinking. The documentation has the complete examples, the Responses API and the return formats, at docs.maritaca.ai.