Give an OpenAI agent first-party TrendsAGI tools instead of hand-rolled fetches. @trendsagi/openai returns plain JSON Schema definitions for the Responses API or Chat Completions, plus a dispatcher that runs the tool call and returns JSON. This page lists the required credentials, setup example, mapped endpoints, and production notes.
Base URL
https://staging-api.trendsagi.com115
Routes
23
Guides
3
Languages
Five function tools for OpenAI agents
Give an OpenAI agent first-party TrendsAGI tools instead of hand-rolled fetches. @trendsagi/openai returns plain JSON Schema definitions for the Responses API or Chat Completions, plus a dispatcher that runs the tool call and returns JSON.
Install
npm install @trendsagi/openai @trendsagi/core openaiRequired credentials
import OpenAI from "openai";
import { TrendsAGI } from "@trendsagi/core";
import { createOpenAITools, runTrendsAGITool } from "@trendsagi/openai";
const trendsagi = new TrendsAGI();
const openai = new OpenAI();
const response = await openai.responses.create({
model: "gpt-5-mini",
input: "Find a rising skincare trend and summarize the opportunity.",
tools: createOpenAITools(trendsagi),
});
console.log(response.output_text);
// When the model returns a function_call, run it and send the result back:
const call = response.output.find((item) => item.type === "function_call");
if (call) {
const output = await runTrendsAGITool(trendsagi, call.name, call.arguments);
}# Save as quickstart.mjs
node quickstart.mjs1. Install
Add SDK/dependency for this integration path.
2. Authenticate
Set API key and any provider-specific credentials.
3. Map endpoints
Use mapped endpoints below to build deterministic flow.
4. Harden
Add rate-limit backoff, idempotency, and safety gates.
Endpoint Mapping
Each integration is mapped to specific API endpoints so teams can compose deterministic workflows.
Production notes