Skip to main content
OpenAI’s tool calling lets a model invoke functions you define. This guide shows how to implement a Ceramic Search function the model can use to retrieve real-time web results when generating a response.

Get your Ceramic API key

Create a free account to get started.

Generating model responses

Ceramic Search works with both the Chat Completions API and the Responses API. Select the one that matches your project.

Set environment variables

Install dependencies

Full example

When the model decides a search is needed, it returns a tool_calls message. You execute the search, return the results, and call the model again to get the final answer.

Run the example

Save the code to a file, then run it from your terminal:

Building agents

In the Agents SDK, wrap Ceramic Search as a function_tool and attach it to your agent. The SDK handles the tool-calling loop automatically.

Set environment variables

Install dependencies

Full example

Run the example