You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

ai

Package Overview
Dependencies
Maintainers
5
Versions
1024
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai - npm Package Compare versions

Comparing version
5.0.156
to
5.0.157
+1
-1
dist/internal/index.js

@@ -181,3 +181,3 @@ "use strict";

// src/version.ts
var VERSION = true ? "5.0.156" : "0.0.0-test";
var VERSION = true ? "5.0.157" : "0.0.0-test";

@@ -184,0 +184,0 @@ // src/util/download/download.ts

@@ -161,3 +161,3 @@ // internal/index.ts

// src/version.ts
var VERSION = true ? "5.0.156" : "0.0.0-test";
var VERSION = true ? "5.0.157" : "0.0.0-test";

@@ -164,0 +164,0 @@ // src/util/download/download.ts

{
"name": "ai",
"version": "5.0.156",
"version": "5.0.157",
"description": "AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript",

@@ -38,3 +38,3 @@ "license": "Apache-2.0",

"@opentelemetry/api": "1.9.0",
"@ai-sdk/gateway": "2.0.60",
"@ai-sdk/gateway": "2.0.61",
"@ai-sdk/provider": "2.0.1",

@@ -78,2 +78,3 @@ "@ai-sdk/provider-utils": "3.0.22"

"sdk",
"llm",
"mcp",

@@ -86,8 +87,14 @@ "tool-calling",

"generative",
"genai",
"chatbot",
"prompt",
"inference",
"llm",
"language-model",
"streaming"
"streaming",
"openai",
"anthropic",
"claude",
"gemini",
"xai",
"grok"
],

@@ -94,0 +101,0 @@ "scripts": {

+21
-13

@@ -21,2 +21,13 @@ ![hero illustration](./assets/hero.gif)

By default, the AI SDK uses the [Vercel AI Gateway](https://vercel.com/docs/ai-gateway) to give you access to all major providers out of the box. Just pass a model string for any supported model:
```ts
const result = await generateText({
model: 'anthropic/claude-opus-4.6', // or 'openai/gpt-5.4', 'google/gemini-3-flash', etc.
prompt: 'Hello!',
});
```
You can also connect to providers directly using their SDK packages:
```shell

@@ -26,4 +37,11 @@ npm install @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google

Alternatively you can use the [Vercel AI Gateway](https://vercel.com/docs/ai-gateway).
```ts
import { anthropic } from '@ai-sdk/anthropic';
const result = await generateText({
model: anthropic('claude-opus-4-6'), // or openai('gpt-5.4'), google('gemini-3-flash'), etc.
prompt: 'Hello!',
});
```
## Usage

@@ -37,3 +55,3 @@

const { text } = await generateText({
model: 'openai/gpt-5', // use Vercel AI Gateway
model: 'openai/gpt-5.4', // use Vercel AI Gateway
prompt: 'What is an agent?',

@@ -43,12 +61,2 @@ });

```ts
import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
const { text } = await generateText({
model: openai('gpt-5'), // use OpenAI Responses API directly
prompt: 'What is an agent?',
});
```
### Generating Structured Data

@@ -61,3 +69,3 @@

const { object } = await generateObject({
model: 'openai/gpt-5',
model: 'openai/gpt-5.4',
schema: z.object({

@@ -64,0 +72,0 @@ recipe: z.object({

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display