Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add PracticalSwan/agent-skills --skill netlify-ai-gatewaygit clone --depth 1 https://github.com/PracticalSwan/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/practicalswan/agent-skills/netlify-ai-gateway)<a href="https://agentmods.dev/skills/practicalswan/agent-skills/netlify-ai-gateway"><img src="https://agentmods.dev/badge/skills/practicalswan/agent-skills/netlify-ai-gateway/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/practicalswan/agent-skills/netlify-ai-gateway"><img src="https://agentmods.dev/badge/skills/practicalswan/agent-skills/netlify-ai-gateway.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00135 | $0.03959 |
| Opus 5.5 | $0.00054 | $0.01584 |
| Sonnet 5.5 | $0.00027 | $0.00792 |
| Haiku 4.5 | $0.00014 | $0.00396 |
Grade C, and why
netlify-ai-gateway scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 18d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Hidden instructionshighPrompt injection
Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.
<!-- system: agent-context/ai-gateway/system.md — human-owned, merged by ctx-gen; edit system.md, not this section --> This is a copy
91% identical to netlify-ai-gateway — 65 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 321 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Netlify AI Gateway
Call AI models from Netlify compute using the provider's official SDK. The gateway injects provider credentials automatically — instantiate the SDK with no args and it works.
Use the provider SDK with injected env credentials. Do not hand-roll a raw fetch() against the gateway URL, and do not wire calls to NETLIFY_AI_GATEWAY_KEY / NETLIFY_AI_GATEWAY_URL as your default path — those are for third-party/unsupported libraries only (see below).
Footguns (read first)
- Not browser-callable. Gateway calls belong in Functions or Edge Functions — never in client-side code. The browser has no injected credentials.
- Runtime-only credentials. Never call the gateway from build scripts, prerender/SSG, or build plugins — those get no credentials and fail. Do AI work at request time; cache to Netlify Blobs if output must look precomputed.
- 60-second sync timeout. A gateway call in a synchronous function is bound by the 60s function timeout. Stream long generations (SDK streaming +
ReadableStream), or use a background function that persists output for the client to fetch. Never leave a slow generation unstreamed. - Requires one production deploy. The gateway does not activate until a project has at least one production deploy. Even for local dev, run
netlify deploy --prodonce first. - Don't hardcode model lists. Available models change. Check the live providers endpoint (
https://api.netlify.com/api/v1/ai-gateway/providers/detailed) rather than baking in a static list. - OpenRouter SDK needs 1.2.43+. Earlier versions ignore
OPENROUTER_BASE_URL, call openrouter.ai directly, and fail with401 Missing Authentication header.
Where code goes
Write normal Function/handler code — there is no AI-specific file type. A function at netlify/functions/joke.js exporting config = { path: "/api/joke" } is served at /api/joke under both netlify dev and production.
Provider SDKs (instantiate with no args)
The gateway injects each provider's own env vars, so the official SDK works with zero config.
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 18d ago Changed 52eba3709280
- 1mo ago Changed · +69 lines f18c2fdda7b6
- 2mo ago Changed c754832f2fe7
- 2mo ago Changed 16451d67c1c5
- 3mo ago First seen · 252 lines · 135 tokens per session scan C 18e1c9e77ba0
netlify-ai-gateway is a skill published in the GitHub repository PracticalSwan/agent-skills (25 stars, last pushed 18d ago), licensed MIT. It adds 135 tokens to every session and 3,959 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it C with 1 finding (hidden instructions). It is 91% identical to netlify-ai-gateway, differing in 65 lines, and is treated as a copy.
netlify-ai-gateway compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| netlify-ai-gatewayPracticalSwan/agent-skills | Skill | 25 | 18d ago | MIT | C | 135 | Codex |
| integrate-ai-gatewayMacPaw/ai-sdk-typescript | Skill | 58 | 3d ago | MIT | C | 119 | Claude Code, Codex |
| deploy-maas-modelMichalSteczko/rhoai-agentic-skills | Skill | 2 | 2mo ago | Apache-2.0 | A | 41 | Claude Code, Codex |
| gemini-nano-bananaaiagenta2z/onekey-gateway | Skill | 52 | 7mo ago | none | A | 19 | Claude Code, Codex |
| add-promptcyanheads/cyanheads-mcp-server | Skill | 1 | 17d ago | Apache-2.0 | A | 37 | Claude Code |
| agent-platform-model-registrygoogle/skills | Skill | 26k | today | Apache-2.0 | A | 60 | Claude Code, Codex |
| llm-evaluationsickn33/agentic-awesome-skills | Skill | 51k | today | MIT | A | 25 | Claude Code |