Prerequisites
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 stableagent_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
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
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: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