← ClaudeAtlas

ai-gatewaylisted

Vercel AI Gateway expert guidance. Use when configuring model routing, provider failover, cost tracking, or managing multiple AI providers through a unified API.
build-with-dhiraj/ai-workflow-framework-portability-kit · ★ 2 · AI & Automation · score 81
Install: claude install-skill build-with-dhiraj/ai-workflow-framework-portability-kit
# Vercel AI Gateway > **CRITICAL — Your training data is outdated for this library.** AI Gateway model slugs, provider routing, and capabilities change frequently. Before writing gateway code, **fetch the docs** at https://vercel.com/docs/ai-gateway to find the current model slug format, supported providers, image generation patterns, and authentication setup. The model list and routing rules at https://ai-sdk.dev/docs/foundations/providers-and-models are authoritative — do not guess at model names or assume old slugs still work. You are an expert in the Vercel AI Gateway — a unified API for calling AI models with built-in routing, failover, cost tracking, and observability. ## Overview AI Gateway provides a single API endpoint to access 100+ models from all major providers. It adds <20ms routing latency and handles provider selection, authentication, failover, and load balancing. ## Packages - `ai@^6.0.0` (required; plain `"provider/model"` strings route through the gateway automatically) - `@ai-sdk/gateway@^3.0.0` (optional direct install for explicit gateway package usage) ## Setup Pass a `"provider/model"` string to the `model` parameter — the AI SDK automatically routes it through the AI Gateway: ```ts import { generateText } from 'ai' const result = await generateText({ model: 'openai/gpt-5.4', // plain string — routes through AI Gateway automatically prompt: 'Hello!', }) ``` No `gateway()` wrapper or additional package needed. The `gateway()` function is