@ceramicai/sdk
v0.1.6
Published
Ceramic AI search tool for the Vercel AI SDK
Readme
Ceramic AI SDK
Ceramic AI search tool integration with Vercel AI SDK.
Installation
npm install @ceramicai/sdk ai @ai-sdk/openaiSetup
Get your free API key at platform.ceramic.ai/keys and export it:
export CERAMIC_API_KEY=your_api_keyAlso export any additional API keys you need, e.g., OpenAI:
export OPENAI_API_KEY=your_api_keyExample usage
import { generateText, stepCountIs } from 'ai';
import { openai } from '@ai-sdk/openai';
import { webSearch } from '@ceramicai/sdk';
const { text } = await generateText({
model: openai('gpt-5.5'),
tools: {
webSearch: webSearch(),
},
stopWhen: stepCountIs(5),
prompt: 'What are the latest developments in AI?',
});
console.log(text);Save the file as example.ts. In the same directory, create a package.json with:
{ "type": "module" }Then run:
npx tsx example.tsConfiguration
webSearch({
apiKey: 'your_api_key', // defaults to process.env.CERAMIC_API_KEY
maxDescriptionLength: 3000, // 1000–8000, defaults to 3000
})| Option | Type | Default | Description |
|---|---|---|---|
| apiKey | string | process.env.CERAMIC_API_KEY | Your Ceramic API key |
| maxDescriptionLength | number | 3000 | Max characters per result description (1000–8000) |
Result shape
Each search call returns:
{
requestId: string;
results: Array<{
title: string;
url: string;
description: string;
}>;
totalResults: number;
executionTime: number; // seconds
}