Guides using Netlify AI Gateway to access AI models from OpenAI, Anthropic, and Google via provider SDKs without managing API keys. Covers setup, SDK usage, environment variables, and available models.
Ships in netlify. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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 will cause runtime errors.
Netlify AI Gateway provides access to AI models from multiple providers without managing API keys directly. It is available on all Netlify sites.
The AI Gateway acts as a proxy — you use standard provider SDKs (OpenAI, Anthropic, Google) but point them at Netlify's gateway URL instead of the provider's API. Netlify handles authentication, rate limiting, and monitoring.
OPENAI_BASE_URL is set automatically by NetlifyNo provider API keys are needed — Netlify's gateway handles authentication.
npm install openai
import OpenAI from "openai";
const openai = new OpenAI();
// OPENAI_BASE_URL is auto-configured — no API key or base URL needed
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Hello!" }],
});
npm install @anthropic-ai/sdk
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: Netlify.env.get("ANTHROPIC_BASE_URL"),
});
const message = await client.messages.create({
model: "claude-sonnet-4-5-20250929",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello!" }],
});
npm install @google/generative-ai
import { GoogleGenerativeAI } from "@google/generative-ai";
const genAI = new GoogleGenerativeAI("placeholder");
// Configure base URL via environment variable
const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash" });
const result = await model.generateContent("Hello!");
import type { Config, Context } from "@netlify/functions";
import OpenAI from "openai";
export default async (req: Request, context: Context) => {
const { prompt } = await req.json();
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: prompt }],
});
return Response.json({
response: completion.choices[0].message.content,
});
};
export const config: Config = {
path: "/api/ai",
method: "POST",
};
| Variable | Provider | Set by |
|---|---|---|
OPENAI_BASE_URL | OpenAI | Netlify (automatic) |
ANTHROPIC_BASE_URL | Anthropic | Netlify (automatic) |
These are configured automatically when AI is enabled on the site. No manual setup required.
With @netlify/vite-plugin or netlify dev, gateway environment variables are injected automatically. The AI Gateway is accessible during local development after the site has been deployed at least once.
For the list of supported models, see https://docs.netlify.com/build/ai-gateway/overview/.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
12 skills in this plugin
/netlify-blobs使用 Netlify Blobs 对象存储的指南。在不需要完整数据库的情况下存储文件、图片、文档或简单键值数据时使用。涵盖 `getStore()`、CRUD 操作、元数据、列表查询、部署作用域与站点作用域存储,以及本地开发。/netlify-caching控制 Netlify CDN 缓存的指南。在配置缓存头、设置 stale-while-revalidate、实现按需缓存清除,或了解 Netlify CDN 缓存行为时使用。涵盖 `Cache-Control`、`Netlify-CDN-Cache-Control`、缓存标签、持久缓存和框架专属缓存模式。/netlify-cli-and-deploy使用 Netlify CLI 和部署站点的指南。在安装 CLI、关联站点、部署(基于 Git 或手动)、管理环境变量或运行本地开发时使用。涵盖 `netlify dev`、`netlify deploy`、Git 与非 Git 工作流,以及环境变量管理。/netlify-confignetlify.toml 配置参考。在配置构建设置、重定向、重写、响应头、部署上下文、环境变量或任何站点级配置时使用。涵盖完整的 netlify.toml 语法,包括带通配符/条件的重定向、响应头、部署上下文、Functions 配置和 Edge Functions 配置。/netlify-deploy使用 Netlify CLI 将项目部署到 Netlify。当用户需要关联仓库、验证部署设置、执行部署,或在预览和生产流程之间选择时使用。/netlify-edge-functions编写 Netlify Edge Functions 的指南。在构建中间件、基于地理位置的逻辑、请求/响应处理、身份验证检查、A/B 测试,或任何低延迟边缘计算场景时使用。涵盖 Deno 运行时、`context.next()` 中间件模式、地理位置,以及何时选择边缘函数而非 Serverless 函数。/netlify:netlify-ai-gatewayfrom netlify
npx claudepluginhub kael-odin/codex-plugins-zh --plugin netlifyOther plugins' skills for the same job