Skip to main content
Give OpenAI models real-time web data by wiring the Nimble SDK into function calling. No extra packages needed.

Prerequisites

Set environment variables:
Get a Nimble API key from the dashboard (free trial available). The examples set the Nimble client’s client_source (clientSource in Node) to openai, which sends an X-Client-Source header that attributes requests to this integration. It defaults to sdk when unset.

Quick Start: OpenAI Agents SDK

The OpenAI Agents SDK provides a higher-level framework for building agents. Wrap Nimble tools with the @function_tool decorator and the SDK handles the tool-calling loop automatically.
Python

Agent API V2: autonomous research tool

The tools above (search, extract, crawl, map, and Extract Templates) are synchronous and single-shot. One call returns data directly, and the OpenAI model does the reasoning. Agent API V2 is different. It exposes an asynchronous research agent that plans, searches across many sources, and returns a synthesized answer with a per-claim trust report. The lifecycle is create a run → poll to a terminal state → retrieve the result. Wrap that whole lifecycle in one function so the OpenAI model sees a single “deep research” tool.

1. Wrap the run lifecycle

This helper uses a stable agent_name, so every call — from this process or any other — reuses the same agent and its memory instead of spinning up a fresh one each time. It creates the run, polls until terminal, handles failed and cancelled runs, and returns the answer plus its trust and citation metadata. Errors return a safe message, so no API key or raw exception is surfaced.
Python
Pass an output_schema to agents.run (or agents.runs.create) to get structured JSON in result.output instead of prose. Trust is then keyed by JSON path. See Dataset Building.

2. Expose it as a tool

Wrap the helper with @function_tool and hand it to an agent. The model calls one tool; the async run loop stays hidden.
Python
The tool returns the synthesized answer, an overall confidence grade (high, medium, or low), and the source URLs behind it, so the OpenAI model can weigh how much to trust each claim. See Trust for the full report structure.

Chat Completions API

For more control over the tool-calling loop, define Nimble tools as OpenAI function schemas and handle calls manually.

1. Define the Tool Schema

Python

2. Handle Tool Calls

Python

Node.js Example

Node

Available Tools

Any Nimble SDK method can be exposed as an OpenAI tool. Here are the most common ones:
See the Python SDK and Node SDK docs for the full list of methods and parameters.

Next Steps

Python SDK

Full Python SDK reference with all methods and configuration options

Node SDK

Full Node.js SDK reference with TypeScript support

Web Search Agent

Agent API V2: autonomous research runs with per-claim trust

LangChain

Pre-built LangChain tools and retrievers for Nimble