netlify-ai-gateway
Access AI models via unified gateway endpoint
Developer Setup
Setup & Installation
npx skills add https://github.com/netlify/context-and-tools --skill netlify-ai-gatewaynpx skills add https://github.com/netlify/context-and-tools --skill netlify-ai-gatewayOverview
What This Skill Does
Netlify AI Gateway is a proxy layer that routes requests to AI models from OpenAI, Anthropic, and Google through Netlify's infrastructure. You use standard provider SDKs but point them at Netlify's gateway URL instead of the provider's API directly. Netlify handles authentication and rate limiting, so no provider API keys are needed.
Application
When to use this Skill
- Configuring integration settings for custom agent workflows.
- Optimizing query execution and response latency in production.
- Developing clean, standard-compliant implementations for enterprise services.
- Troubleshooting connection timeouts and authentication handshakes.
- Monitoring API rate limits and execution pipelines programmatically.
Documentation
Show Skills.md file
Netlify AI Gateway
IMPORTANT: Only use models listed in the "Available Models" section below. AI Gateway does not support every model a provider offers. Using an unsupported model returns an HTTP error from the gateway.
First-deploy requirement: The AI Gateway only activates after a site has had at least one production deploy. Local dev (
netlify dev,@netlify/vite-plugin) will NOT have gateway access on a brand-new project until you deploy to production once.
Netlify AI Gateway provides access to AI models from multiple providers without managing API keys directly. It is available on all Netlify sites.
How It Works
The AI Gateway acts as a proxy — you use standard 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.
Setup
- Enable AI on your site in the Netlify UI
- Deploy to production at least once — the gateway does not activate until then
- Install the provider SDK you want to use
Don't set your own OPENAI_API_KEY, ANTHROPIC_API_KEY, or GEMINI_API_KEY. Doing so disables Netlify's auto-injection and routes calls directly to the provider, bypassing the gateway.
Using OpenAI SDK
npm install openai
Recommendations