Drop four TrendsAGI tools into generateText, streamText or an AI SDK agent. @trendsagi/ai returns tool() objects with inputSchema, so the model can list trends, read insights, pull recommendations and preview ad targeting. 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
AI SDK tools with zod input schemas
Drop four TrendsAGI tools into generateText, streamText or an AI SDK agent. @trendsagi/ai returns tool() objects with inputSchema, so the model can list trends, read insights, pull recommendations and preview ad targeting.
Install
npm install @trendsagi/ai @trendsagi/core ai @ai-sdk/openai zodRequired credentials
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";
import { TrendsAGI } from "@trendsagi/core";
import { createTrendsAGITools } from "@trendsagi/ai";
const trendsagi = new TrendsAGI();
const { text } = await generateText({
model: openai("gpt-5-mini"),
tools: createTrendsAGITools(trendsagi),
prompt: "Find a rising skincare trend and suggest a campaign angle.",
});
console.log(text);# 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