ClaudeSuperPower

netlify-ai-gateway

Skill

Reference for Netlify AI Gateway — the managed proxy that routes calls to OpenAI, Anthropic, and Google Gemini SDKs without provider API keys. Use this skill any time the user wants to add AI on a Netlify site (chat, completion, reasoning, image generation, image-to-image edit/stylize), choose or ch

Install

git clone https://github.com/netlify/context-and-tools.git ~/.claude/skills/netlify-ai-gateway

What is netlify-ai-gateway?

Reference for Netlify AI Gateway — the managed proxy that routes calls to OpenAI, Anthropic, and Google Gemini SDKs without provider API keys. Use this skill any time the user wants to add AI on a Netlify site (chat, completion, reasoning, image generation, image-to-image edit/stylize), choose or change a model, wire up the OpenAI / Anthropic / @google/genai SDK, decide which provider to use for an image-gen feature (it's Gemini-only on the gateway), or debug "model not found" / "API key missing" against the gateway. Required reading before pinning a model — the gateway exposes a curated subset, not every provider model.

What this can do

Capabilities declared in this component's own frontmatter — not inferred.

Inherit all session tools

Declares no tool restrictions — inherits every session tool

~157 tokens of context used while enabled, before you invoke anything

Documentation

README · ~9 min read

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.

Usage is credit-metered: Gateway calls draw down your Netlify AI credit/inference allowance and start returning errors once it's exhausted — there's no separate provider bill behind it. Budget for this explicitly in any bulk or fan-out design (generating content for hundreds of rows/pages, retry loops), and don't retry unbounded.

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.

Always make the call through the provider's official SDK, constructed bare (new OpenAI(), new Anthropic(), new GoogleGenAI()) — the SDK reads the auto-injected base URL and key from the environment. Don't hand-roll the gateway call with a raw fetch() and a manually-read process.env.OPENAI_API_KEY (or a hardcoded key/URL): the injected key is only a placeholder, and rolling your own request bypasses the supported path the gateway expects.

Setup

  1. Enable AI on your site in the Netlify UI

Reviews

Log in to leave a review.

No reviews yet — be the first.

Explore related

Other things in this space — across every part of the ecosystem, not just skills.