Sign In

@ai-sdk/gateway

Package Overview
Dependencies
Maintainers
3
Versions
670
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/gateway

The Gateway provider for the [AI SDK](https://ai-sdk.dev/docs) allows the use of a wide variety of AI models and providers.

Source
npmnpm
Version
2.0.138
Version published
Weekly downloads
14M
-18.15%
Maintainers
3
Weekly downloads
 
Created
Source

AI SDK - Gateway Provider

The Gateway provider for the AI SDK allows the use of a wide variety of AI models and providers.

Setup

The Gateway provider is available in the @ai-sdk/gateway module. You can install it with

npm i @ai-sdk/gateway

Provider Instance

You can import the default provider instance gateway from @ai-sdk/gateway:

import { gateway } from '@ai-sdk/gateway';

Example

import { gateway } from '@ai-sdk/gateway';
import { generateText } from 'ai';

const { text } = await generateText({
  model: gateway('xai/grok-3-beta'),
  prompt:
    'Tell me about the history of the San Francisco Mission-style burrito.',
});

Documentation

Please check out the AI SDK documentation for more information.

Keywords

ai

FAQs

Package last updated on 21 Aug 2026

Related posts