Agent skill · AI & Agents

vercel-ai-gateway

Vercel AI Gateway provider fallback and host order configuration. Use when working with aiGateway, hostOrder, getGatewayOptions, provider fallback, gateway configuration, or multi-host model routing.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill vercel-ai-gateway --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 7 KB
Bundled scripts: none
Path: skills/ai-llm/vercel-ai-gateway/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Vercel AI Gateway Patterns Vercel AI Gateway routes requests to multiple inference hosts with automatic fallback. Enables specifying host order per model (e.g., try Cerebras first, fall back to Groq). ## Core Concepts **Host order**: Array of inference provider names to try in sequence. Only set for specific models needing fallback. **Gateway options**: Object passed to Vercel AI SDK with `gateway` key (SDK requirement). **User tracking**: Propagate `userId` and `tags` for analytics/debugging. ## Key Files - `apps/web/src/lib/ai/gateway.ts` - Main gateway logic - `apps/web/src/lib/ai/providers/gateway.ts` - Gateway instantiation - `apps/web/src/lib/ai/models.ts` - Model configs with hostOrder - `packages/backend/convex/generation.ts` - Usage in generation ## Host Order Configuration ### Model Config Pattern Set `hostOrder` in model config only when fallback needed: ```typescript // From models.ts - Llama 4 Nemotron 70B (multi-host) "openai:llama-4-nemotron-70b": { id: "openai:llama-4-nemotron-70b", provider: "openai", name: "Llama 4 Nemotron 70B", contextWindow: 131000, pricing: { input: 0.15, output: 0.6 }, capabilities: ["function-calling", "thinking"], hostOrder: ["cerebras",

What's inside
Steps it walks through
  1. Core Concepts
  2. Key Files
  3. Host Order Configuration
  4. Model Config Pattern
  5. Retrieving Host Order
  6. Gateway Options Structure
  7. Building Options
  8. Conditional Order Injection
  9. Usage in Generation
  10. Basic Pattern
  11. Merging with Reasoning Options
  12. Tag Customization
  13. Helper: generateWithGateway
  14. Model-Specific Patterns
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the vercel-ai-gateway skill do?

Vercel AI Gateway provider fallback and host order configuration. Use when working with aiGateway, hostOrder, getGatewayOptions, provider fallback, gateway configuration, or multi-host model routing.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill vercel-ai-gateway --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going