neon-ai-gateway

Route LLM requests through a branch-scoped Neon gateway using one credential.

Updated Sep 13, 2026
One-click install
npx skills add https://github.com/Abhi-0930/online--lms --skill neon-ai-gateway-abhi-0930
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: neon-ai-gateway
Source: https://github.com/Abhi-0930/online--lms/tree/main/backend/.agents/skills/neon-ai-gateway
Command: npx skills add https://github.com/Abhi-0930/online--lms --skill neon-ai-gateway-abhi-0930

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @neon/ai-sdk-provider, @neon/env, @neon/config, ai, @mastra/core, openai.

What problem does it solve? Managing separate API keys, accounts, and billing for multiple LLM providers (OpenAI, Anthropic, Google, Meta) adds friction to building AI features. This Skill configures the Neon AI Gateway so one Neon credential reaches the entire model catalog, with requests scoped to your database branch. ## Core Features & Use Cases - Unified Model Access: Call frontier and open-source models (Claude, GPT, Gemini, and more) through a single OpenAI-compatible endpoint by changing only the model field. - SDK Compatibility: Works with the OpenAI SDK, Anthropic SDK, google-genai, Vercel AI SDK, and Mastra by changing only the base URL. - Branch-Scoped AI: Each Neon branch gets its own gateway host, so preview and CI environments have isolated AI requests matching their data isolation. - Use Case: You are adding a chat feature to your Next.js app backed by Neon. Enable aiGateway in neon.ts, run neon deploy, and stream responses from claude-sonnet-4-6 or gpt-5-mini using the Vercel AI SDK with zero extra provider accounts. ## Quick Start Enable the Neon AI Gateway in my neon.ts config and show me how to call Claude through it using the Vercel AI SDK.

Frequently Asked Questions about neon-ai-gateway

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I call an LLM through the Neon AI Gateway?▼

Enable aiGateway in your neon.ts file and run neon deploy to provision the gateway. Neon injects NEON_AI_GATEWAY_TOKEN and NEON_AI_GATEWAY_BASE_URL, which you pass as the apiKey and baseURL to your OpenAI, Anthropic, or Gemini SDK.

What is the best way to build AI agents with the Neon AI Gateway?▼

Use the Vercel AI SDK with the @neon/ai-sdk-provider package, which reads the injected gateway env vars with zero configuration and routes each model to the best endpoint. Mastra is an alternative using a neon/<model> magic string with @mastra/core 1.47 or later.

Does the Neon AI Gateway work with the OpenAI SDK?▼

Yes, the OpenAI SDK works by setting apiKey to NEON_AI_GATEWAY_TOKEN and baseURL to the gateway host plus /v1 for chat completions or /openai/v1 for the Responses API. Only the base URL and credential change from a standard OpenAI setup.

Why is a model missing from the Neon AI Gateway catalog?▼

On paid plans, accounts can start with a reduced catalog where some flagship models are unavailable. Check GET /v1/models on your branch endpoint for the live list, and request access to more models from your branch's AI Gateway page in the Neon Console.

Can I use the Neon AI Gateway on the free plan?▼

No, the free plan blocks gateway provisioning entirely; neon config apply and neon checkout refuse to enable it. Foundation model access requires a paid Neon plan, and the gateway is currently available only in us-east-2 and eu-central-1.

How do I list available models on the Neon AI Gateway at runtime?▼

Send a GET request to ${NEON_AI_GATEWAY_BASE_URL}/v1/models with the gateway token as a bearer credential. It returns an OpenAI-compatible list of model IDs servable on that branch; the endpoint is only served on the /v1 dialect, not /openai/v1.