Autoscaling Report: Production databases on Neon use 2.4x less compute and 50% less cost than if they were running on a provisioned platform.
/AI Gateway/Overview

Neon AI Gateway

One API for frontier and open-source models from Anthropic, OpenAI, Google, and more. Built into your Neon project.

Get early access to Neon AI Gateway

Neon AI Gateway is in private preview. Drop your email and we'll reach out with access.

Neon AI Gateway is the LLM inference layer built into the Neon backend. It lets you call models from Anthropic, OpenAI, Google, and other providers using your Neon credential, without setting up separate provider accounts. Your existing OpenAI or Anthropic SDK works without code changes. Just point it at your branch endpoint.

During the private preview, AI Gateway is available for new projects in the AWS us-east-2 region only, and requires a paid Neon plan. Inference is free during the preview. When billing begins, prices will match each provider's published list prices.

important

Participation in this Private Preview is subject to our Private Preview Terms. Access is not available to users, organizations, or entities located in or operating from regions restricted by Anthropic's Supported Regions Policy. This restriction also applies to entities that are majority owned, directly or indirectly, by companies headquartered in unsupported regions.

  • One credential for all providers. A single Neon credential gives you access to models from Anthropic, OpenAI, Google, Meta, Databricks, and Alibaba. No separate provider accounts needed.
  • Standard SDKs, one URL change. OpenAI SDK, Anthropic SDK, and google-genai all work out of the box.
  • AI follows your branches. Each branch has its own gateway endpoint. If you use Neon branches for preview deployments, AI requests from a feature branch are scoped to that branch. It's the same isolation your database already gets.
  • Streaming support. Server-sent events work on all endpoints with no extra configuration.

Quickstart

Starter templates

Browse working examples at build-on-neon.vercel.app. Two templates use AI Gateway:

ai-sdk: An image-generation agent that routes model calls through AI Gateway, stores results in Neon Storage, and writes metadata to Postgres on a Neon Function.

neon bootstrap --template ai-sdk

mastra: A personal assistant that uses AI Gateway for LLM calls with Postgres-backed memory on a Neon Function.

neon bootstrap --template mastra

Need help?

Join our Discord Server to ask questions or see what others are doing with Neon. For paid plan support options, see Support.

Was this page helpful?
Edit on GitHub

On this page

Copy neon init command