Skip to content
Night Owls.dev
Jump to a page

@nightowlsdev/provider-vercel-gateway

Adapter/Model

Any model via the Vercel AI Gateway for Night Owls swarms, one key, all providers.

What it does

Exposes `vercelGatewayModels(opts?)`, a model factory for `defineSwarm({ modelFactory })`. It wraps `@ai-sdk/gateway`'s `createGateway`, mapping a `provider/model` id (e.g. `anthropic/claude-sonnet-4-6`) to an AI SDK `LanguageModelV3` routed through the Vercel AI Gateway, so a single key reaches every provider. Reads `AI_GATEWAY_API_KEY` by default; pass `{ apiKey }` to override. Ships a `nightOwlsPlugin` manifest for CLI scaffolding; it composes with the other `provider-*` adapters, so `createModelFactory` can route some agents through the gateway and others direct. Like the other model adapters it imports only its AI SDK provider (`@ai-sdk/gateway`), zero `@mastra/*`.

Install

pnpm add @nightowlsdev/provider-vercel-gateway

Key exports

  • vercelGatewayModels
  • nightOwlsPlugin

Usage

provider-vercel-gateway.ts
import { defineSwarm } from "@nightowlsdev/core";
import { vercelGatewayModels } from "@nightowlsdev/provider-vercel-gateway";

// One key, all providers via the Vercel AI Gateway. Reads AI_GATEWAY_API_KEY.
const swarm = defineSwarm({ agents, modelFactory: vercelGatewayModels() });