> ## Documentation Index
> Fetch the complete documentation index at: https://docs.danubeai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Vercel AI SDK

> Give generateText and streamText every Danube tool through three tool definitions

## Install

```bash theme={null}
npm install danube ai
export DANUBE_API_KEY=...
```

## Use

```ts theme={null}
import { generateText, tool, jsonSchema } from 'ai';
import { openai } from '@ai-sdk/openai';
import { DanubeClient } from 'danube';
import { danubeTools } from 'danube/ai-sdk';

const client = new DanubeClient(); // reads DANUBE_API_KEY
const tools = danubeTools(client, { tool, jsonSchema });

const { text } = await generateText({
  model: openai('gpt-4.1'),
  tools,
  maxSteps: 6,
  prompt: 'What are the top three Hacker News stories right now?',
});
```

`danubeTools(client, helpers, options)` returns three tools keyed by name, ready to spread into `generateText`, `streamText` or an agent loop:

| tool                   | what the model gets                                                                                                              |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `danube_search_tools`  | tool ids, descriptions and parameter schemas across the catalog, with `readiness` and `reliability` when the backend stamps them |
| `danube_describe_tool` | the full schema, tips from earlier callers, readiness for this account                                                           |
| `danube_execute_tool`  | the tool's result, or an error that says what to do next                                                                         |

The AI SDK's `tool` and `jsonSchema` helpers are passed in rather than imported, so `danube` has no dependency on `ai` and the same call works with the v4 (`parameters`) and v5 (`inputSchema`) tool shapes.

Options: `serviceId` to limit search to one service, `readyOnly: true` to hide tools this account has not connected, `maxResults` for the search page size, `asText: false` to return objects instead of JSON text.

## Why three tools rather than one per catalog entry

The catalog has thousands of tools and changes daily. Search keeps the prompt small and current; `describe` gives the model the schema only for the tool it is about to call.
