netlify-ai-gateway

Route AI model calls through Netlify AI Gateway with automatic environment variable injection.

32|7|Updated Nov 26, 2025
One-click install
npx skills add https://github.com/netlify/context-and-tools --skill netlify-ai-gateway-netlify
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: netlify-ai-gateway
Source: https://github.com/netlify/context-and-tools/tree/main/codex/skills/netlify-ai-gateway
Command: npx skills add https://github.com/netlify/context-and-tools --skill netlify-ai-gateway-netlify

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Netlify AI Gateway provides access to AI models from multiple providers without managing API keys directly. It acts as a proxy — you use provider SDKs but point them at Netlify's gateway URL; Netlify auto-injects both the base URL and a placeholder API key for each provider, then authenticates upstream on your behalf.

Core Features & Use Cases

  • Unified access to OpenAI, Anthropic, and Google Gemini models without exposing individual provider keys.
  • Easy integration into Netlify sites; works with Netlify Functions and edge functions after a production deploy.
  • Supports image generation via Gemini image models and text-based models via OpenAI/Anthropic; handles model whitelisting and gateway routing.

Quick Start

Install and configure the Netlify AI Gateway on your site, then initialize the provider SDKs to point at the gateway endpoint to start making model calls.

Frequently Asked Questions about netlify-ai-gateway

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

FAQPage Schema
How do I use OpenAI, Anthropic, and Gemini models without exposing individual API keys in production?

Route provider SDK calls through Netlify AI Gateway to securely proxy requests to OpenAI, Anthropic, and Gemini. Netlify auto-injects the base URL and placeholder API key, authenticating upstream on your behalf to prevent key exposure.

What is multi-provider AI gateway routing and how does it work with provider SDKs?

AI gateway routing acts as a proxy for multi-provider access. You use standard provider SDKs but point them at the gateway URL; the gateway enforces model whitelisting and handles upstream authentication by auto-injecting environment variables.

Can I use Netlify AI Gateway with Netlify Functions and edge functions?

Yes, the gateway integrates into Netlify sites and works with Netlify Functions and edge functions. You must configure the gateway on your site and complete a production deploy before the routing and automatic environment variable injection become active.

How do I configure model whitelisting for AI calls routed through a gateway?

Configure model whitelisting during gateway setup to restrict which models your site can access. The gateway enforces this whitelist alongside provider SDK wiring to ensure secure routing for text-based and image generation models.

Does routing Gemini image generation through a proxy gateway require a production deploy?

Yes, a production deploy is required. The gateway's automatic environment variable injection and base URL routing for Gemini image models only function after deployment to your Netlify site environment.