netlify-ai-gateway

Configure Netlify AI Gateway to route OpenAI, Anthropic, and Gemini SDK calls without provider API keys.

1|Updated May 13, 2026
One-click install
npx skills add https://github.com/SyedArmanAli2003/AgroNaV --skill netlify-ai-gateway-syedarmanali2003
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: netlify-ai-gateway
Source: https://github.com/SyedArmanAli2003/AgroNaV/tree/main/.agents/skills/netlify-ai-gateway
Command: npx skills add https://github.com/SyedArmanAli2003/AgroNaV --skill netlify-ai-gateway-syedarmanali2003

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openai, @anthropic-ai/sdk, @google/genai.

What problem does it solve? Adding AI features to a Netlify site normally requires managing separate API keys for OpenAI, Anthropic, or Google, plus knowing which models each provider supports. This Skill explains how Netlify AI Gateway proxies those SDK calls with auto-injected credentials, which models are actually available, and how to avoid common setup errors. ## Core Features & Use Cases - Keyless SDK setup: Use the standard OpenAI, Anthropic, and @google/genai SDKs with auto-injected base URLs and placeholder keys, no provider accounts needed. - Curated model reference: Lists every chat, reasoning, and image model the gateway actually supports, preventing "model not found" errors from unsupported model names. - Image generation guidance: Shows text-to-image and image-to-image patterns using Gemini image models, the only image provider routed through the gateway. - Use Case: You are building a Netlify Function that generates product descriptions. Use this Skill to wire up the OpenAI SDK with zero key configuration, pick a supported model like gpt-4o-mini, and debug why local dev fails before the first production deploy. ## Quick Start Ask the assistant to add an AI chat endpoint to your Netlify site using the AI Gateway with a supported model.

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 on Netlify without an API key?

Enable AI on your Netlify site and deploy to production once. Netlify auto-injects OPENAI_BASE_URL and a placeholder OPENAI_API_KEY, so the standard openai SDK works with no constructor arguments and calls route through the AI Gateway.

Which models does Netlify AI Gateway support?

The gateway exposes a curated subset: Anthropic Claude haiku, sonnet, and opus families; OpenAI gpt-4o through gpt-5.5 plus o3 and o4-mini reasoning models; and Gemini chat and image models. Unsupported model names return an HTTP error.

Can I generate images through Netlify AI Gateway?

Yes, but only with Gemini image models such as gemini-2.5-flash-image or gemini-3.1-flash-image-preview. OpenAI image models like gpt-image-1 and dall-e are not routed through the gateway. Images return as base64 inlineData parts.

Why does Netlify AI Gateway fail in local development?

The gateway only activates after at least one production deploy. A brand-new local-only project using netlify dev or @netlify/vite-plugin will see "API key missing" or "model not found" errors until you deploy to production once.

What happens if I set my own OPENAI_API_KEY on Netlify?

Setting your own provider key disables Netlify's auto-injection and routes calls directly to the provider, bypassing the gateway entirely. Your usage will not be tracked by the gateway and gateway billing will not apply.

What are the limitations of Netlify AI Gateway?

The gateway supports a 200k-token context window and does not support batch inference, custom request headers, or OpenAI priority processing. Anthropic prompt caching is limited to the 5-minute ephemeral cache, and Gemini explicit caching is unsupported.