Skip to main content

For AI agents: docs.octen.ai/integrations/mastra.md

Mastra agents accept the Octen tools for the Vercel AI SDK, from @octen.ai/ai-sdk-tools.

Get API Key

Create a key from the API Platform.

npm

The @octen.ai/ai-sdk-tools package.

Install

Requires Node.js 22.13+.

Quick Start

Set your Octen and OpenAI API keys:
Run an agent that answers with Octen Web Search and News Search:
The as unknown as ToolsInput cast is for TypeScript only: the AI SDK tool type does not match Mastra’s ToolsInput type. See Vercel AI SDK for all ten tools and their options. Skip the tool loop and let Octen run the searches server-side with Auto Search. Point the model at the Octen base URL and enable the built-in octen_search tool. Your Octen API key is the only key you need. Install the AI SDK provider for OpenAI-compatible APIs:
Run the agent:

Last modified on November 24, 2026