Skip to main content

For AI agents: docs.octen.ai/integrations/openai-tool-calling.md

The model decides when to search, your code runs the query on Octen Web Search, and the model answers from the results.

Get API Key

Create a key from the API Platform.

Web Search API Reference

Full request/response schema.

Install

Quick Start

Set your Octen and OpenAI API keys:
Run a tool-calling loop with Octen Web Search:
Append all of response.output, not only the function calls: reasoning models need their reasoning items passed back together with the tool results.

Add an Extract Tool

Let the model read a full page from a URL it finds, with Extract. Add this code to the Quick Start program, right after functions = {"web_search": web_search}:

Add More Search Tools

Let the model also use Web Search Premier, Broad Search, News Search, Business Search, Pulse Search, Place Search, Image Search, and Design Search. Add this code to the Quick Start program, right after functions = {"web_search": web_search}. Each tool takes a query and returns the response data as JSON, with the same fields as the API reference:

Last modified on November 24, 2026